3 Replies Latest reply on Jul 2, 2009 4:17 AM by hrbaer

    attribute

      Hi,

      I'm having a problem with the rendered attribute.

      I'm triing to hide a part of my site until the user gets "activ" (f.ex. use a link on my site).

      So this is what I'm already implemented:

      <rich:dataTable cellpadding="0" cellspacing="0" width="70%" border="0" var="record" value="#{mb.liste}">
       <rich:column width="33%">
       <f:facet name="header"><h:outputText value="Name" /></f:facet>
       <h:commandLink actionListener="#{mb.showDetails}" value="#{record.name}">
       <f:param name="id" value="#{record.id}" />
       </h:commandLink>
       </rich:column>
      </rich:dataTable>
      
      (....)
      
      <rich:tabPanel width="70%" id="detail" rendered="#{not empty mb.selected}">
       <rich:tab label="Detail">
       <h:outputText value="That ever" />
       </rich:tab>
      </rich:tabPanel>
      


      When I first load the page the detail-area don't get displayed. But when I click the Link in the table nothin happens (of course i'm setting the selected-attribute in the action method of my managed bean!)

      Some ideas?

        • 1. Re: attribute
          liuliu


          1. if your mb is session scope, it should work, but it is not ajax.

          2, use ajax, i think u need use a4j:commandlink, use reRender="someid" attribute, then place your tabpanel in a <a4j:outputpanel id="someid" >

          hope this can help you

          • 2. Re: attribute

             

            "liuliu" wrote:

            hope this can help you


            thank you...at least I'm a little bit more "clever" than before!

            "liuliu" wrote:

            1. if your mb is session scope, it should work, but it is not ajax.


            it is, but it still don't work. So I had the same anticipation as you did.
            But if I have a "work around" with the ajax-request it is fine for me...

            "liuliu" wrote:

            2, use ajax, i think u need use a4j:commandlink, use reRender="someid" attribute, then place your tabpanel in a <a4j:outputpanel id="someid" >


            I changed to an ajax-function. But this doesn't solve the problem.
            This is the new code:
            <rich:dataTable cellpadding="0" cellspacing="0" width="70%" border="0" var="record" value="#{mb.liste}">
             <rich:column width="33%">
             <f:facet name="header"><h:outputText value="Name" /></f:facet>
             <a4j:commandLink actionListener="#{mb.showDetails}" value="#{record.name}" reRender="details">
             <f:param name="id" value="#{record.id}" />
             </a4j:commandLink>
             </rich:column>
            </rich:dataTable>
            
            (....)
            
            <a4j:outputPanel id="details" rendered="" rendered="#{not empty mb.selected}">
            <rich:tabPanel width="70%" id="detail">
             <rich:tab label="Detail">
             <h:outputText value="That ever" />
             </rich:tab>
            </rich:tabPanel>
            </a4j:outputPanel>
            


            When I use the a4j:link I resolve my method in the managed bean but the detail area don't get displayed :(

            • 3. Re: attribute

              Beside my technical comment I just wanted to say, that an EDIT-function in this forum would be really helpful.
              The threads won't become that big and it's easier to read...

              So, but know the technical part:
              I solved the problem - just had a mistake in writing one property!

              So thanks for the support!