Problem Submitting Form in Modal Window / Ajax POST stopped

2013-04-17 Thread Tim Eapen
Hi All,

I have a form inside a modal window.  I want to submit the form using an 
AjaxButton, however the button is unresponsive.  Looks like there are some 
errors client-side.  I see the following error in the Ajax Debug window:

INFO: Ajax POST stopped because of precondition check, 
url:?wicket:interface=:5:cellDefinitionModal:content:addFundingDefinitionForm:dialogCancel::IActivePageBehaviorListener:0:-1&wicket:ignoreIfNotActive=true

Any ideas as to what I am doing wrong?

Here is the mark-up for the panel I am using to fill the modal:

http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd";>




















 










tim


Re: problem to test form in modal window with wicket tester

2011-05-26 Thread Andrea Del Bene
Sorry, I didn't noticed that getContent() is protected. The solution you 
found is perfect :-)

I didn't find getContent() method to modalWindow component, but it works
well in two steps :
ConnexionContentPanel loginPanel = (ConnexionContentPanel)
modalWindow.get(modalWindow.getContentId());
Form  loginForm = (Form) loginPanel.get("loginForm");

thanks a lot !

2011/5/26 Andrea Del Bene




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



Re: problem to test form in modal window with wicket tester

2011-05-26 Thread Mathilde Pellerin
I didn't find getContent() method to modalWindow component, but it works
well in two steps :
ConnexionContentPanel loginPanel = (ConnexionContentPanel)
modalWindow.get(modalWindow.getContentId());
Form loginForm = (Form) loginPanel.get("loginForm");

thanks a lot !

2011/5/26 Andrea Del Bene 

> Form id is corret, but remember that form and feedback panel are not added
> directly to modal window. They are inside ConnexionContentPanel which in
> turn  is added to modalwindow.
> In your test you should be able to access form calling getContent() before
> get("loginForm"), i.e:
>
> modalWindow.getContent().get("loginForm")
>
>
>
>  this is the code to construct modal window
>> final ModalWindowE4N modalConnexion = new
>> ModalWindowE4N("modalConnexion");
>> modalConnexion.setTitle("Connexion à l'espace membre");
>> modalConnexion.setContent(new
>> ConnexionContentPanel(modalConnexion.getContentId()));
>> add(modalConnexion);
>>
>> Form is added in ConnexionContentPanel :
>> public ConnexionContentPanel(String id) {
>> super(id);
>>
>> //Création du formulaire dont les champs seront liés aux champs
>> d'un
>> membre grace au model
>> Form  loginForm = new Form("loginForm",
>> new CompoundPropertyModel(new
>> LoadableDetachableModel() {
>>
>> @Override
>> protected Membre load() {
>> return new Membre();
>> }
>> }));
>>
>> //Création et ajout des champs id et pwd au formulaire
>> TextField  idField = new TextField("membreId");
>> idField.setRequired(true);
>> loginForm.add(idField);
>>
>> PasswordTextField pwdField = new PasswordTextField("password");
>> pwdField.setRequired(true);
>> loginForm.add(pwdField);
>>
>> //Ajout d'un du feedback panel qui contiendra les erreurs relevées
>> par le formulaire
>> final FeedbackPanel feedBackPanel = new FeedbackPanel("errorMsg");
>> feedBackPanel.setOutputMarkupId(true);
>> add(feedBackPanel);
>>
>> //création du bouton ajax pour soumettre le formulaire
>> AjaxButton submitbutton = new AjaxButton("ajaxSubmitLogin") {
>>
>> @Override
>> protected void onSubmit(AjaxRequestTarget target, Form
>>  form)
>> {
>> Membre modelObject = (Membre) form.getModelObject();
>> Membre membre;
>>
>> membre = serviceIdentif.identifier(modelObject.getId(),
>> modelObject.getPassword());
>> if(membre == null)
>> error("Identifiant ou mot de passe incorrect");
>> else
>> setResponsePage(TableauBordPage.class);
>> }
>>
>> @Override
>> protected void onError(AjaxRequestTarget target, Form
>>  form) {
>> target.addComponent(feedBackPanel);
>> }
>> };
>> loginForm.add(submitbutton);
>>
>> //ajout du formulaire au panel
>> add(loginForm);
>> }
>>
>> you can see that form id is correct.
>> It is the same problem with FeedBackPanel errorMsg : I get a null pointer
>> when I try to get it with modalWindow.get("errorMsg");
>>
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
 Mathilde Pellerin  Ingénieur en Génie Logiciel  Tél mobile :
06.60.78.79.03   E-mail
: mathilde.pelle...@gmail.com   Mon CV en ligne :
 http://www.mathilde-pellerin.fr/Mes
liens :  



Re: problem to test form in modal window with wicket tester

2011-05-26 Thread Andrea Del Bene
Form id is corret, but remember that form and feedback panel are not 
added directly to modal window. They are inside ConnexionContentPanel 
which in turn  is added to modalwindow.
In your test you should be able to access form calling getContent() 
before get("loginForm"), i.e:


