0 Replies Latest reply on Feb 5, 2010 3:58 AM by Gofio Code

    ajax and dynamic form generation

    Gofio Code Newbie

      Hi all,

       

      I have an application with a table and when I click one element of that table I show its detail in a form (just under the table) using ajax. The problem is that these elements have differents fields, I mean, they have 2 common fields and the rest are diferents, so the form will be quite different also.

       

      Due to the fields are differents I need to create dynamically the form. I have refreshed by ajax the same form successfully, but now, the component tree has to be modified and it is not working...

       

      Here is where the user click to see the details in a new form:

       

      <a4j:commandLink id="cmdView" value="see" action="seeElement" reRender="frmView"> 

        <f:setPropertyActionListener target="#{elementBean.Id}" value="#{item.id}"/>

      </a4j:commandLink>

       

      and here is where I render the new form, that changes the component tree:

       

      <a4j:outputPanel id = "frmView">

        <a4j:outputPanel binding="#{elementBean.bindingForm}"/>

      </a4j:outputPanel>

       

      However the form creation doesn't work when I change from one form to a different one. It looks like the component tree isn't uodated correctly

       

      There is a way to change the components tree through an ajax call?? Any ideas??

       

      Thanks in advance!!