PanelGrid

I have a panelgrid inside a databale, which generates a table with 1 row and 2 columns. The first column may have an image in it, and the second columne will have text in it. The image in the first column may not always be there, and when it is no, the panelGrid does not generate an empty <td></td> for the firs column, so when I display my list of items, the ones that have the image line up fine, but the items that don't have the image in the first column, are now not lined up with the text for the ones with images. If I don't have an image to put in the first column, how can I get it to generate an empty column (<td>,/td>)?
Thanks

Just put a panelGroup around the image.

Similar Messages

  • PanelGrid with binding attribute not rendering when event on page fires

    I am having a similar issue with my components not being rendered from a dynamic binding attribute as described by this post:http://forum.java.sun.com/thread.jspa?threadID=671672 but for different reason. I have combed the forum and other sources for a week now, tried numerous variations of this based on suggestions I've read for rendering dynamic components and am unable to find the problem. I would appreciate guidance as I don't know what else to do and I imagine there is something basic about the JSF flow layout or component classes I am not doing correctly.
    From a high level, I have a page with two panel groups. The first contains a list of command links (like a menu) that have an actionlistener that populates a list of QueryVariable objects called filterCriteria in the backing bean based on the selection made and then calls a function to update components in the second panel. The second panelGroup contains a panelGrid with a binding attribute that constructs a dynamic set of input fields based on the content of the filterCriteria list. When I first naviagate to this page from another page, the fields are rendered properly. However, if I then select a commandLink from the menu, the panelGrid disappears and is not rendered.
    I've stepped through the code in a debugger and my actionlistener is called when I select a command link. However, the binding attribute method is not called at this time, so I added a direct call to it from the action listener. I know the actionlistener is working because I've verified it in the debugger and if I navigate away and come back to the page, then the binding method is called and the new selection is reflected in a rendered panelGrid. Why is it not rendering though when I first select the commandLink and the page is updated. Also, fyi, there is an action method for the commandlinks but it returns null;
    FWIW, I'm using MyFaces and Facelets in my application.
    Below is my code. This is inside a managed session bean:
    JSF Snippet:
    <h:panelGrid id="inputVarsTable" columns="3" binding="#{query.table}"/>
         public HtmlPanelGrid getTable() {
              if(table == null)
                   table = new HtmlPanelGrid();
              return constructSearchInputTable();               
         public void setTable(HtmlPanelGrid table) {
              this.table = table;
      // Updates table component to reflect filterCriteria
         public HtmlPanelGrid constructSearchInputTable()
              HtmlOutputLabel outLabel;
              HtmlOutputText outText;
              HtmlInputText  inText;
              HtmlMessage message;
              List<UIComponent> children;
              ValueBinding vb;
              FacesContext facesContext = FacesContext.getCurrentInstance();
              UIViewRoot uIViewRoot = facesContext.getViewRoot();
            Application application = facesContext.getApplication();
              children = table.getChildren();
        children.clear();
              try {
                   for (int i = 0; i < getFilterCriteria().size(); i++) {
                        QueryVariable var = getFilterCriteria().get(i);
                        String id = "var" + i;
                        //<h:outputLabel for="#{var.name}" styleClass="label">
                        outLabel = new HtmlOutputLabel();               
                        outLabel.setFor(id);
                        outLabel.setStyleClass("label");
                        //  <h:outputText value="#{var.name}" />
                        outText = new HtmlOutputText();
                        outText.setValue(var.getName());
                        outText.setParent(outLabel);
                        outLabel.getChildren().add(outText);
                        outLabel.setParent(table);
                        children.add(outLabel);
                        //<h:inputText id="#{var.name}" value="#{var.value}" required="true" />
                        inText = new HtmlInputText();
                        inText.setId(id);
                        String bind = "#{query.filterValues['" + var.getName() + "']}";
                        inText.setValueBinding("value", application.createValueBinding(bind));
                        if(var.getDefaultValue() == null)
                             inText.setRequired(true);
                        inText.setParent(table);
                        children.add(inText);
                        //<h:message for="#{var.name}" styleClass="errorText"/>
                        message = new HtmlMessage();
                        message.setFor(id);
                        message.setStyleClass("errorText");
                        message.setParent(table);
                        children.add(message);     
              } catch (Exception e) {
                   log.error(e);
              return table;
      // Command Link Menu ActionListener
         public void structuredQuerySelection(ActionEvent e) {
              queryType = QueryType.StructuredQuery;
              UICommand cmd = (UICommand) e.getSource();
              filterSelection = (String) cmd.getValue();
              Map<String, SearchRequestCtx> queries = pdp.getGenericMetadata().savedQueries;
              SearchRequestCtx ctx = queries.get(filterSelection);
              filterCriteria = new ArrayList<QueryVariable>();
              filterCriteria.addAll(ctx.getVariables());
              constructSearchInputTable();
         // Command Link Menu Action
         public String selectStructuredQuery()
              return null;
         }BTW, this is my first post and I don't really know how that Duke Dollar thing works but I'm happy to offer some to anyone that can solve this issue for me.
    Thanks,
    Ken

    Glad to hear I am not the only one struggling with this type of issue.
    I tried your suggestion but it caused a NoSuchElementException when the page tried to render. Stepping through the code, the init function is always called after my panelGrid is constructed. I even commented out the logic to clear the children and confirmed that in the constructed page, the outputText component that binds to init is the first element on the page - right after the opening body tag. Maybe, JSF doesn't necessarily construct the page in top to bottom order? Also, the exception makes me think that this gets called too late in the lifecycle to work. Were you able to get this to work?
    java.util.NoSuchElementException
         at java.util.AbstractList$Itr.next(AbstractList.java:427)
         at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:515)
         at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:445)
         at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:300)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:110)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Thread.java:595)Ken

  • How to align the components in panelGrid right?

    I have a panelGrid with two column, the left column is a image and the right colum is commandLink.
    <h:panelGrid border="0" columns="2" width="100%" columnClasses="headerColumn1, headerColumn2">
    .headerColumn1 {
    vertical-align: top;
    width: 50;
    .headerColumn2 {
    vertical-align: top;
    width: 100%;
    text-align: right;
    But the output is both column width are equal and the text in right column is align left. Can anyone points out what is the problem here?

    Check if the generated HTML and CSS outputs are correct.

  • Problem with rerendering h:panelGrid with rendered attribute

    Hi,
    I am new to jsf and trying to learn its features as I find it easy and fast for development purpose.I have been developing with jsf for past few weeks and got myself stuck with a problem, tired of which I had to take the forum's help :). My problem is that I need to show/hide h:panelGrid using any of the options below:
    I tried putting the grid in the div and show/hide that div using javascript..works fine but the problem with this is, even when the div is hidden the components (h:inputText ) within the grid are submitted with the form, which should not be the case since its hidden (as with normal jsps).
    I worked around with rendered attribute of the grid, and show/hide this grid using the backing bean method which is actually a valueChangeListener of h:selectOneMenu and set the boolean for the rendered to true/false as required, the grid is hide/shown correctly, but this isn't giving me any solution because when I submit the form with this grid shown on the view, its components values are still not submitted :( I dont know whats the reason behind this or what clue am I missing here. I dont know why when the grid is shown correclty, its components values are not submitted.. hence not validated too..
    Any help will be highly appreciable.
    Regards
    srehman

    >
    gimbal2 wrote:
    No, in "normal jsps" you'll get the same thing - even though you
    visibly hide a component, it is still there and thus will still be part
    of a form submit. If you don't want form fields to submit, you'll have
    to make sure they are physically not there, or the fields are disabled.Well thanks alot for correcting me on this mate.
    Don't know either, it should work if you did everything correctly. Are
    you sure the databinding (to a JSF backing bean field) of the grid is
    correct? When you create a similar setup but without any of the
    show/hide logic, does it work then?I guess I have done it correctly but let me tell you, I have no direct binding to the grid itself, instead I have h:inputText fields in the grid that are bound to the backing bean's properties, which I need to submit and validate too. e.g{color:#800000}<h:panelGrid id="myPanel" columns="3" rendered="Bean.renderStatus">
    <h:outputText value="variable"/>
    <h:inputText id="v" value="Bean.property" required="true">
    <a4j:support ......... />
    </h:inputText>
    </h:panelGrid>{color}
    {color:#800000}<rich:message for="v"/>{color}
    Here I am able to hide and show the grid but I am unable to submit the field in any case whether its hidden or shown :( At first the grid is hidden and then on the valueChangeListener of h:selectOneMenu rendered value is set to either true or false.( renderStatus is set in the value change listener ).
    And yeah without this logic of hide/show its working fine with me. Any guess or idea what am I doing wrong here.
    Thanks for your time by the way.
    Regards,
    Shoaib

  • H:panelGrid and css problem?

    Hi,
    I have following piece of code:
    <h:panelGrid columns="3" columnClasses="columnHeader,oddRow,evenRow" rowClasses="oddRow, evenRow" styleClass="tableSettings">
         <h:outputLabel for="accountName">
              <h:outputText value="Account Name"/>
         </h:outputLabel>
         <h:inputText id="accountName" value="#{Edit.accountName}" required="true"/>
         <h:message for="accountName" styleClass="errorText"/>
         <h:outputLabel for="accountDescription">
             <h:outputText value="Account Description"/>
         </h:outputLabel>
         <h:inputText id="accountDescription" value="#{Edit.accountDescription}" required="true"/>
         <h:message  for="accountDescription"  styleClass="errorText"/>
         <h:outputLabel  for="accountTypeName">
             <h:outputText value="Account Type Name"/>
         </h:outputLabel>
         <h:inputText id="accountTypeName" value="#{Edit.accountTypeName}" required="true"/>
         <h:message for="accountTypeName" styleClass="errorText"/>
    </h:panelGrid>
    <br/>
    <h:commandButton id="clearAccount" action="clearAccount" value="Clear" actionListener="#{Edit.clear}"/> <!--  -->
    <h:commandButton id="sendAccountInformation" action="#{Edit.sendMessage}" value="Send"/>
    <br/>
    <h:commandLink id="goToAllAccounts" action="goToAllAccounts" value="All Accounts" />In my css file I have .classHeader, .oddRow, .evenRow and a and a:hover classes:
    .tableSettings {
         border: solid #000000 1px;
         width: 100%;
    .columnHeader {
        text-align: center;
        nowrap: true;
        background-color:"#000000";
        color:"#FFFFFF";
    .oddRow {
        background-color: "#E0E0E0";
    .evenRow {
        background-color: white;
    .errorMessage {
         color : #FF0000;
         font-weight: bolder;
    a {
         text-decoration: none;
         color: #337799;
         font-weight: bolder;
    a:hover {
         text-decoration:underline;
         color: #abcdef; /*FF5555*/
         font-weight: bolder;
    }And problem I have is that link at the bottom is rendered correctly (and when it is hovered it changes color), but panelGrid is missing almost all styles, only border of the table is present. I've already tried removing columnClasses and rowClasses...
    Does anybody know where can be a problem?
    Regards,
    morhen

    Found the problem. At the beginning of my *.jsp document I had:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">when I deleted
    "http://www.w3.org/TR/html4/loose.dtd"styles appeared, but I don't know why... interesting...

  • ActionListener not firing within panelGrid (which is within a dataTable)

    I have a page with several forms on it:
    <h:form>
    ... commandLinks here are working
    </h:form>
    <h:form>
    <h:panelGrid>
    ...the actionListener here is firing
    </h:panelGrid>
    </h:form>
    <h:form>
    ... commandLinks here are working
    </h:form>
    <h:dataTable value="#{collection}" var="item">
    <h:column>
    <h:form>
    <h:panelGrid>
    ...actionListeners here ARE NOT FIRING!
    </h:panelGrid>
    </h:form>
    </h:column>
    </h:dataTable>
    I've tried many things to get this to work. I've checked spelling at least 10 times. I've put the whole page in a single form. Nothing seems to work. The bean associated with the actionListener is not even being instantiated unless I include a value binding expression in the form somewhere, but even then the listener is still not fired.
    So, please tell me if this is a known bug, or if it should work. I'm using JSF 1.1_1.
    All the data and form fields get displayed correctly, just the actionListeners are not firing. I've tried both methods of triggering an actionListener. Neither work.
    Why doesn't anyone from Sun post here anymore?????

    Could you please copy/paste the whole jsp page?I had to abandon the previous page structure due to time constraints. But, now I am having the same problem on another page, pasted below. In this case, the contactInfoForm.populate actionListeners are not firing:
    <?xml version="1.0" ?>
    <jsp:root version="2.0"
      xmlns:jsp="http://java.sun.com/JSP/Page"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:c="http://java.sun.com/jstl/core"
      xmlns:x="http://java.sun.com/jstl/xml"
      xmlns:fmt="http://java.sun.com/jstl/fmt"
      xmlns:t="http://jakarta.apache.org/struts/tags-tiles"
      xmlns:htm="http://jsftutorials.net/htmLib">
      <f:subview id="content">
        <htm:div styleClass="heading">
          <htm:h2>
             <h:outputFormat value="#{msgs[heading]}">
                <f:param value="#{param.firstName}" />
                <f:param value="#{param.lastName}" />
             </h:outputFormat>
          </htm:h2>
        </htm:div>
        <htm:div styleClass="contentContainer">
        <h:messages/>
        <h:form>
          <h:commandLink id="backToPersons" styleClass="commandLink1" action="section.persons">
             <h:outputText value="#{msgs['persons.common.command.backToPersons']}"/>
          </h:commandLink>
        </h:form>
        <h:form style="padding-top: 10px">
          <h:commandLink id="newContactInfo" styleClass="commandLink1" action="/persons/contactInfo/newContactInfo">
             <h:outputText value="#{msgs['persons.person.contactInfo.list.command.new']}"/>
             <f:param name="personId" value="#{param.personId}"/>
             <f:param name="firstName" value="#{param.firstName}"/>
             <f:param name="lastName" value="#{param.lastName}"/>
          </h:commandLink>
        </h:form>
        <h:form>
           <h:dataTable value="#{contactInfoForm.contactInfoList}" var="contactInfo" cellpadding="5" cellspacing="0" styleClass="dataTable" headerClass="dataTableHeader" rendered="#{contactInfoForm.hasContactInfo}">
              <h:column>
                <f:facet name="header">
                   <h:outputText value="#{msgs['persons.person.contactInfo.list.header.contactInfoId']}"/>
                </f:facet>
                <htm:center><h:outputText value="#{contactInfo.contactInfoId}" styleClass="dataTableContent"/></htm:center>
              </h:column>
              <h:column>
                <f:facet name="header">
                   <h:outputText value="#{msgs['persons.person.contactInfo.list.header.description']}"/>
                </f:facet>
                <h:outputText value="#{contactInfo.description}" styleClass="dataTableContent"/>
              </h:column>
              <h:column>
                <f:facet name="header"></f:facet>
                <htm:center>
                   <h:commandLink styleClass="commandLink1" action="/persons/contactInfo/viewContactInfo" actionListener="#{contactInfoForm.populate}">
                      <f:param name="firstName" value="#{param.firstName}"/>
                      <f:param name="lastName" value="#{param.lastName}"/>
                      <f:param name="contactInfoId" value="#{contactInfo.contactInfoId}"/>
                      <h:outputText value="#{msgs['command.view']}"/>
                   </h:commandLink>
                </htm:center>
              </h:column>
              <h:column>
                <f:facet name="header"></f:facet>
                <htm:center>
                   <h:commandLink styleClass="commandLink1" action="/persons/contactInfo/editContactInfo" actionListener="#{contactInfoForm.populate}">
                      <f:param name="firstName" value="#{param.firstName}"/>
                      <f:param name="lastName" value="#{param.lastName}"/>
                      <f:param name="contactInfoId" value="#{contactInfo.contactInfoId}"/>
                      <h:outputText value="#{msgs['command.edit']}"/>
                   </h:commandLink>
                </htm:center>
              </h:column>
           </h:dataTable>
           <h:outputText value="#{msgs['persons.person.contactInfo.list.noRecords']}" styleClass="copy2" rendered="#{not contactInfoForm.hasContactInfo}"/>
        </h:form>
        </htm:div>
      </f:subview>
    </jsp:root>

  • PanelGrid binding error when there is tabs

    Hi everybody
    I have a problem with binding a panellayout to a backbean method when there are tabs on the page.
    This is my panellayout
    <h:panelGrid binding="#{TestFolder$TestTable.grid}" id="gridPanel1" />The method return HtmlPanelGrid which contains dynamic hiddenfields . Hiddenfields values taken from the database according to given parameter. It work nice and shows hidden field values as well, when i view page source.
    But when the selected tab change exception thrown saying
    javax.el.PropertyNotWritableException: The class 'com.epic.tdms.jsf.TestFolder.TestTable' does not have a writable property 'grid'.
    StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service() for servlet Faces Servlet threw exception
    javax.el.PropertyNotWritableException: The class 'com.epic.tdms.jsf.TestFolder.TestTable' does not have a writable property 'grid'.
    This is my full jsp code
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:ui="http://www.sun.com/web/ui">
        <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
        <f:view>
            <ui:page binding="#{TestFolder$TestTable.page1}" id="page1">
                <ui:html binding="#{TestFolder$TestTable.html1}" id="html1">
                    <f:loadBundle basename="com.epic.tdms.jsf.Bundle" var="messages1"/>
                    <ui:head binding="#{TestFolder$TestTable.head1}" id="head1"/>
                    <ui:body binding="#{TestFolder$TestTable.body1}" id="body1" style="-rave-layout: grid">
                        <ui:form binding="#{TestFolder$TestTable.form1}" id="form1" virtualFormsConfig="virtualForm1 | |">
                            <ui:tabSet id="tabSet1" selected="tab2" style="left: 240px; top: 288px; position: absolute">
                                <ui:tab id="tab1" text="Tab 1">
                                    <ui:panelLayout id="layoutPanel1" style="height: 223px; position: relative; width: 100%; -rave-layout: grid">
                                    </ui:panelLayout>
                                </ui:tab>
                                <ui:tab id="tab2" text="Tab 2">
                                    <ui:panelLayout id="layoutPanel2" style="height: 223px; position: relative; width: 100%; -rave-layout: grid">
                                    </ui:panelLayout>
                                </ui:tab>
                            </ui:tabSet>
                        </ui:form>
                    </ui:body>
                    <h:panelGrid binding="#{TestFolder$TestTable.grid}" id="gridPanel1" style="position: absolute; left: 288px; top: 96px" />
                </ui:html>
            </ui:page>
        </f:view>
    </jsp:root>This is the method which return grid
    public HtmlPanelGrid getGrid() throws Exception
            HtmlPanelGrid grid = new HtmlPanelGrid();
           List<UIComponent> children = grid.getChildren();
            HtmlDataTable table = new HtmlDataTable();
            table.setId("table_userRoles");
            table.setValueExpression("value",createValueExpression("#{TestFolder$TestTable.childHiddenFields}", List.class));
            table.setVar("hiddenFields");
            HiddenField hidden = new HiddenField();
            hidden.setValueExpression("value", createValueExpression("#{hiddenFields.value}", String.class));
            children.add(table);
            HtmlColumn nameColumn = new HtmlColumn();
            nameColumn.getChildren().add(hidden);
            table.getChildren().add(nameColumn);
            grid.getChildren().add(table);
            return grid;
        }Please help me to solve this out.
    Thanks in advance

    BalusC Thank you very much for answering, and your answer is very helpful. It worked for my another project. Actually there I have forget to set the setter.
    And I have solved the problem, I put in prerender method and it works now.

  • Problems with binding PanelGrid

    Hi,
    Actually i am trying to create the components dynamically. So i am binding the HtmlPanelGrid to the backing bean.
    Code
    <h:panelGrid binding="#{bean.panelGrid}"/>
    <h:commandLink value="Add" action="#{bean.addGroup}"/>
    And when the user clicks on the add link , i need to add the same panelGroup to the exisiting panelGrid. My page is in request scope.
    When i try to add a new panelGroup , it is able to add but not rendering in the screen.
    Can some one suggest me , how to do that.

    I am using Jsf 1.2 version..
    I tried with setting the bean scope as session also, its not showing the newly added panelGroups.
    public void addContactsGroup(ActionEvent action) {
              logger.info("Adding another contacts group to the grid");     
              //HtmlPanelGrid contactPanelGrid = (HtmlPanelGrid) TAPJSFUtil.getSessionAttribute("contactsGrid");
              logger.info("Length of panelGrid before adding the panel == " + contactsGrid.getChildCount());
              contactsGrid.getChildren().add(getContactPanelGroup());          
              /*TAPJSFUtil.removeSessionAttribute("contactsGrid");
              TAPJSFUtil.setSessionAttribute("contactsGrid", contactPanelGrid);*/     
              logger.info("Length of panelGrid== " + contactsGrid.getChildCount());
              FacesContext.getCurrentInstance().renderResponse();
    private HtmlPanelGroup getContactPanelGroup(){
              logger.info("Creating new contact panelgroup");
              // creates a new Panel group
              HtmlPanelGroup group = new HtmlPanelGroup();
              HtmlOutputText type=new HtmlOutputText();
              type.setValue("Type");
              HtmlSelectOneMenu contactType=new HtmlSelectOneMenu();
              //creates the Select items 3
              UISelectItems items=new UISelectItems();
              items.setValue(getContactTypeList());          
              contactType.getChildren().add(items);
              HtmlOutputText name=new HtmlOutputText();
              name.setValue("Name");
              HtmlInputText nameInput=new HtmlInputText();     
              HtmlOutputText phone=new HtmlOutputText();
              phone.setValue("Phone");     
    group.getChildren().add(type);
              group.getChildren().add(contactType);
              group.getChildren().add(name);
              group.getChildren().add(nameInput);
              group.getChildren().add(phone);
              group.getChildren().add(phoneInput);
              group.getChildren().add(comments);
              group.getChildren().add(commentsInput);
              logger.info("PanelGroup created");
              return group;
         }plz correct me , if i am wrong

  • PanelGrid component binding problem

    I have a panelGrid that is bound to an object in my backing bean. When the page loads the panelGrid is empty. When the user clicks on a button it is suppose to populate the panelGrid. But the panelGrid doesn't render after clicking the button. Here is my code:
    jsp
    <div style="margin-left:30px;">
                 <div>
                     <ice:outputText value="Click 'Run Diagnostics' to begin tests." />
                 </div>
                 <div style="margin-left:20px;padding-bottom:40px;">
                     <ice:commandButton value="Run Diagnostics"
                                         action="#{SystemDiagnostics.runDiagnostics_clicked}"/>
                     <ice:outputText value="#{SystemDiagnostics.resultsText}"/>
                 </div>
                 <div>
                     <ice:outputText style="font-decoration:underline;"
                                     value="Diagnostics" />
                 </div>
                 <div style="margin-left:20px;">
                     <ice:panelGrid binding="#{SystemDiagnostics.diagnosticsPanelGrid}" >
                          <!--Dynamic values go here -->
                     </ice:panelGrid>
                 </div>
             </div> bean
    public void runDiagnostics_clicked() {
             PdlgCommandCollectionResult result = Pdlg.instanceOf().runDiagnostics();
                 if (result.isSuccessful()) {
                     HtmlPanelGrid grid = new HtmlPanelGrid();
                     grid.setColumns(2);
                     HtmlOutputText output = new HtmlOutputText();
                     output.setValue("Boot Disk");
                     grid.getChildren().add(output);
                     output = new HtmlOutputText();
                     output.setValue("Success");
                     grid.getChildren().add(output);
                     setDiagnosticsPanelGrid(grid);
         public HtmlPanelGrid getDiagnosticsPanelGrid() {
             return m_diagnosticsPanelGrid;
         public void setDiagnosticsPanelGrid(HtmlPanelGrid value) {
             m_diagnosticsPanelGrid = value;
         }Does anyone know why this is not rendering?
    Thanks,
    David

    Well, I discovered how to resolve this.
    The component that you bind to can not be recreated in the backing bean. Only the components within the bound component can be recreated. So what i did was added a panelGroup and binded that to my backing bean and then was able to recreate the panelGrid that was a child of the panelGroup.

  • H:panelGrid width or style attribute not rendering

    Hi
    I am currently experiencing a weird problem. I use a panel grid to align inputs in a form.
    when I try to set the width of the panel grid using the width or style attribute, the HTML equivalent is not rendered when displaying the web page.
    Here is what I try to do:
    <h:panelGrid columns="2" styleClass="patient-problem-form" style="width: 300px;">
    No style attribute is rendered on the table tag...
    Anyone knows what could case this issue?
    I am using
    facelets - 1.1.14
    seam - 2.0.1.CR1
    richfaces - 3.1.3.GA
    just updated glassfish 2-b58c with JSF 1.07 but did not make any difference
    Thanks.

    This will occur if you're using JSF impl newer than 1.2_05, but are using JSF api of 1.2_05 or older. Your classpath may be a mess with duplicated JAR's of different versions. Clean up your classpath. It may be good to know that Glassfish ships with javaee.jar which also contains JSF API. You need to upgrade it as well, you can get a Glassfish updater tool or read the instruactions at Mojarra homepage.

  • Jsf 1.2_08 gives me blank page when i use h:panelGrid with binding attribut

    I am using jsf 1.2_08 (Mojarra 1.2_08-b06-FCS) + jstl-1.2.jar + Apache Tomcat/6.0.6 + jdk1.5.0_08 on linux suse server. when i load a jsp page with a h:panelGrid, i get a blank page
    my panelGrid is as follows
    <h:panelGrid id="financialProjections" binding="#{veusSituationMonitorDisplayBean.financialProjections}" border="0" cellpadding="0" cellspacing="0" columnClasses="nspLabel w200,ra bl,ra bl,ra bl,ra bl,ra bld,ra bl,ra bl" columns="8" width="100%"/>
    when i remove the binding attribute, rest of the page displays fine.
    Thanks in Advance
    my web.xml is
    <?xml version="1.0"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd">
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
    </context-param>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>AJAXServlet</servlet-name>
    <servlet-class>net.em.servlets.AJAXServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>InitialLizeApplicationbeansServlet</servlet-name>
    <servlet-class>net.em.servlets.InitialLizeApplicationBeanServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>AJAXServlet</servlet-name>
    <url-pattern>/abc.ajax</url-pattern>
    </servlet-mapping>
    <filter>
    <filter-name>ExtensionsFilter</filter-name>
    <filter-class>
    net.em.emrp.filters.EMExtensionsFilter
    </filter-class>
    <init-param>
    <param-name>uploadMaxFileSize</param-name>
    <param-value>10m</param-value>
    </init-param>
    <init-param>
    <param-name>uploadThresholdSize</param-name>
    <param-value>100k</param-value>
    </init-param>
    </filter>
    <filter>
    <filter-name>ResponseOverrideFilter</filter-name>
    <filter-class>org.displaytag.filter.ResponseOverrideFilter</filter-class>
    </filter>
    <session-config>
    <session-timeout>
    720 <!-- minutes -->
    </session-timeout>
    </session-config>
    <filter-mapping>
    <filter-name>ExtensionsFilter</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>
    <filter-mapping>
    <filter-name>ResponseOverrideFilter</filter-name>
    <url-pattern>*.do</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>ResponseOverrideFilter</filter-name>
    <url-pattern>*.jsp</url-pattern>
    </filter-mapping>
    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    <error-page>
    <error-code>404</error-code>
    <location>/error404.html</location>
    </error-page>
    <error-page>
    <error-code>500</error-code>
    <location>/error500.html</location>
    </error-page>
    <taglib>
    <taglib-uri>http://ajaxtags.org/tags/ajax</taglib-uri>
    <taglib-location>/WEB-INF/ajaxtags.tld</taglib-location>
    </taglib>
    </web-app>

    BalusC wrote:
    I rather mean that you shouldn't instantiate the HtmlPanelGrid in the bean yourself, but just use the instance which is set through the setter during the restore_view phase.BalusC, why do you recommend this? The spec allows for the bean to create the component:
    *JSF 1.2, section 3.1.5* says:
    When a component instance is first created (typically by virtue of being referenced by a UIComponentELTag in a JSP page), the JSF implementation will retrieve the ValueExpression for the name binding, and call getValue() on it. If this call returns a non-null UIComponent value (because the JavaBean programmatically instantiated and configured a component already), that instance will be added to the component tree that is being created. If the call returns null, a new component instance will be created, added to the component tree, and setValue() will be called on the ValueBinding (which will cause the property on the JavaBean to be set to the newly created component instance).

  • Adding AJAX support for dynamically created panelGrid components

    Hi everyone!
    I would like to ask help from anyone who may have encountered similar problem before...
    I have a panelGrid whose component is dynamically created by the backing bean. Here is my JSF code:
    <h:panelGrid styleClass="panelGrid"
              rowClasses="tsPanelGridRowClass" columns="8" cellpadding="0"
              cellspacing="2" bgcolor="transparent" style="margin-left: 10px"
              id="revCenterItemPanelGrid"
              binding="#{pc_Touchscreen_pull_select_item.revCenterItemPanelGrid}">
    </h:panelGrid>And here is the code for backing bean that adds content inside the panelGrid:
    HtmlOutputText index = (HtmlOutputText) app.createComponent(HtmlOutputText.COMPONENT_TYPE);
    index.setId("1");
    index.setValue(String.valueOf(1));
    index.setStyle("datagridtext");
    revCenterItemPanelGrid.getChildren().add(index);On click of a button...
    <a4j:commandButton value="Update"
              styleClass="commandExButtonPou2" id="button1" reRender="revCenterItemPanelGrid"
              actionListener="#{pc_Touchscreen_pull_select_item.doSortActionListener2}">
              <f:attribute name="order" value="2"></f:attribute>
              <f:attribute name="toggleState" value="off"></f:attribute>
    </a4j:commandButton>the backing bean is supposed to update the value of the outputText
    doSortActionListener2() {
    HtmlOutputText index = (HtmlOutputText) app.createComponent(HtmlOutputText.COMPONENT_TYPE);
    index.setId("2");
    index.setValue(String.valueOf(2));
    index.setStyle("datagridtext");
    revCenterItemPanelGrid.getChildren().add(index);
    }However, update doesn't seem to work. I have been successful in adding ajax support to a panelGrid that is not dynamically created but not for this one.
    Has anyone encountered this error before? Any ideas?
    Thanks in advance!

    Hi everyone!
    I would like to ask help from anyone who may have encountered similar problem before...
    I have a panelGrid whose component is dynamically created by the backing bean. Here is my JSF code:
    <h:panelGrid styleClass="panelGrid"
              rowClasses="tsPanelGridRowClass" columns="8" cellpadding="0"
              cellspacing="2" bgcolor="transparent" style="margin-left: 10px"
              id="revCenterItemPanelGrid"
              binding="#{pc_Touchscreen_pull_select_item.revCenterItemPanelGrid}">
    </h:panelGrid>And here is the code for backing bean that adds content inside the panelGrid:
    HtmlOutputText index = (HtmlOutputText) app.createComponent(HtmlOutputText.COMPONENT_TYPE);
    index.setId("1");
    index.setValue(String.valueOf(1));
    index.setStyle("datagridtext");
    revCenterItemPanelGrid.getChildren().add(index);On click of a button...
    <a4j:commandButton value="Update"
              styleClass="commandExButtonPou2" id="button1" reRender="revCenterItemPanelGrid"
              actionListener="#{pc_Touchscreen_pull_select_item.doSortActionListener2}">
              <f:attribute name="order" value="2"></f:attribute>
              <f:attribute name="toggleState" value="off"></f:attribute>
    </a4j:commandButton>the backing bean is supposed to update the value of the outputText
    doSortActionListener2() {
    HtmlOutputText index = (HtmlOutputText) app.createComponent(HtmlOutputText.COMPONENT_TYPE);
    index.setId("2");
    index.setValue(String.valueOf(2));
    index.setStyle("datagridtext");
    revCenterItemPanelGrid.getChildren().add(index);
    }However, update doesn't seem to work. I have been successful in adding ajax support to a panelGrid that is not dynamically created but not for this one.
    Has anyone encountered this error before? Any ideas?
    Thanks in advance!

  • Using f:facet name="header" in h:panelGrid

    I'm battling with it for a week now...
    I'm trying to create a table with 3 columns and to have header for each column.
    This, don't display headers at all :
            <h:panelGrid styleClass="Context" columns="3">
                <h:panelGroup>
                    <f:facet name="header">
                        <h:outputText value="#{prompts.Label_PROPERTYTYPE_ID}"/>
                    </f:facet>
                    <h:outputText value="null"/>
                </h:panelGroup>
                <h:panelGroup>
                    <f:facet name="header">
                        <h:outputText value="#{prompts.Label_PROPERTYTYPE_DESCRIPTION}"/>
                    </f:facet>
                    <h:inputText value="#{PropertyType.typeDescription}" required="true"/>
                </h:panelGroup>
                <h:panelGroup>
                    <f:facet name="header">
                        <h:outputText value=""/>
                    </f:facet>
                    <h:commandButton value="#{prompts.action_CREATE}"  action="#{PropertyType.Create}"/>
                </h:panelGroup>
            </h:panelGrid>While this compress all headers into one <th>
            <h:panelGrid styleClass="Context" columns="3">
                <f:facet name="header">
                    <h:panelGroup>
                        <h:outputText value="#{prompts.Label_PROPERTYTYPE_ID}"/>
                        <h:outputText value="#{prompts.Label_PROPERTYTYPE_DESCRIPTION}"/>
                        <h:outputText value=""/>
                    </h:panelGroup>
                </f:facet>
                <h:outputText value="null"/>
                <h:inputText value="#{PropertyType.typeDescription}" required="true"/>
                <h:commandButton value="#{prompts.action_CREATE}"  action="#{PropertyType.Create}"/>
            </h:panelGrid>Any help ?

    Hello,
    PanelGrid will not render as you want. Please see the documentation as how the rendering will happen for panelGrid.
    http://java.sun.com/javaee/javaserverfaces/1.1_01/docs/tlddocs/h/panelGrid.html
    You can use the following to get the output as you want:
    <h:panelGrid styleClass="Context" columns="3">
    <f:facet name="header">     
    <h:dataTable>
    <h:column id="col1">
    <f:facet name="header">
    <h:outputText value="#{prompts.Label_PROPERTYTYPE_ID}"/>
    </f:facet>
    </h:column>
    <h:column id="col2">
    <f:facet name="header">
    <h:outputText value="# {prompts.Label_PROPERTYTYPE_DESCRIPTION}"/>
    </f:facet>
    </h:column>
    <h:column id="col3">
    <f:facet name="header">
    <h:outputText value=""/>
    </f:facet>
    </h:column>
    </h:dataTable>
    </f:facet>
    <h:outputText value="null"/>
    <h:inputText value="#{PropertyType.typeDescription}" required="true"/>
    <h:commandButton value="#{prompts.action_CREATE}" action="# {PropertyType.Create}"/>
    </h:panelGrid>
    - Kiran

  • Drag and drop between two panelgrids

    Hello,
    I have two panelgrids, both containing information about a person (name, surname etc). It's the same person (but two different objects of course), just that one one side there is old information, and in the other panel more updated info. The idea is select the information we want about the person (for instance the phone from one side, address from the other etc) and I have no clue as to how to do this :( Could be drag and drop or anything else. Please help.
    Thank you,
    Ioana.

    RichFaces has some components supporting drag'n'drop. Give it a look.

  • H:panelGrid and h:dataTable remove boundary

    Hi!
    By default h:panelGrid will have boundary and similarly in h:dataTable after every column there is boundary.
    I don't want the boundaries in both the cases, do I need to create custom renderers or is there any attribute that I can set.
    Thanks,

    Add a CSS class to your stylesheet and apply it to your grid panel, modifying the styleClass attribute. For example
    stylesheet.css
    table.border0
        border: 0px;
    }Page1.jsp
    <h:panelGrid styleClass="border0">
    </h:panelGrid>If this does not suffice (because of conflicting css properties, nested elements etc.) you can post the html output of your page or the affected region.

  • H:panelGrid and td tag attributes

    Hi,
    I am using h:panelGrid for a static table with just 2 columns and a few rows. My UI designer created two styles for alternating rows. I added following to the panelGrid:
    rowClasses="rowbg1, rowbg2".
    The UI designer does not like the fact that those two styles are added to the tr tag instead of td tag in the generated html code. He wants me to add those to the td tag and add a width= attribute to td tag as well. I could not figure out a way to add the styles to the td tag. If I add the styles to panelGroup, it will be added to the span tag in html code. Anybody has any suggestion?
    Thanks!
    yydd

    The columnClasses attribute of <h:panelGrid> will affect the <td> tag, however, you may not be able to get the effect you want using it.
    The simplest approach is to build the table using HTML inline with your JSF view.

Maybe you are looking for

  • Visual Totals and users in multiple roles

    Hello, I have a few questions regarding dimension security and visual totals enabled. The infrastructure:  - multiple roles  - users are members of multipe roles 1) if I have multiple roles and the user is member of multiple roles  - if I set "Visual

  • Is windows worth it for gaming??

    i'm curious to know, for anyone that has installed a windows partition onto their MB or MBP if it would be worth it for cheaper gaming // wider selection of games... i dont really want to install windows too much because i hate it, but if it will let

  • TableView is shifted up under status bar?

    Ok, simple newbie question. I tried searching, but either get results which have nothing to do with the issue, or nothing. So, here goes.... I created new TableViewController, and added a search bar to the top in InterfaceBuilder/XCode 4.2. Now when

  • Changing .dmg file extension doesn't work as expected

    Hi everybody, I wanted to change the file extension of an image of a floppy disk creating using Disk Uitility. The original extension is ".dmg". Changing this extension in the Finder window to ".flp" seems to work --- but only at first sight. Looking

  • FireFox 13 Search Bar not working with TB display

    I have a strange problem.  I have a new 13" MB Air (mid 2012 model) and I have it attached to a Thunderbolt display.  I use FireFox 13 for browsing.  When my MB Air is solo (i.e., not hooked up to my TB display), the search bar in the top right of th