modalWindow.getContent().get("loginForm")



this is the code to construct modal window
 final ModalWindowE4N modalConnexion = new
ModalWindowE4N("modalConnexion");
 modalConnexion.setTitle("Connexion à l'espace membre");
 modalConnexion.setContent(new
ConnexionContentPanel(modalConnexion.getContentId()));
 add(modalConnexion);

Form is added in ConnexionContentPanel :
public ConnexionContentPanel(String id) {
 super(id);

 //Création du formulaire dont les champs seront liés aux champs d'un
membre grace au model
 Form  loginForm = new Form("loginForm",
 new CompoundPropertyModel(new
LoadableDetachableModel() {

 @Override
 protected Membre load() {
 return new Membre();
 }
 }));

 //Création et ajout des champs id et pwd au formulaire
 TextField  idField = new TextField("membreId");
 idField.setRequired(true);
 loginForm.add(idField);

 PasswordTextField pwdField = new PasswordTextField("password");
 pwdField.setRequired(true);
 loginForm.add(pwdField);

 //Ajout d'un du feedback panel qui contiendra les erreurs relevées
par le formulaire
 final FeedbackPanel feedBackPanel = new FeedbackPanel("errorMsg");
 feedBackPanel.setOutputMarkupId(true);
 add(feedBackPanel);

 //création du bouton ajax pour soumettre le formulaire
 AjaxButton submitbutton = new AjaxButton("ajaxSubmitLogin") {

 @Override
 protected void onSubmit(AjaxRequestTarget target, Form  form)
{
 Membre modelObject = (Membre) form.getModelObject();
 Membre membre;

 membre = serviceIdentif.identifier(modelObject.getId(),
modelObject.getPassword());
 if(membre == null)
 error("Identifiant ou mot de passe incorrect");
 else
 setResponsePage(TableauBordPage.class);
 }

 @Override
 protected void onError(AjaxRequestTarget target, Form  form) {
 target.addComponent(feedBackPanel);
 }
 };
 loginForm.add(submitbutton);

 //ajout du formulaire au panel
 add(loginForm);
 }

you can see that form id is correct.
It is the same problem with FeedBackPanel errorMsg : I get a null pointer
when I try to get it with modalWindow.get("errorMsg");





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



Re: problem to test form in modal window with wicket tester

2011-05-26 Thread Mathilde Pellerin
It's fix : when I paste code to show you, I notice that login form is not
added in modal window but in ConnexionContentPanel...
So I try this code :
ModalWindowE4N modalWindow = (ModalWindowE4N)
tester.getComponentFromLastRenderedPage("modalConnexion");
ConnexionContentPanel loginPanel = (ConnexionContentPanel)
modalWindow.get(modalWindow.getContentId());
Form loginForm = (Form) loginPanel.get("loginForm");

FormTester formTester =
tester.newFormTester(loginForm.getPageRelativePath());

and it works.
Thanks for your help.



2011/5/26 Mathilde Pellerin 

>
>
> this is the code to construct modal window
> final ModalWindowE4N modalConnexion = new
> ModalWindowE4N("modalConnexion");
> modalConnexion.setTitle("Connexion à l'espace membre");
> modalConnexion.setContent(new
> ConnexionContentPanel(modalConnexion.getContentId()));
> add(modalConnexion);
>
> Form is added in ConnexionContentPanel :
> public ConnexionContentPanel(String id) {
> super(id);
>
> //Création du formulaire dont les champs seront liés aux champs
> d'un membre grace au model
> Form loginForm = new Form("loginForm",
> new CompoundPropertyModel(new
> LoadableDetachableModel() {
>
> @Override
> protected Membre load() {
> return new Membre();
> }
> }));
>
> //Création et ajout des champs id et pwd au formulaire
> TextField idField = new TextField("membreId");
> idField.setRequired(true);
> loginForm.add(idField);
>
> PasswordTextField pwdField = new PasswordTextField("password");
> pwdField.setRequired(true);
> loginForm.add(pwdField);
>
> //Ajout d'un du feedback panel qui contiendra les erreurs relevées
> par le formulaire
> final FeedbackPanel feedBackPanel = new FeedbackPanel("errorMsg");
> feedBackPanel.setOutputMarkupId(true);
> add(feedBackPanel);
>
> //création du bouton ajax pour soumettre le formulaire
> AjaxButton submitbutton = new AjaxButton("ajaxSubmitLogin") {
>
> @Override
> protected void onSubmit(AjaxRequestTarget target, Form form)
> {
> Membre modelObject = (Membre) form.getModelObject();
> Membre membre;
>
> membre = serviceIdentif.identifier(modelObject.getId(),
> modelObject.getPassword());
> if(membre == null)
> error("Identifiant ou mot de passe incorrect");
> else
> setResponsePage(TableauBordPage.class);
> }
>
> @Override
> protected void onError(AjaxRequestTarget target, Form form)
> {
> target.addComponent(feedBackPanel);
> }
> };
> loginForm.add(submitbutton);
>
> //ajout du formulaire au panel
> add(loginForm);
> }
>
> you can see that form id is correct.
> It is the same problem with FeedBackPanel errorMsg : I get a null pointer
> when I try to get it with modalWindow.get("errorMsg");
>
>
>
>
>
>
>
> 2011/5/26 Andrea Del Bene 
>
>> Hi Mathilde,
>>
>> maybe the form id you use in test is not correct. How do you add form to
>> modalWindow? Can you attach code?
>>
>>
>>
>>
>>  Hi all,
>>>
>>> I have a modal window with a login form inside that works fine when I
>>> test
>>> it manually.
>>> I try to test it with wicket tester since yesterday. I saw in some mails
>>> of
>>> this list that "there is nothing special in testing modal windows".
>>> I tried this :
>>>
>>> tester.startPage(AccueilPage.class);
>>> tester.clickLink("connexion");
>>>
>>> ModalWindowE4N modalWindow = (ModalWindowE4N)
>>> tester.getComponentFromLastRenderedPage("modalConnexion");
>>> tester.isVisible(modalWindow.getPageRelativePath() + ":" +
>>> modalWindow.getContentId());
>>>
>>> Form  loginForm = (Form) modalWindow.get("loginForm");
>>> Component feedbackPanel = modalWindow.get("errorMsg");
>>>
>>> FormTester formTester =
>>> tester.newFormTester(loginForm.getPageRelativePath() + ":" +
>>> loginForm.getId());
>>>
>>> but I have a java.lang.NullPointerException on loginForm (and
>>> feedbackPanel
>>> is also null).
>>> I begin with Wiket and I really don't understand why it doesn't work.
>>> What am I doing wrong?
>>>
>>> Thanks
>>> Mathilde
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
> --
>  Mathilde Pellerin  Ingénieur en Génie Logiciel  Tél mobile :
> 06.60.78.79.03   E-mail : mathilde.pelle...@gmail.com   Mon CV en ligne :
>  http://www.mathilde-pellerin.fr/Mes
> liens :  
> 

