1 Reply Latest reply on Nov 19, 2008 5:28 PM by hwoarang

    modalPanel with dynamic backBean as parameter

    hwoarang

      Hi there!
      I have a modalPanel that show a r:dataTable. The user should select one record from table and update two fields on parent form.

      My modal's code is in the template.jspx (I'm using facelets).

      It works, but as the modalPanel will be invoked from different pages (different backBeans), I wish to pass the backBean's name to modalPanel and use it to set the fields...



      How can I do that ?

      Here's the code:

      Let's say on 'Page1.jspx':

      <h:inputText id="idPerson" value="#{Bean1.idPerson}" />
      <a4j:commandButton
       value="..."
       reRender="mymodal"
       oncomplete="Richfaces.showModalPanel('mymodal', {backBean: 'Bean1'}); return false;">
      


      Now on 'Page2.jspx':
      <h:inputText id="idPerson" value="#{Bean2.idPerson}" />
      <a4j:commandButton
       value="..."
       reRender="mymodal"
       oncomplete="Richfaces.showModalPanel('mymodal', {backBean: 'Bean2'}); return false;">
      


      Note that when I call the modalPanel I passed two different parameters (the backBean's name).

      My modalPanel's code:

      <r:modalPanel id="mymodal">
       ...
       <a4j:commandLink
       reRender="idPerson"
       oncomplete="Richfaces.hideModalPanel('mymodal');">
       <a4j:actionparam
       name="paramId"
       value="#{item.id}"
       assignTo="#{HowToPutTheParamHere.idPerson}"/>
       </a4j:commandLink>
      </r:modalPanel>
      


      I think the idea was passed: I want to assign some value to the same field, but in different backingBeans, that was passed to modalPanel as parameter.

      Any idea ?

      Thank you in advance!