Package javax.faces.component.html

Examples of javax.faces.component.html.HtmlOutputLink


       
        HtmlCommandLink link2 = (HtmlCommandLink) form.findComponent("link2");
        Assert.assertNotNull(link2);
        Assert.assertEquals(1, link2.getActionListeners().length);
       
        HtmlOutputLink link3 = (HtmlOutputLink) form.findComponent("link3");
        Assert.assertNotNull(link3);
        Assert.assertEquals("/my/new/location.txt", link3.getValue());
       
        HtmlOutcomeTargetLink link4 = (HtmlOutcomeTargetLink) form.findComponent("link4");
        Assert.assertNotNull(link4);
        Assert.assertEquals("rollback", link4.getOutcome());
       
View Full Code Here


    commandLink.setStyleClass(this.getCssClassFirstPage());
    commandLink.setTitle(this
        .getProperty("catalog.general.pageCursor.first.alt"));
    link = commandLink;
  } else {
    HtmlOutputLink outputLink = new HtmlOutputLink();
    outputLink.setStyleClass(this.getCssClassFirstPage());
    outputLink.setValue("#");
    outputLink.setTitle(this
        .getProperty("catalog.general.pageCursor.first.alt"));
    link = outputLink;
  }
  link.getAttributes().put(PageEvents.goToPage.name(), 1);
  link.setId(this.getIdFirstPage());
  HtmlOutputText linkText = new HtmlOutputText();
  linkText.setId(this.getIdPrefix() + "txtFirstPage"); //$NON-NLS-1$
  linkText.setValue(this.getProperty("catalog.general.pageCursor.first")); //$NON-NLS-1$
  link.getChildren().add(linkText);
  mainPanel.getChildren().add(link);

  // previousPage link
  link = null;
  if (!useAjax) {
    HtmlCommandLink commandLink = new HtmlCommandLink();
    if (actionListenerMethod != null) {
      commandLink.setActionListener(actionListenerMethod);
    }
    if (actionMethod != null) {
      commandLink.setAction(actionMethod);
    }
    commandLink.setStyleClass(this.getCssClassPreviousPage());
    commandLink.setTitle(this
        .getProperty("catalog.general.pageCursor.previous.alt"));
    link = commandLink;
  } else {
    HtmlOutputLink outputLink = new HtmlOutputLink();
    outputLink.setValue("#");
    outputLink.setStyleClass(this.getCssClassPreviousPage());
    outputLink.setTitle(this
        .getProperty("catalog.general.pageCursor.previous.alt"));
    link = outputLink;
   
  }
  link.setId(this.getIdPreviousPage());
  linkText = new HtmlOutputText();
  linkText.setId(this.getIdPrefix() + "txtPreviousPage"); //$NON-NLS-1$
  linkText.setValue(this.getProperty("catalog.general.pageCursor.previous")); //$NON-NLS-1$
  link.getChildren().add(linkText);
  mainPanel.getChildren().add(link);

  // Enumerated Pages link
  HtmlPanelGrid grid = new HtmlPanelGrid();
  grid.setId(this.getIdEnumPagesPanel());
  mainPanel.getChildren().add(grid);
  grid.setCellpadding("0"); //$NON-NLS-1$
  grid.setCellspacing("0"); //$NON-NLS-1$

  // nextPage link
  link = null;
  if (!useAjax) {
    HtmlCommandLink commandLink = new HtmlCommandLink();
    if (actionListenerMethod != null) {
      commandLink.setActionListener(actionListenerMethod);
    }
    if (actionMethod != null) {
      commandLink.setAction(actionMethod);
    }
    commandLink.setStyleClass(this.getCssClassNextPage());
    link = commandLink;
  } else {
    HtmlOutputLink outputLink = new HtmlOutputLink();
    outputLink.setValue("#");
    outputLink.setStyleClass(this.getCssClassNextPage());
    outputLink.setTitle(this.getProperty("catalog.general.pageCursor.next.alt"));
    link = outputLink;
  }
  link.setId(this.getIdNextPage());
  linkText = new HtmlOutputText();
  linkText.setId(this.getIdPrefix() + "txtNextPage"); //$NON-NLS-1$
  linkText.setValue(this.getProperty("catalog.general.pageCursor.next")); //$NON-NLS-1$
  link.getChildren().add(linkText);
  mainPanel.getChildren().add(link);

  // lastPage link
  link = null;
  if (!useAjax) {
    HtmlCommandLink commandLink = new HtmlCommandLink();
    if (actionListenerMethod != null) {
      commandLink.setActionListener(actionListenerMethod);
    }
    if (actionMethod != null) {
      commandLink.setAction(actionMethod);
    }
   
    commandLink.setStyleClass(this.getCssClassLastPage());
    commandLink.setTitle(this
        .getProperty("catalog.general.pageCursor.last.alt"));
    link = commandLink;
  } else {
    HtmlOutputLink outputLink = new HtmlOutputLink();
    outputLink.setValue("#");
    outputLink.setStyleClass(this.getCssClassLastPage());
    outputLink.setTitle(this
        .getProperty("catalog.general.pageCursor.last.alt"));
    link = outputLink;
  }
  link.setId(this.getIdLastPage());
  linkText = new HtmlOutputText();
View Full Code Here

  for(int i = lowNum; i <= highNum && i <= pageCursor.getTotalPageCount(); i++) {
    if(i <= 0) {
      continue;
    }
    if (useAjax) {
      link = new HtmlOutputLink();
    } else {
      link = new HtmlCommandLink();
    }
    link.setId(this.getIdEnumPageLink(i));
    // commandLink.setValue(i);
    if (!useAjax) {
      HtmlCommandLink commandLink = (HtmlCommandLink) link;
      if (pActionMethodBind != null) {
        commandLink.setActionListener(pActionMethodBind);
      }
      if (actionMethod != null) {
        commandLink.setAction(actionMethod);
      }
      if (i != currentPage) {
        commandLink.setStyleClass(this.getCssClassOtherEnumPageLinks());
      } else {
        commandLink.setStyleClass(this.getCssClassCurrentEnumPageLink());

        // If you change this then change decode
        link.getAttributes().put(PageEvents.goToPage.name(), i);
        commandLink.setTitle(propertyPrefix + " " + i);
      }
    } else {
      HtmlOutputLink outputLink = (HtmlOutputLink) link;
      if (i != currentPage) {
        outputLink.setStyleClass(this.getCssClassOtherEnumPageLinks());
      } else {
        outputLink.setStyleClass(this.getCssClassCurrentEnumPageLink());
        outputLink.setValue("#");
        link.getAttributes().put(PageEvents.goToPage.name(), i);
        outputLink.setTitle(propertyPrefix + " " + i);
      }
      outputLink.setOnclick(this.readJscriptOnclickPage(i));
    }
    outputText = new HtmlOutputText();
    outputText.setValue(i);
    outputText.setId(this.getIdPrefix() + "txtPageNum" + i); //$NON-NLS-1$
    link.getChildren().add(outputText);
View Full Code Here

TOP

Related Classes of javax.faces.component.html.HtmlOutputLink

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.