Re: problem to test form in modal window with wicket tester

2011-05-26 Thread Mathilde Pellerin
this is the code to construct modal window
final ModalWindowE4N modalConnexion = new
ModalWindowE4N("modalConnexion");
modalConnexion.setTitle("Connexion à l'espace membre");
modalConnexion.setContent(new
ConnexionContentPanel(modalConnexion.getContentId()));
add(modalConnexion);

Form is added in ConnexionContentPanel :
public ConnexionContentPanel(String id) {
super(id);

//Création du formulaire dont les champs seront liés aux champs d'un
membre grace au model
Form loginForm = new Form("loginForm",
new CompoundPropertyModel(new
LoadableDetachableModel() {

@Override
protected Membre load() {
return new Membre();
}
}));

//Création et ajout des champs id et pwd au formulaire
TextField idField = new TextField("membreId");
idField.setRequired(true);
loginForm.add(idField);

PasswordTextField pwdField = new PasswordTextField("password");
pwdField.setRequired(true);
loginForm.add(pwdField);

//Ajout d'un du feedback panel qui contiendra les erreurs relevées
par le formulaire
final FeedbackPanel feedBackPanel = new FeedbackPanel("errorMsg");
feedBackPanel.setOutputMarkupId(true);
add(feedBackPanel);

//création du bouton ajax pour soumettre le formulaire
AjaxButton submitbutton = new AjaxButton("ajaxSubmitLogin") {

@Override
protected void onSubmit(AjaxRequestTarget target, Form form)
{
Membre modelObject = (Membre) form.getModelObject();
Membre membre;

membre = serviceIdentif.identifier(modelObject.getId(),
modelObject.getPassword());
if(membre == null)
error("Identifiant ou mot de passe incorrect");
else
setResponsePage(TableauBordPage.class);
}

@Override
protected void onError(AjaxRequestTarget target, Form form) {
target.addComponent(feedBackPanel);
}
};
loginForm.add(submitbutton);

//ajout du formulaire au panel
add(loginForm);
}

you can see that form id is correct.
It is the same problem with FeedBackPanel errorMsg : I get a null pointer
when I try to get it with modalWindow.get("errorMsg");






2011/5/26 Andrea Del Bene 

> Hi Mathilde,
>
> maybe the form id you use in test is not correct. How do you add form to
> modalWindow? Can you attach code?
>
>
>
>
>  Hi all,
>>
>> I have a modal window with a login form inside that works fine when I test
>> it manually.
>> I try to test it with wicket tester since yesterday. I saw in some mails
>> of
>> this list that "there is nothing special in testing modal windows".
>> I tried this :
>>
>> tester.startPage(AccueilPage.class);
>> tester.clickLink("connexion");
>>
>> ModalWindowE4N modalWindow = (ModalWindowE4N)
>> tester.getComponentFromLastRenderedPage("modalConnexion");
>> tester.isVisible(modalWindow.getPageRelativePath() + ":" +
>> modalWindow.getContentId());
>>
>> Form  loginForm = (Form) modalWindow.get("loginForm");
>> Component feedbackPanel = modalWindow.get("errorMsg");
>>
>> FormTester formTester =
>> tester.newFormTester(loginForm.getPageRelativePath() + ":" +
>> loginForm.getId());
>>
>> but I have a java.lang.NullPointerException on loginForm (and
>> feedbackPanel
>> is also null).
>> I begin with Wiket and I really don't understand why it doesn't work.
>> What am I doing wrong?
>>
>> Thanks
>> Mathilde
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
 Mathilde Pellerin  Ingénieur en Génie Logiciel  Tél mobile :
