5 Replies Latest reply on Sep 24, 2008 10:15 AM by nimo22

    Scenario

    insect

      I spent 6 hours to solve that but I can't :(
      Simple model Product Category. For example we have to much categories to show them in combo box and also we want to provide search through categories, so we use next page flow
      1. Show Product list for user (I have a search param where user can choose a category of product)
      2. User create new product (enters details)
      3. User selects a category in Data Table (another page for example category List, where user can also manage categories). After select user is redirected back to Product Details where category field is filled with category he just selected.
      4. User enters other details and save product.


      So I have problem with redirects and transfer data between pages.
      1. How to Go back and send selected category as a parameter?
      2. Category select page can be used from multiple places so I don't know the page to redirect after selection (from product list, product details and etc.)?
      3. How to use conversations (i think nested) in my case?


      Thank a lot.


        • 1. Re: Scenario

          If you have too many items of something to be displayed in a combo you may use a suggestion box. That way you only show data according what the user types and on top of that it would allow your form to be in a unique page.
          Nevertheless, remember that default scope is conversation and that you could change it to session if needed.

          • 2. Re: Scenario
            insect

            No I said that one suitable way to select category if other page? here user can add something if it does not esists. I'm interested not in founding altrnative solution, I'm founding solution of secario i described.


            So I repeat:
            I need a way to allow user select something from another page than system will redirect him back to item page where hi can continue editing. Also this Select page can be used from multiple items for example i can set Account for: Customer (from custoemer.html), Supplier (from supplier.html), Employee (employee.html), so Account Select (accountList.html) does not know wich page to go after selection it depends on wich page cause selection.

            • 3. Re: Scenario
              nimo22

              Check the example of booking (look into your Seam-Distribution folder 'examples').


              You can develop


              page 1: to allow user to select something
              and start a conversation in page 2.


              You can transfer the data coming from page 1 via a method-binding-expression with parameters (such as void collectData(String a)...look at the booking example).


              Then you use the s:link-Tag and bind the method


              #{bean.collectData(a)}



              Put the s:link-Tag in page 1.


              It will transfer the parameter a into the new conversation starting at page 2.


              • 4. Re: Scenario
                insect

                Hm...
                1. I nedd to transfer not such simple data as you show, for example list of selected entities.
                2. How about redirecting and then returning back?

                • 5. Re: Scenario
                  nimo22

                  You can transfer what ever you want!


                  The parameters in collectData are any JAVA-Objects.


                  Another alternative is, you can use:


                  @DataModel


                  and


                  @DataModelSelection


                  and outject the datamodelselection in whatever you want.