Here I've got a straightforward working "nested wizard" example in Reagent:

https://gist.github.com/borkdude/cfd9e40edf7e545a8620

The structure of the example is as follows:

Wizard instance 1
  Foo Panel , Bar Panel

Foo Panel
  Button

Bar Panel
  [Bar Modal]
  Button , Button 

Bar Modal
  Wizard instance 2

On Saturday, October 4, 2014 12:39:50 AM UTC+2, Papa Balyo wrote:
> Greetings,
> 
> I'm trying to implement a Wizard component, which consists of several 
> sub-components:
> 
> 1. Top-level "Steps"
> 2. A form (which form depends on a selected step)
> 3. Previous/Next buttons
> 
> I've got initial working (showing appropriate forms based on a step 
> selected), but I'm currently stuck with 2 interesting problems:
> 
> 1. How to enable/disable Steps (and prev/next buttons) depending on 
> validation results of the form in a current step? Particularly, I'm trying to 
> understand if it's possible to bind a validation function to step enablement 
> property
> 2. How to bind "next/previous" buttons state to "steps" state? For example, 
> for the 1st step "Previous" button should not be visible.
> 
> I've made an ugly version, which does swap! for "step" and "next/prev" 
> buttons components in form validation handlers, but it led to scattering the 
> logic of state modifications all over the place. There should be more elegant 
> way in which "next" button just knows on which state changes of other 
> components to react.
> 
> Any advices or code examples that anybody can share?
> 
> Thanks!

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to