06.60.78.79.03   E-mail
: mathilde.pelle...@gmail.com   Mon CV en ligne :
 http://www.mathilde-pellerin.fr/Mes
liens :  



Re: problem to test form in modal window with wicket tester

2011-05-26 Thread Andrea Del Bene

Hi Mathilde,

maybe the form id you use in test is not correct. How do you add form to 
modalWindow? Can you attach code?





Hi all,

I have a modal window with a login form inside that works fine when I test
it manually.
I try to test it with wicket tester since yesterday. I saw in some mails of
this list that "there is nothing special in testing modal windows".
I tried this :

 tester.startPage(AccueilPage.class);
 tester.clickLink("connexion");

 ModalWindowE4N modalWindow = (ModalWindowE4N)
tester.getComponentFromLastRenderedPage("modalConnexion");
 tester.isVisible(modalWindow.getPageRelativePath() + ":" +
modalWindow.getContentId());

 Form  loginForm = (Form) modalWindow.get("loginForm");
 Component feedbackPanel = modalWindow.get("errorMsg");

 FormTester formTester =
tester.newFormTester(loginForm.getPageRelativePath() + ":" +
loginForm.getId());

but I have a java.lang.NullPointerException on loginForm (and feedbackPanel
is also null).
I begin with Wiket and I really don't understand why it doesn't work.
What am I doing wrong?

Thanks
Mathilde




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



problem to test form in modal window with wicket tester

2011-05-26 Thread Mathilde Pellerin
Hi all,

I have a modal window with a login form inside that works fine when I test
it manually.
I try to test it with wicket tester since yesterday. I saw in some mails of
this list that "there is nothing special in testing modal windows".
I tried this :

tester.startPage(AccueilPage.class);
tester.clickLink("connexion");

ModalWindowE4N modalWindow = (ModalWindowE4N)
tester.getComponentFromLastRenderedPage("modalConnexion");
tester.isVisible(modalWindow.getPageRelativePath() + ":" +
modalWindow.getContentId());

Form loginForm = (Form) modalWindow.get("loginForm");
Component feedbackPanel = modalWindow.get("errorMsg");

FormTester formTester =
tester.newFormTester(loginForm.getPageRelativePath() + ":" +
loginForm.getId());

but I have a java.lang.NullPointerException on loginForm (and feedbackPanel
is also null).
I begin with Wiket and I really don't understand why it doesn't work.
What am I doing wrong?

Thanks
Mathilde


Re: form in modal window

2011-05-25 Thread Mathilde Pellerin
Ok, it's fix with an ajaxButton.
The first time that I tried, I forgot a cast, that's why it didn't work.


2011/5/25 Mathilde Pellerin 

