4 Replies Latest reply on Jan 8, 2008 5:58 PM by sergeysmirnov

    rendered seems to be ignored...

    tony.herstell1

       

      <rich:dataTable id="resourceAddedTable" var="eachResource" value="#{bookingResources}" rendered="#{bookingController.hasResources()}">
      


      Once I have one in the list and refresh the page manually then I can see the next ones ok.


      I have this for adding things to the list... which imho should mean that the dataTable is kicked into an update.

      <a4j:commandButton styleClass="general_form_button" id="addResidentTrainer" value="#{messages.resource_resident_trainer}"
       action="#{bookingController.addResource('resource_resident_trainer')}"
       reRender="resourceAddedTable, resourceAdditionAttemptMessages" />
      



      I can remove using
      <a4j:commandButton styleClass="general_form_button"
       action="#{bookingController.removeResource(eachResource)}"
       value="#{messages.general_button_remove}" type="submit" reRender="resourceAddedTable">
      


      but again when it gets donw to the last one it does not fire and update.


      What am I missing...

      I shouldnt even have this: rendered="#{bookingController.hasResources()}">
      but this doesn't work at all:
      rendered="#{not empty bookingResources}"

        • 1. Re: rendered seems to be ignored...
          tony.herstell1

          Its as if the table not existing on the server side means that the page in view does not get updated to actually remove the table.

          And vica versa... in that when the table is created it does not appear on the page until the id is somewhere on the page to hook it to (under).

          Hence by re-freshing the page it forces a re-draw of the complete mode and it appears/dissapears.

          All works perfectly when I have no rendered but I just get left with the column headers with nothing in the columns which does not look good.

          Humm ill try adding div tags with the id to see if that helps.

          If that makes sense.

          • 2. Re: rendered seems to be ignored...
            tony.herstell1

             

            "tony.herstell@gmail.com" wrote:

            Humm ill try adding div tags with the id to see if that helps.


            Nuffin seems to help.. if id's don't match on page and back end for component I don't think it synchs up (i.e. removes if from or adds it to the page).. so if you delete the component at the back end it does not find that id on teh page and remove it from the page.

            • 3. Re: rendered seems to be ignored...
              tony.herstell1

              Ill try adding panels round it.

              • 4. Re: rendered seems to be ignored...

                http://livedemo.exadel.com/richfaces-demo/richfaces/ajaxAttributes.jsf?c=ajaxattributes:


                Most common problem with using reRender is pointing it to the component that has a
                'rendered' attribute. Note, that JSF does not mark the place in the browser DOM where the outcome
                of the component should be placed in case the 'rendered' condition returns false. Therefore,
                after the component becomes rendered during the Ajax request, RichFaces delivers the rendered
                code to the client, but does not update a page, because the place for update is unknown.
                You need to point to one of the parent components that has no 'rendered' attribute. As an
                alternative, you can wrap the component with a4j:outputPanel layout="none".