views:

40

answers:

1

In (JSF2 + jQuery) or in GWT: What would be the best way to realize a multi-page form wizard with explicitly specified form controller "rules" running on the client-side?

The goal is:

  1. form with 3 pages, each containing 'prev'/'next' buttons and finally 1 'submit' button.
  2. all form items have unique ids for addressing/accessing them.
  3. for client-side form control there are 2 kind of control "rules" specified in a central place and stored somehow:

    • active behaviour of 1 item (modifying 1+ other items):

      WHEN form item x is checked/changed/text=="MyText"
      THEN show/hide/modifyTextOf item y and item z.
      
    • passive behaviour of 1 item (waiting for 1+ events):

      WHEN ((itemA.propX is 'blah') AND (itemB.text()=="Yeah!") OR
            (itemC is checked) AND (itemD.value() >= 10))  
      THEN 
          self.setVisible(true); /self.hide(true);   //and
          itemF.setText("It's Magic!"); 
          ... 
      END-THEN 
      

The action triggering resp. event listening is intented to be on a per-page basis -- one later enhancement could be to also run "cross-page modifications/listenings", e.g. itemA on page 1 triggers some action on itemC on page 3.

How would you define, persist (XML,JSON?) this logic and finally run it within a client-side form controller?

A: 

PrimeFaces has a ready-to-use component for this, the p:wizard.

With regard to control rules, make use of the rendered attribute.

BalusC
Thank you very much for the link to this widget I wasn't aware of ... But, if I got it right, with 'rendered' attrib I've the cond. rules (a) fixed at runtime, and (b) dispersed all over the faces' code.Is there a dynamic way to "inject" rules from a central place *at runtime*? Goal: "Cond. rules" should be definied by "form admins" via jsf2 admin tool and stored all toghether somewhere. Now I'm wondering how to bring the rules into pre-defined, almost fixed faces!?-- Or is this "injection" only possible with addit. face-generating component?@all: Do you also know a solution for GWT?
Sandro
Sandro
Really no suggestions or tips for the issues stated in my last 2 comments??? -- Especially the JSF2-related, dynamics issue questioned in my 1st comment would be very important to me. Thanks a lot again.
Sandro