> Thanks for answer.
>
> Sorry for the first question : it was not the main problem so I didn't
> search the solution.  Now it's fine, the confirmation message disappear.
>
> But the main problem was the second : how can I prevent the modal to
> disappear when login failed?
>
> I tried to use ajaxButton instead submit button but then I can't I use the
> model of my form like I did with submit button.
>
> Any advice would be great...
>
> this is my actual code (with submit button, no ajax) :
>
> public class ConnexionContentPanel extends FeedbackPanel {
> private static final long serialVersionUID = 6952274296991345904L;
>
> @SpringBean
> private ServiceIdentification serviceIdentif;
>
> @SuppressWarnings("serial")
>
> public ConnexionContentPanel(String id) {
> super(id);
>
> Form loginForm = new Form("loginForm",
> new CompoundPropertyModel(new
> LoadableDetachableModel() {
>
> @Override
> protected Membre load() {
> return new Membre();
> }
> })) {
>
> @Override
> protected void onSubmit() {
> Membre membre;
>
> membre =
> serviceIdentif.identifier(getModelObject().getId(),
> getModelObject().getPassword());
> if(membre == null)
> error("Identifiant ou mot de passe incorrect");
> else
> System.out.println("Connexion");
>
> }
> };
>
> loginForm.add(new TextField("membreId"));
> loginForm.add(new PasswordTextField("password"));
>
> add(loginForm);
> }
> }
>
>
> 2011/5/25 Martin Grigorov 
>
>> Translate the message to English and search in Nabble/Google.
>> It has been discussed many times.
>>
>> On Wed, May 25, 2011 at 12:46 PM, Mathilde Pellerin <
>> mathilde.pelle...@gmail.com> wrote:
>>
>> > Hi all,
>> >
>> > I have a login form in a modal window.
>> > I want that an error message appears when login fail, so my panel
>> extends
>> > FeedBackPanel.
>> > But when I submit the form, an confirmation message appears with this
>> > message :
>> > "Voulez-vous vraiment quitter cette page ?
>> > Reloading this page will cause the modal window to disappear.
>> > Appuyer sur OK pour continuer, ou Annuler pour rester sur la page
>> > actuelle."
>> >
>> > and if I click on OK, the modal window disappear even if login failed.
>> >
>> > this is my code :
>> > public ConnexionContentPanel(String id) {
>> >super(id);
>> >
>> >Form loginForm = new Form("loginForm",
>> >new CompoundPropertyModel(new
>> > LoadableDetachableModel() {
>> >
>> >@Override
>> >protected Membre load() {
>> >return new Membre();
>> >}
>> >})) {
>> >
>> >@Override
>> >protected void onSubmit() {
>> >Membre membre;
>> >
>> >try {
>> >membre =
>> > serviceIdentif.identifier(getModelObject().getId(),
>> > getModelObject().getPassword());
>> >if(membre == null)
>> >error("Identifiant ou mot de passe incorrect");
>> >else
>> >System.out.println("Connexion");
>> >} catch (Exception e) {
>> >e.printStackTrace();
>> >}
>> >
>> >}
>> >};
>> >loginForm.add(new TextField("membreId"));
>> >loginForm.add(new PasswordTextField("password"));
>> >
>> >add(loginForm);
>> >}
>> >
>> > how can I avoid the confirmation message, and how can I prevent the
>> modal
>> > to
>> > disappear whan login failed?
>> >
>> > thanks.
>> >
>> > Mathilde
>> >
>> > --
>> >  Mathilde Pellerin  Ingénieur en Génie Logiciel  Tél mobile :
>> > 06.60.78.79.03   E-mail
>> > : mathilde.pelle...@gmail.com   Mon CV en ligne :
>> >  http://www.mathilde-pellerin.fr/
>>  Mes
>> > liens :  
>> > 
>> >
>>
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com 
>>
>
>
>
> --
>  Mathilde Pellerin  Ingénieur en Génie Logiciel  Tél mobile :
> 06.60.78.79.03   E-mail : mathilde.pelle...@gmail.com   Mon CV en ligne :
>  http://www.mathilde-pellerin.fr/Mes
> liens :  
> 
>



-- 
 Mathilde Pellerin  Ingénieur en Génie Logiciel  Tél mobile :
06.60.78.79.03   E-mail
: mathilde.pelle...@gmail.com   Mon CV en ligne :


Re: form in modal window

2011-05-25 Thread François Meillet
 @Override
protected void onSubmit(AjaxRequestTarget ajaxRequestTarget, 
Form form) {

  form.getDefaultModel().
}

Le 25 mai 2011 à 13:57, Mathilde Pellerin a écrit :

> Thanks for answer.
> 
> Sorry for the first question : it was not the main problem so I didn't
> search the solution.  Now it's fine, the confirmation message disappear.
> 
> But the main problem was the second : how can I prevent the modal to
> disappear when login failed?
> 
> I tried to use ajaxButton instead submit button but then I can't I use the
> model of my form like I did with submit button.
> 
> Any advice would be great...
> 
> this is my actual code (with submit button, no ajax) :
> 
> public class ConnexionContentPanel extends FeedbackPanel {
>private static final long serialVersionUID = 6952274296991345904L;
> 
>@SpringBean
>private ServiceIdentification serviceIdentif;
> 
>@SuppressWarnings("serial")
>public ConnexionContentPanel(String id) {
>super(id);
> 
>Form loginForm = new Form("loginForm",
>new CompoundPropertyModel(new
> LoadableDetachableModel() {
> 
>@Override
>protected Membre load() {
>return new Membre();
>}
>})) {
> 
>@Override
>protected void onSubmit() {
>Membre membre;
> 
>membre = serviceIdentif.identifier(getModelObject().getId(),
> getModelObject().getPassword());
>if(membre == null)
>error("Identifiant ou mot de passe incorrect");
>else
>System.out.println("Connexion");
> 
>}
>};
> 
>loginForm.add(new TextField("membreId"));
>loginForm.add(new PasswordTextField("password"));
> 
>add(loginForm);
>}
> }
> 
> 
> 2011/5/25 Martin Grigorov 
> 
>> Translate the message to English and search in Nabble/Google.
>> It has been discussed many times.
>> 
>> On Wed, May 25, 2011 at 12:46 PM, Mathilde Pellerin <
>> mathilde.pelle...@gmail.com> wrote:
>> 
>>> Hi all,
>>> 
>>> I have a login form in a modal window.
>>> I want that an error message appears when login fail, so my panel extends
>>> FeedBackPanel.
>>> But when I submit the form, an confirmation message appears with this
>>> message :
>>> "Voulez-vous vraiment quitter cette page ?
>>> Reloading this page will cause the modal window to disappear.
>>> Appuyer sur OK pour continuer, ou Annuler pour rester sur la page
>>> actuelle."
>>> 
>>> and if I click on OK, the modal window disappear even if login failed.
>>> 
>>> this is my code :
>>> public ConnexionContentPanel(String id) {
>>>   super(id);
>>> 
>>>   Form loginForm = new Form("loginForm",
>>>   new CompoundPropertyModel(new
>>> LoadableDetachableModel() {
>>> 
>>>   @Override
>>>   protected Membre load() {
>>>   return new Membre();
>>>   }
>>>   })) {
>>> 
>>>   @Override
>>>   protected void onSubmit() {
>>>   Membre membre;
>>> 
>>>   try {
>>>   membre =
>>> serviceIdentif.identifier(getModelObject().getId(),
>>> getModelObject().getPassword());
>>>   if(membre == null)
>>>   error("Identifiant ou mot de passe incorrect");
>>>   else
>>>   System.out.println("Connexion");
>>>   } catch (Exception e) {
>>>   e.printStackTrace();
>>>   }
>>> 
>>>   }
>>>   };
>>>   loginForm.add(new TextField("membreId"));
>>>   loginForm.add(new PasswordTextField("password"));
>>> 
>>>   add(loginForm);
>>>   }
>>> 
>>> how can I avoid the confirmation message, and how can I prevent the modal
>>> to
>>> disappear whan login failed?
>>> 
>>> thanks.
>>> 
>>> Mathilde
>>> 
>>> --
>>> Mathilde Pellerin  Ingénieur en Génie Logiciel  Tél mobile :
>>> 06.60.78.79.03   E-mail
>>> : mathilde.pelle...@gmail.com   Mon CV en ligne :
>>>  http://www.mathilde-pellerin.fr/
>> Mes
>>> liens :  
>>> 
>>> 
>> 
>> 
>> 
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com 
>> 
> 
> 
> 
> -- 
> Mathilde Pellerin  Ingénieur en Génie Logiciel  Tél mobile :
> 06.60.78.79.03   E-mail
> : mathilde.pelle...@gmail.com   Mon CV en ligne :
>  http://www.mathilde-pellerin.fr/Mes
> liens :  
> 

