Re: Wizard and onSubmit of nested form

2009-03-07 Thread rmattler

Show us your code and I'll see if I can help.



Dave Schoorl wrote:
 
 Hi Robert, thanks for your quick reply.
 
 I am not sure if I understand what you mean. How is form validation 
 helping with the trigger of onSubmit() on the correct form?
 But I gave it a try and the problem remains: the onSubmit of the next 
 step is called instead of the current step. I think that first the panel 
 of the current step is replaced with the panel of the next step and then 
 the onSubmit is executed.
 
 Hope someone can help me.
 
 Regards,
 Dave
 
 
 rmattler wrote:
 Use public void validate(Form form)

 See example below.  Hope it helps.


 private final class Step2 extends WizardStep {
  public Step2() {
  setTitleModel(new Model(Add pictures));

  add(new AbstractFormValidator() {
  public FormComponent[] 
 getDependentFormComponents() {
  return null;
  }

  public void validate(Form form) {

  String dir = 
 Constants.ADD_PROJECT_FILE_PIC_PATH +
 getProjects().getTblId();

  File filesDir = new File(dir);
  if (filesDir.canRead() || 
 filesDir.isDirectory()) {
  String[] fileNames = 
 filesDir.list();
  if (fileNames.length  0) {
  
 getProjects().setNumPhotos(fileNames.length);
  } else {
  form.error(Please 
 upload some photos);
  }
  } else {
  form.error(Please upload some 
 photos);
  }

  }
  });

  }
  }

 Dave Schoorl wrote:
   
 Hi all,

 I am building my first Wizard with the wizard from wicket-extensions 
 version 1.3.5. Every step contains a panel with it's own form, so I have 
 a nested form in the wizards form. I was expecting that when I click 
 next, the onSubmit of my current form is called, but it's not. Instead 
 the onSubmit of the form in the next step is called.

 This seems to be related: http://markmail.org/message/ktpvzvslq5tupo6x

 Am I doing something wrong?

 Regards,
 Dave


 -
 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
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Wizard-and-onSubmit-of-nested-form-tp22375244p22388940.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Wizard and onSubmit of nested form

2009-03-07 Thread Dave Schoorl
I created the following Jira issue for this: 
https://issues.apache.org/jira/browse/WICKET-2150




Dave Schoorl wrote:
Thanks. But I've dug a little deeper and it turns out that the panel 
switching is done in the onSubmit() of the Wizard's NextButton. The 
Form's onSubmit() is executed after that, so that will execute the 
onSubmit() of the replaced (read: next) nested Form.


I don't think that is correct, so I will be preparing a Jira issue 
later today.


But I am still looking for a work around (or maybe a permanent 
solution that can be submitted as a patch).


Regards,
Dave


rmattler wrote:

Show us your code and I'll see if I can help.



Dave Schoorl wrote:

Hi Robert, thanks for your quick reply.

I am not sure if I understand what you mean. How is form validation 
helping with the trigger of onSubmit() on the correct form?
But I gave it a try and the problem remains: the onSubmit of the 
next step is called instead of the current step. I think that first 
the panel of the current step is replaced with the panel of the next 
step and then the onSubmit is executed.


Hope someone can help me.

Regards,
Dave


rmattler wrote:

Use public void validate(Form form)

See example below. Hope it helps.


private final class Step2 extends WizardStep {
public Step2() {
setTitleModel(new Model(Add pictures));

add(new AbstractFormValidator() {
public FormComponent[] getDependentFormComponents() {
return null;
}

public void validate(Form form) {

String dir = Constants.ADD_PROJECT_FILE_PIC_PATH +
getProjects().getTblId();

File filesDir = new File(dir);
if (filesDir.canRead() || filesDir.isDirectory()) {
String[] fileNames = filesDir.list();
if (fileNames.length  0) {
getProjects().setNumPhotos(fileNames.length);
} else {
form.error(Please upload some photos);
}
} else {
form.error(Please upload some photos);
}

}
});

}
}

Dave Schoorl wrote:

Hi all,

