2 Replies Latest reply on Jan 18, 2009 1:19 PM by Manjunatha K

    Passing a list from a form to a dialog

    Manjunatha K Newbie
      I am using Seam 2.1 / JBoss 4.3.2.GA / EJB3 environment to develop a dialog which reads up the list of users from a users database table, displays in a table. User can select users from this list.

      Idea is a calling program can call this dialog and pick the list selected by the user. This is made into a dialog which can be called in different programs when ever a list of user selection needs to be done. The dialog works independently with respect to display, selection of users. Now I am trying to make a calling program use this dialog to get a list of selected users.  The list of selected users are made into a List.

      The requirement is that the calling program would provide the list to the dialog, dialog will fill this with the selected users so that when the dialog is closed, the calling program has the list of selected users. I have the dialog as a scopetype of conversation so that it can participate in long running conversations..
      I am trying to create the List in the calling program and pass it on to the dialog. I have not been successful.
      I have tried  @In(create=true) to include the dialog as a component. The dialog was not operational when I used this. Looked like it is not able to access / execute the method in the dialog bean though the form comes up as there is no action when I click on the button which calls a method in the bean.
        • 1. Re: Passing a list from a form to a dialog
          nimo stephan Master

          hello,


          you have to use @Factory,
          if you want the list immediately available when the user needs it at startup.

          • 2. Re: Passing a list from a form to a dialog
            Manjunatha K Newbie
            Hi Nimo,

            Thanks for the reply.

            As I seen in the sample and understand, @Factory has been used within the bean where the list is being defined. In my case I need to send a list from the calling program to the dialog which is an independent entity with its own bean / xhtml files.

            I would like to know what are the changes I need to do to the dialog and the calling program so that the list can be passed on to the dialog when it needs the list to populate.

            I have tried to use @In(create=true) in the calling program to define the dialog as well as define the list. In dialog I have tried to use the list without creating it. I am using richfaces in the dialog to show the list of items. The result is I get the form up, but there is no activity on the form like no action is there when I click a button on the dialog to populate the list.

            However the same dialog works when I use the dialog as a call from a link or I include the source in another xhtml file.

            Also the dialog is being implemented as to work with long running conversations.

            Please do let me know in case you need more info. from me to provide any suggestions.

            Thanks,
            With warm regards,
            Manju