François Meillet
fm...@meillet.com




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

Re: form in modal window

2011-05-25 Thread François Meillet
just use an AjaxButton

François



Le 25 mai 2011 à 13:57, Mathilde Pellerin a écrit :

> Thanks for answer.
> 
> Sorry for the first question : it was not the main problem so I didn't
> search the solution.  Now it's fine, the confirmation message disappear.
> 
> But the main problem was the second : how can I prevent the modal to
> disappear when login failed?
> 
> I tried to use ajaxButton instead submit button but then I can't I use the
> model of my form like I did with submit button.
> 
> Any advice would be great...
> 
> this is my actual code (with submit button, no ajax) :
> 
> public class ConnexionContentPanel extends FeedbackPanel {
>private static final long serialVersionUID = 6952274296991345904L;
> 
>@SpringBean
>private ServiceIdentification serviceIdentif;
> 
>@SuppressWarnings("serial")
>public ConnexionContentPanel(String id) {
>super(id);
> 
>Form loginForm = new Form("loginForm",
>new CompoundPropertyModel(new
> LoadableDetachableModel() {
> 
>@Override
>protected Membre load() {
>return new Membre();
>}
>})) {
> 
>@Override
>protected void onSubmit() {
>Membre membre;
> 
>membre = serviceIdentif.identifier(getModelObject().getId(),
> getModelObject().getPassword());
>if(membre == null)
>error("Identifiant ou mot de passe incorrect");
>else
>System.out.println("Connexion");
> 
>}
>};
> 
>loginForm.add(new TextField("membreId"));
>loginForm.add(new PasswordTextField("password"));
> 
>add(loginForm);
>}
> }
> 
> 
> 2011/5/25 Martin Grigorov 
> 
>> Translate the message to English and search in Nabble/Google.
>> It has been discussed many times.
>> 
>> On Wed, May 25, 2011 at 12:46 PM, Mathilde Pellerin <
>> mathilde.pelle...@gmail.com> wrote:
>> 
>>> Hi all,
>>> 
>>> I have a login form in a modal window.
>>> I want that an error message appears when login fail, so my panel extends
>>> FeedBackPanel.
>>> But when I submit the form, an confirmation message appears with this
>>> message :
>>> "Voulez-vous vraiment quitter cette page ?
>>> Reloading this page will cause the modal window to disappear.
>>> Appuyer sur OK pour continuer, ou Annuler pour rester sur la page
>>> actuelle."
>>> 
>>> and if I click on OK, the modal window disappear even if login failed.
>>> 
>>> this is my code :
>>> public ConnexionContentPanel(String id) {
>>>   super(id);
>>> 
>>>   Form loginForm = new Form("loginForm",
>>>   new CompoundPropertyModel(new
>>> LoadableDetachableModel() {
>>> 
>>>   @Override
>>>   protected Membre load() {
>>>   return new Membre();
>>>   }
>>>   })) {
>>> 
>>>   @Override
>>>   protected void onSubmit() {
>>>   Membre membre;
>>> 
>>>   try {
>>>   membre =
>>> serviceIdentif.identifier(getModelObject().getId(),
>>> getModelObject().getPassword());
>>>   if(membre == null)
>>>   error("Identifiant ou mot de passe incorrect");
>>>   else
>>>   System.out.println("Connexion");
>>>   } catch (Exception e) {
>>>   e.printStackTrace();
>>>   }
>>> 
>>>   }
>>>   };
>>>   loginForm.add(new TextField("membreId"));
>>>   loginForm.add(new PasswordTextField("password"));
>>> 
>>>   add(loginForm);
>>>   }
>>> 
>>> how can I avoid the confirmation message, and how can I prevent the modal
>>> to
>>> disappear whan login failed?
>>> 
>>> thanks.
>>> 
>>> Mathilde
>>> 
>>> --
>>> Mathilde Pellerin  Ingénieur en Génie Logiciel  Tél mobile :
>>> 06.60.78.79.03   E-mail
>>> : mathilde.pelle...@gmail.com   Mon CV en ligne :
>>>  http://www.mathilde-pellerin.fr/
>> Mes
>>> liens :  
>>> 
>>> 
>> 
>> 
>> 
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com 
>> 
> 
> 
> 
> -- 
> Mathilde Pellerin  Ingénieur en Génie Logiciel  Tél mobile :
> 06.60.78.79.03   E-mail
> : mathilde.pelle...@gmail.com   Mon CV en ligne :
>  http://www.mathilde-pellerin.fr/Mes
> liens :  
> 






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



