Re: DynamicWizards and Forms

2010-04-04 Thread Sumit Raja
Yes but they don't cover the scenario where the new wizard step is submitted 
even before it is displayed.

Investigated this a bit further and it seems that the delegation by the model 
to the actual wizard step does not happen in the correct order.  I'll try and 
recreate this with a very simple dynamic wizard and work from there.


On 2 Apr 2010, at 18:36, Jeremy Thomerson wrote:

 have you looked at the wizard examples in the wicket-examples package?
 http://www.wicket-library.com/wicket-examples/
 
 --
 Jeremy Thomerson
 http://www.wickettraining.com
 
 
 
 On Thu, Apr 1, 2010 at 8:49 AM, Sumit Raja sumitr...@gmail.com wrote:
 
 Hello,
 I am trying to get a dynamic wizard to work with a series of forms. I
 have the following flow:
 (1) Select document type - (2) if document type has embedded audio
 provide an upload form otherwise skip - (3) Document editing form.
 
 In next() of step 1 I am creating a new Panel with a form of either
 upload or of document editing based on doc type. The odd thing is that
 the submit on the form for step 2/3 seems to get called when next is
 clicked on (1) but before the step (2 or 3) is displayed.
 
 Looking through the code the if appears that the next() method gets
 called before the actual form processing is performed meaning that the
 form on the next step gets processed as well as the last step. In
 delegateSubmit(), formToProcess.visitChildren seems to be the actual
 place that the next step from gets submitted, before the previous step
 processing is complete.
 
 What is the correct way to structure a Dynamic wizard when each step
 has nested forms to prevent the visitor submitting the form on the
 next step as well?
 
 Thanks
 
 Sumit
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



DynamicWizards and Forms

2010-04-01 Thread Sumit Raja
Hello,
I am trying to get a dynamic wizard to work with a series of forms. I
have the following flow:
(1) Select document type - (2) if document type has embedded audio
provide an upload form otherwise skip - (3) Document editing form.

In next() of step 1 I am creating a new Panel with a form of either
upload or of document editing based on doc type. The odd thing is that
the submit on the form for step 2/3 seems to get called when next is
clicked on (1) but before the step (2 or 3) is displayed.

Looking through the code the if appears that the next() method gets
called before the actual form processing is performed meaning that the
form on the next step gets processed as well as the last step. In
delegateSubmit(), formToProcess.visitChildren seems to be the actual
place that the next step from gets submitted, before the previous step
processing is complete.

What is the correct way to structure a Dynamic wizard when each step
has nested forms to prevent the visitor submitting the form on the
next step as well?

Thanks

Sumit

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Help with Form submission and Ajax buttons

2010-01-13 Thread Sumit Raja
Hi,

Beginner question with Form handling: I have a panel that accepts name value
pairs in text fields.On the form there is an ajax button to add a value, an
ajax button to remove a value and an actual form submit button. I  have a
onSubmit handler for the form that actually processes the NV pairs once the
user has finished. When either the plus or minus button are pressed I update
the form's model and have the form rerenderd. For this to work correctly I
need the form's model updated but not have the form's onSubmit handler
called.  Setting default form processing to false on the twoajx  buttons did
not work as the model was not updated correctly (NPEs thrown)

I have overridden the two buttons' onSubmit() handler to set a flag (as
these seem to be called before the form's onSubmit()) and check for this
flag in the form's onSubmit and save or ignore the submit accordingly. Is
this the right way to do this?

I don't want to use another button to do the 'true' form submission as I
need to have this panel embedded in a wizard as well as an ordinary page.

Thanks

Sumit


DropDownChoice to add new a ListView

2009-12-14 Thread Sumit Raja
Hello,

Recently started a wicket project and was making excellent progress till ran 
into a problem with DropDownChoices. I am trying to get a DropDownChoice to add 
a panel to a form when an option is selected. The DropDownChoice contains a 
list of URI properties that each map to a different datatype. When a URI is 
selected in the drop down the correct component (DateField, textField, checkbox 
etc) needs to be added to the form to edit the property value. I am using 
fragments to actually render the right component for the datatype (as specified 
in the Bean editor example).

My DropDownChoice does the following:

protected boolean wantOnSelectionChangedNotifications() {
  return true;
}

protected void onSelectionChanged(final URI newSelection) {
  remove(dropdownChoice)
  add(new BagValueFormPanel(getComponentFactoryForURI(newSelection))
}


The BagValueFormPanel has a supporting model that adds edit components in a 
ListView along with a + symbol to add more components.

Unfortunately my list view panel does not get all the list items rendered. When 
running the BagValueFormPanel unit test, I get the following debug tree:

INFO  BaseWicketTester - path   form:panel  
wicketclient.components.form.BagValueFormPanel  [[= null amp;amp;]]
INFO  BaseWicketTester - path   form:panel:valuesList   
org.apache.wicket.markup.html.list.ListView [[= null amp;amp;]]
INFO  BaseWicketTester - path   form:panel:valuesList:0 
org.apache.wicket.markup.html.list.ListItem [= null amp;amp;]
INFO  BaseWicketTester - path   form:panel:valuesList:0:valueFragment   
org.apache.wicket.markup.html.panel.Fragment[]
INFO  BaseWicketTester - path   form:panel:valuesList:0:valueFragment:value 
wicketclient.panels.search.QueryElementPanel[= null amp;amp;]
INFO  BaseWicketTester - path   
form:panel:valuesList:0:valueFragment:value:condition   
org.apache.wicket.markup.html.form.DropDownChoice   [=]
INFO  BaseWicketTester - path   
form:panel:valuesList:0:valueFragment:value:value   
org.apache.wicket.markup.html.panel.Fragment[]
INFO  BaseWicketTester - path   
form:panel:valuesList:0:valueFragment:value:value:value 
org.apache.wicket.markup.html.form.TextField[]
INFO  BaseWicketTester - path   
form:panel:valuesList:0:valueFragment:value:booleanOp   
org.apache.wicket.markup.html.form.DropDownChoice   [amp;amp;]

But when running the test for the dynamic DropDownChoice panel where the 
selection is made to one of the list choices, I get the following tree 
(form:panel:filterParameterPanel:valuesList is the matching component):

INFO  BaseWicketTester - path   formorg.apache.wicket.markup.html.form.Form 
[]
INFO  BaseWicketTester - path   form:panel  
wicketclient.panels.search.PropertySelectComponent  []
INFO  BaseWicketTester - path   form:panel:propertyName 
org.apache.wicket.markup.html.panel.Fragment[]
INFO  BaseWicketTester - path   form:panel:propertyName:property
org.apache.wicket.markup.html.basic.Label   [Or The Other]
INFO  BaseWicketTester - path   form:panel:filterParameterPanel 
wicketclient.components.form.BagValueFormPanel  [[= null amp;amp;]]
INFO  BaseWicketTester - path   form:panel:filterParameterPanel:valuesList  
org.apache.wicket.markup.html.list.ListView [[= null amp;amp;]]
INFO  BaseWicketTester - path   form:panel:filterParameterPanel:addValue
org.apache.wicket.markup.html.form.SubmitLink   []

Is this kind of dynamic addition of components possible on an 
onSelectionChanged? If not I probably won't be able to add the panel in earlier 
and delay the selection of the right Fragment to render the edit control right?

Cheers

Sumit