I am building my first Wizard with the wizard from 
wicket-extensions version 1.3.5. Every step contains a panel with 
it's own form, so I have a nested form in the wizards form. I was 
expecting that when I click next, the onSubmit of my current form 
is called, but it's not. Instead the onSubmit of the form in the 
next step is called.


This seems to be related: 
http://markmail.org/message/ktpvzvslq5tupo6x


Am I doing something wrong?

Regards,
Dave


-
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








-
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



Wizard and onSubmit of nested form

2009-03-06 Thread Dave Schoorl

Hi all,

I am building my first Wizard with the wizard from wicket-extensions 
version 1.3.5. Every step contains a panel with it's own form, so I have 
a nested form in the wizards form. I was expecting that when I click 
next, the onSubmit of my current form is called, but it's not. Instead 
the onSubmit of the form in the next step is called.


This seems to be related: http://markmail.org/message/ktpvzvslq5tupo6x

Am I doing something wrong?

Regards,
Dave


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



Re: Wizard and onSubmit of nested form

2009-03-06 Thread rmattler

Use public void validate(Form form)

See example below.  Hope it helps.


private final class Step2 extends WizardStep {
public Step2() {
setTitleModel(new Model(Add pictures));

add(new AbstractFormValidator() {
public FormComponent[] 
getDependentFormComponents() {
return null;
}

public void validate(Form form) {

String dir = 
Constants.ADD_PROJECT_FILE_PIC_PATH +
getProjects().getTblId();

File filesDir = new File(dir);
if (filesDir.canRead() || 
filesDir.isDirectory()) {
String[] fileNames = 
filesDir.list();
if (fileNames.length  0) {

getProjects().setNumPhotos(fileNames.length);
} else {
form.error(Please 
upload some photos);
}
} else {
form.error(Please upload some 
photos);
}

}
});

}
}

Dave Schoorl wrote:
 
 Hi all,
 
 I am building my first Wizard with the wizard from wicket-extensions 
 version 1.3.5. Every step contains a panel with it's own form, so I have 
 a nested form in the wizards form. I was expecting that when I click 
 next, the onSubmit of my current form is called, but it's not. Instead 
 the onSubmit of the form in the next step is called.
 
 This seems to be related: http://markmail.org/message/ktpvzvslq5tupo6x
 
 Am I doing something wrong?
 
 Regards,
 Dave
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Wizard-and-onSubmit-of-nested-form-tp22375244p22375366.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Wizard and onSubmit of nested form

2009-03-06 Thread Dave Schoorl

Hi Robert, thanks for your quick reply.

I am not sure if I understand what you mean. How is form validation 
helping with the trigger of onSubmit() on the correct form?
But I gave it a try and the problem remains: the onSubmit of the next 
step is called instead of the current step. I think that first the panel 
of the current step is replaced with the panel of the next step and then 
the onSubmit is executed.


Hope someone can help me.

Regards,
Dave


rmattler wrote:

Use public void validate(Form form)

See example below.  Hope it helps.


private final class Step2 extends WizardStep {
public Step2() {
setTitleModel(new Model(Add pictures));

add(new AbstractFormValidator() {
public FormComponent[] 
getDependentFormComponents() {
return null;
}

public void validate(Form form) {

String dir = 
Constants.ADD_PROJECT_FILE_PIC_PATH +
getProjects().getTblId();

File filesDir = new File(dir);
if (filesDir.canRead() || 
filesDir.isDirectory()) {
String[] fileNames = 
filesDir.list();
if (fileNames.length  0) {

getProjects().setNumPhotos(fileNames.length);
} else {
form.error(Please upload 
some photos);
}
} else {
form.error(Please upload some 
photos);
}

}
});

}
}

Dave Schoorl wrote:
  

Hi all,

I am building my first Wizard with the wizard from wicket-extensions 
version 1.3.5. Every step contains a panel with it's own form, so I have 
a nested form in the wizards form. I was expecting that when I click 
next, the onSubmit of my current form is called, but it's not. Instead 
the onSubmit of the form in the next step is called.


This seems to be related: http://markmail.org/message/ktpvzvslq5tupo6x

Am I doing something wrong?

Regards,
Dave


-
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