Re: form in modal window

2011-05-25 Thread Mathilde Pellerin
Thanks for answer.

Sorry for the first question : it was not the main problem so I didn't
search the solution.  Now it's fine, the confirmation message disappear.

But the main problem was the second : how can I prevent the modal to
disappear when login failed?

I tried to use ajaxButton instead submit button but then I can't I use the
model of my form like I did with submit button.

Any advice would be great...

this is my actual code (with submit button, no ajax) :

public class ConnexionContentPanel extends FeedbackPanel {
private static final long serialVersionUID = 6952274296991345904L;

@SpringBean
private ServiceIdentification serviceIdentif;

@SuppressWarnings("serial")
public ConnexionContentPanel(String id) {
super(id);

Form loginForm = new Form("loginForm",
new CompoundPropertyModel(new
LoadableDetachableModel() {

@Override
protected Membre load() {
return new Membre();
}
})) {

@Override
protected void onSubmit() {
Membre membre;

membre = serviceIdentif.identifier(getModelObject().getId(),
getModelObject().getPassword());
if(membre == null)
error("Identifiant ou mot de passe incorrect");
else
System.out.println("Connexion");

}
};

loginForm.add(new TextField("membreId"));
loginForm.add(new PasswordTextField("password"));

add(loginForm);
}
}


2011/5/25 Martin Grigorov 

> Translate the message to English and search in Nabble/Google.
> It has been discussed many times.
>
> On Wed, May 25, 2011 at 12:46 PM, Mathilde Pellerin <
> mathilde.pelle...@gmail.com> wrote:
>
> > Hi all,
> >
> > I have a login form in a modal window.
> > I want that an error message appears when login fail, so my panel extends
> > FeedBackPanel.
> > But when I submit the form, an confirmation message appears with this
> > message :
> > "Voulez-vous vraiment quitter cette page ?
> > Reloading this page will cause the modal window to disappear.
> > Appuyer sur OK pour continuer, ou Annuler pour rester sur la page
> > actuelle."
> >
> > and if I click on OK, the modal window disappear even if login failed.
> >
> > this is my code :
> > public ConnexionContentPanel(String id) {
> >super(id);
> >
> >Form loginForm = new Form("loginForm",
> >new CompoundPropertyModel(new
> > LoadableDetachableModel() {
> >
> >@Override
> >protected Membre load() {
> >return new Membre();
> >}
> >})) {
> >
> >@Override
> >protected void onSubmit() {
> >Membre membre;
> >
> >try {
> >membre =
> > serviceIdentif.identifier(getModelObject().getId(),
> > getModelObject().getPassword());
> >if(membre == null)
> >error("Identifiant ou mot de passe incorrect");
> >else
> >System.out.println("Connexion");
> >} catch (Exception e) {
> >e.printStackTrace();
> >}
> >
> >}
> >};
> >loginForm.add(new TextField("membreId"));
> >loginForm.add(new PasswordTextField("password"));
> >
> >add(loginForm);
> >}
> >
> > how can I avoid the confirmation message, and how can I prevent the modal
> > to
> > disappear whan login failed?
> >
> > thanks.
> >
> > Mathilde
> >
> > --
> >  Mathilde Pellerin  Ingénieur en Génie Logiciel  Tél mobile :
> > 06.60.78.79.03   E-mail
> > : mathilde.pelle...@gmail.com   Mon CV en ligne :
> >  http://www.mathilde-pellerin.fr/
>  Mes
> > liens :  
> > 
> >
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com 
>



