Package javax.faces.component.html

Examples of javax.faces.component.html.HtmlPanelGrid


  {

    HtmlPanelGroup panelGroup1 = new HtmlPanelGroup();
    panelGroup1.setTransient(true);
   
    HtmlPanelGrid panelGrid1 = new HtmlPanelGrid();
    panelGrid1.setTransient(true);
   
    panelGrid1.setColumns(2);
    panelGrid1.setStyle("style='vertical-align: top'");
   
    HtmlPanelGroup panelGroup2 = new HtmlPanelGroup();
    panelGroup2.setTransient(true);
   
    HtmlPanelGrid panelGrid2 = new HtmlPanelGrid();
    panelGrid2.setTransient(true);
   
    panelGrid2.setColumns(1);
   
    /** BUTO GE **/
      UICommandLink clGE = buildCommandLinkRich(
          "GE_" + nomColumna,
          null,
          renderList ,
          executeList);
     
      ValueExpression vGE = (ValueExpression) Utils.resolveExpression("/images/ElementPlus.jpg");
      HtmlGraphicImage giGE = buildGraphicImage(
          "GE_" + nomColumna,
          vGE,
          "Mayor que");
     
      clGE.getChildren().add(giGE);
     
      // setPropertyBean (ge = greater or equal,...)
      clGE.addActionListener(setPropertyActionListener(
            valueExpressionOperadors,
            "ge",
            String.class));
     
      panelGrid2.getChildren().add(clGE);
    /*************************/
   
   
    /** BUTO LE **/
      UICommandLink clLE = buildCommandLinkRich(
              "LE_" + nomColumna,
              null,
              renderList ,
              executeList);
     
      ValueExpression vLE = (ValueExpression) Utils.resolveExpression("/images/ElementMinus.jpg");
      HtmlGraphicImage giLE = buildGraphicImage(
              "LE_" + nomColumna,
              vLE,
              "Menor que");
     
      clLE.getChildren().add(giLE);
     
      // setPropertyBean (ge = greater or equal,...)
      clLE.addActionListener(setPropertyActionListener(
              valueExpressionOperadors,
              "le",
              String.class));
     
      panelGrid2.getChildren().add(clLE);
    /*************************/
   
    panelGroup2.getChildren().add(panelGrid2);

    HtmlPanelGroup panelGroup3 = new HtmlPanelGroup();
    panelGroup3.setTransient(true);
   
    HtmlPanelGrid panelGrid3 = new HtmlPanelGrid();
    panelGrid3.setTransient(true);
    panelGrid3.setColumns(1);
   

    ValueExpression vFiltre =  (ValueExpression) Utils.resolveExpression(valueExpressionFiltre);
   
    HtmlInputText it = buildInputText(
        "butoneraNumerica_it_" + idColumna ,
        vFiltre,
        "width:50px",
        20,
        "", // requiredMessage
        ""// messageConverter
        tipusColumna,
        false,
        true, // transient !!!!!!!!
        minimum,
        maximum);        
    afegirAjax(
        it,
        "blur",
        renderList,
        executeList);
     

    panelGrid3.getChildren().add(it);
   
    panelGroup3.getChildren().add(panelGrid3);
   
    panelGrid1.getChildren().add(panelGroup2);
    panelGrid1.getChildren().add(panelGroup3);
View Full Code Here


                .getExpressionFactory();
        ELContext elContext = facesContext.getELContext();
       
        form = new HtmlForm();       
      
        HtmlPanelGrid panelgrid = new HtmlPanelGrid();
        panelgrid.setColumns(1);
        panelgrid.setBorder(0);
        form.getChildren().add(panelgrid);  
       
        UIOutputPanel panel = new UIOutputPanel();
        panel.setId("panel");
        panelgrid.getChildren().add(panel);
       
       
        UICalendar calendar = (UICalendar) facesContext.getApplication().createComponent(facesContext, "org.richfaces.component.UICalendar", "org.richfaces.renderkit.html.CalendarRenderer");

       
View Full Code Here

        String captionClass;
        String captionStyle;

        if (component instanceof HtmlPanelGrid) {
            HtmlPanelGrid panelGrid = (HtmlPanelGrid) component;
            captionClass = panelGrid.getCaptionClass();
            captionStyle = panelGrid.getCaptionStyle();
        } else if (component instanceof HtmlDataTable) {
            HtmlDataTable dataTable = (HtmlDataTable) component;
            captionClass = dataTable.getCaptionClass();
            captionStyle = dataTable.getCaptionStyle();
        } else {
View Full Code Here

        String captionClass;
        String captionStyle;

        if (component instanceof HtmlPanelGrid) {
            HtmlPanelGrid panelGrid = (HtmlPanelGrid) component;
            captionClass = panelGrid.getCaptionClass();
            captionStyle = panelGrid.getCaptionStyle();
        } else if (component instanceof HtmlDataTable) {
            HtmlDataTable dataTable = (HtmlDataTable) component;
            captionClass = dataTable.getCaptionClass();
            captionStyle = dataTable.getCaptionStyle();
        } else {
View Full Code Here

 
  // make the header
  StringBuffer sbOnclick = new StringBuffer();
  sbOnclick.append("mddOnSectionClicked('").append(sSectionId).append("')");
 
  HtmlPanelGrid headerTable = new HtmlPanelGrid();
  headerTable.setColumns(3);
  headerTable.setStyleClass("sectionHeader");
  headerTable.setSummary(msgBroker.retrieveMessage("catalog.general.designOnly"));
  headerTable.setOnclick(sbOnclick.toString());
 
  HtmlSelectBooleanCheckbox checkBox = new HtmlSelectBooleanCheckbox();
  checkBox.setId(sCheckboxId);
  checkBox.setSelected(getOpen());
  checkBox.setStyle("display:none;");
  headerTable.getChildren().add(checkBox);
 
  HtmlGraphicImage img = new HtmlGraphicImage();
  img.setId(sImgId);
  setGraphicUrl(img);
  headerTable.getChildren().add(img);
 
  HtmlOutputText caption = new HtmlOutputText();
  caption.setValue(sCaption);
  caption.setStyleClass("sectionCaption");
  headerTable.getChildren().add(caption);
  if (getLabel() != null) {
    panel.getChildren().add(headerTable);
  } else {
    panel.setStyleClass("");
  }
 
  // make the section body
  boolean bContainerOnly = (getLabel() == null);
  String sBodyClass = "sectionBody";
  if (bContainerOnly) sBodyClass= "";
  HtmlPanelGrid sectionBody = new HtmlPanelGrid();
  sectionBody.setId(sBodyId);
  sectionBody.setStyleClass(sBodyClass);
  setBodyDisplay(sectionBody);
  panel.getChildren().add(sectionBody);
 
  // make the table to hold section parameters, add all parameters
  HtmlPanelGrid parametersTable = new HtmlPanelGrid();
  parametersTable.setId(sParamsId);
  parametersTable.setColumns(2);
  parametersTable.setStyleClass("parameters");
  parametersTable.setSummary(msgBroker.retrieveMessage("catalog.general.designOnly"));
  boolean hasMap = false;
  for (Parameter parameter: getParameters().values()) {
    HtmlOutputText cmpLabel = null;
    UIComponent cmpValue = null;
   
    // check for a binary thumbnail
    if (parameter.getMeaningType().equalsIgnoreCase(Meaning.MEANINGTYPE_THUMBNAIL_URL)) {
      if (schema.getMeaning().getThumbnailUrl().length() == 0) {
        String uuid = Val.chkStr(context.extractHttpServletRequest().getParameter("uuid"));
        if ((uuid.length() > 0) && (schema.getMeaning().getThumbnailBinary().length() > 0)) {
          try {
            String thumbUrl = "/thumbnail?uuid="+URLEncoder.encode(uuid,"UTF-8");
            parameter.getContent().getSingleValue().setValue(thumbUrl);
          } catch (UnsupportedEncodingException e) {}
        }
      }
    }
   
    boolean bDisplay = parameter.getVisible() && parameter.getVisibleOnDetails() &&
                       !parameter.getContent().isValueEmpty() &&
                       (parameter.getInput() != null);
    if ((parameter.getInput() instanceof InputMap)) {
      cmpValue = parameter.getInput().makeOutputComponent(context,this,parameter);
      if (cmpValue != null) {
        parametersTable.getChildren().add(cmpValue);
        hasMap = true;
      }
    } else if (bDisplay) {
      cmpValue = parameter.getInput().makeOutputComponent(context,this,parameter);
      if (cmpValue != null) {
        cmpLabel = new HtmlOutputText();
        cmpLabel.setValue(msgBroker.retrieveMessage(parameter.getLabel().getResourceKey()));
        parametersTable.getChildren().add(cmpLabel);
        parametersTable.getChildren().add(cmpValue);
      }
    }
  }
  parametersTable.setColumnClasses(hasMap? ",parameterValue": "parameterLabel,parameterValue");
  if (parametersTable.getChildCount() > 0) {
    bHadParameters = true;
    sectionBody.getChildren().add(parametersTable);
  }
 
  // append all sub-sections
View Full Code Here

  } else if (bIsOptional) { 
   
    HtmlPanelGroup captionPanel = new HtmlPanelGroup();
    captionPanel.setStyleClass("optionalSectionHeader");
   
    HtmlPanelGrid headerTable = new HtmlPanelGrid();
    headerTable.setColumns(2);
    headerTable.setStyleClass("optionalSectionHeader");
    headerTable.setSummary(msgBroker.retrieveMessage("catalog.general.designOnly"));
   
    HtmlSelectBooleanCheckbox checkBox = new HtmlSelectBooleanCheckbox();
    checkBox.setId(sCheckboxId);
    checkBox.setSelected(getOpen());
    checkBox.setOnclick(sbOnclick.toString());
    headerTable.getChildren().add(checkBox);
   
    HtmlOutputLabel caption = new HtmlOutputLabel();
    // even label has to have unique id (for GlassFish)
    caption.setId(sCheckboxId+"label");
    caption.setFor(sCheckboxId);
    caption.setValue(sCaption);
    caption.setStyleClass("sectionCaption");
    headerTable.getChildren().add(caption);
    panel.getChildren().add(headerTable);   
   
  } else {
   
    HtmlPanelGrid headerTable = new HtmlPanelGrid();
    headerTable.setColumns(3);
    headerTable.setStyleClass("mandatorySectionHeader");
    headerTable.setSummary(msgBroker.retrieveMessage("catalog.general.designOnly"));
    headerTable.setOnclick(sbOnclick.toString());
   
    HtmlSelectBooleanCheckbox checkBox = new HtmlSelectBooleanCheckbox();
    checkBox.setId(sCheckboxId);
    checkBox.setSelected(getOpen());
    //checkBox.setOnclick(sbOnclick.toString());
    checkBox.setStyle("display:none;");
    headerTable.getChildren().add(checkBox);
   
    HtmlGraphicImage img = new HtmlGraphicImage();
    img.setId(sImgId);
    setGraphicUrl(img);
    headerTable.getChildren().add(img);
   
    HtmlOutputText caption = new HtmlOutputText();
    caption.setValue(sCaption);
    caption.setStyleClass("sectionCaption");
   
    headerTable.getChildren().add(caption);
    if (getLabel() != null) {
      panel.getChildren().add(headerTable);
    } else {
      panel.setStyleClass("");
    }
    
  }
 
  // make the section body
  boolean bContainerOnly = (getLabel() == null);
  String sBodyClass = "sectionBody";
  if (bContainerOnly) sBodyClass= "";
  HtmlPanelGrid sectionBody = new HtmlPanelGrid();
  sectionBody.setId(sBodyId);
  sectionBody.setStyleClass(sBodyClass);
  setBodyDisplay(sectionBody);
  panel.getChildren().add(sectionBody);
 
 
  // make the table to hold section parameters, add all parameters
  HtmlPanelGrid parametersTable = new HtmlPanelGrid();
  parametersTable.setId(sParamsId);
  parametersTable.setColumns(2);
  parametersTable.setStyleClass("parameters");
  parametersTable.setColumnClasses("parameterLabel,parameterInput");
  parametersTable.setSummary(msgBroker.retrieveMessage("catalog.general.designOnly"));
  for (Parameter parameter: getParameters().values()) {
    if (parameter.getVisible()) {
      UIComponent cmpLabel = null;
      if (parameter.getLabel() != null) {
        cmpLabel = parameter.getLabel().makeEditorLabel(context,this,parameter);
      }
      if (cmpLabel == null) cmpLabel = new HtmlOutputText();
      parametersTable.getChildren().add(cmpLabel);
      if (parameter.getInput() != null) {
        UIComponent cmp = parameter.getInput().makeInputComponent(context,this,parameter);
        if (cmp != null) parametersTable.getChildren().add(cmp);
      }
    } else {
     
      // non-visible hidden text
      if ((parameter.getInput() != null&& (parameter.getInput() instanceof InputText)) {
        HtmlInputHidden cmpLabel = new HtmlInputHidden();
        cmpLabel.setId(parameter.getInput().getFacesId()+"-plcHldr");
        HtmlInputHidden cmp = new HtmlInputHidden();
        cmp.setId(parameter.getInput().getFacesId());
        parameter.getInput().setComponentValue(context,cmp,parameter);
        parametersTable.getChildren().add(cmpLabel);
        parametersTable.getChildren().add(cmp);
      }
    }
  }
  if (parametersTable.getChildCount() > 0) {
    sectionBody.getChildren().add(parametersTable);
  }
 
  // append all sub-sections
  for (Section section: getSections().values()) {
View Full Code Here

  txtLabel.setStyleClass(Messages.getString("gpt.jsfcomponent.pageCursorStatisticsLabel")); //$NON-NLS-1$
  txtLabel.setEscape(false);
  String lblPosition = this.getLabelPosition();
 
  // rz
  HtmlPanelGrid mainPanel = new HtmlPanelGrid();
  mainPanel.setColumns(100);
  mainPanel.setId(this.getIdMainPanel());
  mainPanel.setStyleClass(Messages.getString("gpt.jsfcomponent.pageCursorMainPanel")); //$NON-NLS-1$
  mainPanel.setCellpadding("0"); //$NON-NLS-1$
  mainPanel.setCellspacing("0"); //$NON-NLS-1$
  // Add label as header if applicable
  if(Label.above.name().equalsIgnoreCase(lblPosition)) {
    mainPanel.getFacets().put("header", txtLabel); //$NON-NLS-1$
  }
 
  // Add label as footer if applicable
  if(Label.below.name().equalsIgnoreCase(lblPosition)) {
    mainPanel.getFacets().put("footer", txtLabel); //$NON-NLS-1$
  }
  // Add label to left side if applicable
  if(Label.leftSide.name().equalsIgnoreCase(lblPosition)) {
    mainPanel.getChildren().add(txtLabel);
  }

  // firstPage link
  UIComponent link = null;
  if (!useAjax) {
    HtmlCommandLink commandLink = new HtmlCommandLink();
    if (actionListenerMethod != null) {
      commandLink.setActionListener(actionListenerMethod);
    }
    if (actionMethod != null) {
      commandLink.setAction(actionMethod);
    }
    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();
View Full Code Here

  }

  sRecordsPerPageMsg = msgBroker.retrieveMessage(sKeyPfx + "resultsPerPage");

  // create grid to separate navigoation panel from records per page panel
  HtmlPanelGrid panelGrid = new HtmlPanelGrid();
  masterPanelGroup.getChildren().add(panelGrid);
  panelGrid.setBorder(0);
  panelGrid.setColumns(2);
  panelGrid.setWidth("100%");
  panelGrid.setColumnClasses("nav,count");

  // create navigation panel
  HtmlPanelGroup navigationPanelGroup = new HtmlPanelGroup();
  panelGrid.getChildren().add(navigationPanelGroup);

  outText = makeResultText(facesContext, sMsg);
  navigationPanelGroup.getChildren().add(outText);

  int linkCount = 0;

  // add page navigation links
  if (nTotalPageCount > 1) {

    // first and previous pages
    if (cursor.getHasPreviousPage()) {
      if (nStartPage != 1) {
        sMsg = msgBroker.retrieveMessage(sKeyPfx + "first");
        cmdLink = makePageLink(facesContext, 1, sMsg, isBottom, ++linkCount);
        navigationPanelGroup.getChildren().add(cmdLink);
      }
      nPage = cursor.getPreviousPage();
      sMsg = msgBroker.retrieveMessage(sKeyPfx + "previous");
      cmdLink = makePageLink(facesContext, nPage, sMsg, isBottom, ++linkCount);
      navigationPanelGroup.getChildren().add(cmdLink);
    }

    // pages
    for (int i = nStartPage; i <= nEndPage; i++) {
      cmdLink = makePageLink(facesContext, i, "" + i, isBottom, ++linkCount);
      navigationPanelGroup.getChildren().add(cmdLink);
    }

    // next and last pages
    if (cursor.getHasNextPage()) {
      nPage = cursor.getNextPage();
      sMsg = msgBroker.retrieveMessage(sKeyPfx + "next");
      cmdLink = makePageLink(facesContext, nPage, sMsg, isBottom, ++linkCount);
      navigationPanelGroup.getChildren().add(cmdLink);
      if (nEndPage != nTotalPageCount) {
        sMsg = msgBroker.retrieveMessage(sKeyPfx + "last");
        cmdLink = makePageLink(facesContext, nTotalPageCount, sMsg, isBottom, ++linkCount);
        navigationPanelGroup.getChildren().add(cmdLink);
      }
    }
  }

  // create records per page panel
  if (!isBottom && getChangeListenerExpression().length()>0) {
    HtmlPanelGroup resultsPerPagePanelGroup = new HtmlPanelGroup();
    panelGrid.getChildren().add(resultsPerPagePanelGroup);

    // listbox id
    String listBoxId = "recsPerPage";
   
    // Display label
View Full Code Here

        String captionClass;
        String captionStyle;

        if (component instanceof HtmlPanelGrid)
        {
            HtmlPanelGrid panelGrid = (HtmlPanelGrid) component;
            captionClass = panelGrid.getCaptionClass();
            captionStyle = panelGrid.getCaptionStyle();
        }
        else if (component instanceof HtmlDataTable)
        {
            HtmlDataTable dataTable = (HtmlDataTable) component;
            captionClass = dataTable.getCaptionClass();
View Full Code Here

        String captionClass;
        String captionStyle;

        if (component instanceof HtmlPanelGrid) {
            HtmlPanelGrid panelGrid = (HtmlPanelGrid) component;
            captionClass = panelGrid.getCaptionClass();
            captionStyle = panelGrid.getCaptionStyle();
        } else if (component instanceof HtmlDataTable) {
            HtmlDataTable dataTable = (HtmlDataTable) component;
            captionClass = dataTable.getCaptionClass();
            captionStyle = dataTable.getCaptionStyle();
        } else {
View Full Code Here

TOP

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

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.