-- 
 Mathilde Pellerin  Ingénieur en Génie Logiciel  Tél mobile :
06.60.78.79.03   E-mail
: mathilde.pelle...@gmail.com   Mon CV en ligne :
 http://www.mathilde-pellerin.fr/Mes
liens :  



Re: form in modal window

2011-05-25 Thread Martin Grigorov
Translate the message to English and search in Nabble/Google.
It has been discussed many times.

On Wed, May 25, 2011 at 12:46 PM, Mathilde Pellerin <
mathilde.pelle...@gmail.com> wrote:

> Hi all,
>
> I have a login form in a modal window.
> I want that an error message appears when login fail, so my panel extends
> FeedBackPanel.
> But when I submit the form, an confirmation message appears with this
> message :
> "Voulez-vous vraiment quitter cette page ?
> Reloading this page will cause the modal window to disappear.
> Appuyer sur OK pour continuer, ou Annuler pour rester sur la page
> actuelle."
>
> and if I click on OK, the modal window disappear even if login failed.
>
> this is my code :
> public ConnexionContentPanel(String id) {
>super(id);
>
>Form loginForm = new Form("loginForm",
>new CompoundPropertyModel(new
> LoadableDetachableModel() {
>
>@Override
>protected Membre load() {
>return new Membre();
>}
>})) {
>
>@Override
>protected void onSubmit() {
>Membre membre;
>
>try {
>membre =
> serviceIdentif.identifier(getModelObject().getId(),
> getModelObject().getPassword());
>if(membre == null)
>error("Identifiant ou mot de passe incorrect");
>else
>System.out.println("Connexion");
>} catch (Exception e) {
>e.printStackTrace();
>}
>
>}
>};
>loginForm.add(new TextField("membreId"));
>loginForm.add(new PasswordTextField("password"));
>
>add(loginForm);
>}
>
> how can I avoid the confirmation message, and how can I prevent the modal
> to
> disappear whan login failed?
>
> thanks.
>
> Mathilde
>
> --
>  Mathilde Pellerin  Ingénieur en Génie Logiciel  Tél mobile :
> 06.60.78.79.03   E-mail
> : mathilde.pelle...@gmail.com   Mon CV en ligne :
>  http://www.mathilde-pellerin.fr/Mes
> liens :  
> 
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com 


form in modal window

2011-05-25 Thread Mathilde Pellerin
Hi all,

I have a login form in a modal window.
I want that an error message appears when login fail, so my panel extends
FeedBackPanel.
But when I submit the form, an confirmation message appears with this
message :
"Voulez-vous vraiment quitter cette page ?
Reloading this page will cause the modal window to disappear.
Appuyer sur OK pour continuer, ou Annuler pour rester sur la page actuelle."

and if I click on OK, the modal window disappear even if login failed.

this is my code :
public ConnexionContentPanel(String id) {
super(id);

Form loginForm = new Form("loginForm",
new CompoundPropertyModel(new
LoadableDetachableModel() {

@Override
protected Membre load() {
return new Membre();
}
})) {

@Override
protected void onSubmit() {
Membre membre;

try {
membre =
serviceIdentif.identifier(getModelObject().getId(),
getModelObject().getPassword());
if(membre == null)
error("Identifiant ou mot de passe incorrect");
else
System.out.println("Connexion");
} catch (Exception e) {
e.printStackTrace();
}

}
};
loginForm.add(new TextField("membreId"));
loginForm.add(new PasswordTextField("password"));

add(loginForm);
}

how can I avoid the confirmation message, and how can I prevent the modal to
disappear whan login failed?

thanks.

Mathilde

-- 
 Mathilde Pellerin  Ingénieur en Génie Logiciel  Tél mobile :
06.60.78.79.03   E-mail
: mathilde.pelle...@gmail.com   Mon CV en ligne :
 http://www.mathilde-pellerin.fr/Mes
liens :  



Re: If you want to use form in modal window component make sure that you put the modal window itself in another form (nesting forms is legal in Wicket).

2009-08-14 Thread nino martinez wael
I've certainly not done it so.

I think it means that if your form has a modal window in it, form
components in the modal window should be in a form it self so it is
self contained.

2009/8/14 Stefan Lindner :
> Could someone please explain this a little bit more: " If you want to use 
> form in modal window component make sure that you put the modal window itself 
> in another form (nesting forms is legal in Wicket)"
>
> Does it mean HTML
>
>        
>
> and Java
>
>        ModalWindow mw = new ModalWindow("modalWindow");
>        mw.setcontent(newPanelWithFormInside);
>
> is recomended?
>
>
> Stefan
>

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



If you want to use form in modal window component make sure that you put the modal window itself in another form (nesting forms is legal in Wicket).

2009-08-13 Thread Stefan Lindner
Could someone please explain this a little bit more: " If you want to use form 
in modal window component make sure that you put the modal window itself in 
another form (nesting forms is legal in Wicket)"

Does it mean HTML



and Java

ModalWindow mw = new ModalWindow("modalWindow");
mw.setcontent(newPanelWithFormInside);

is recomended?


Stefan