You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by JavaTraveler <me...@gmail.com> on 2018/09/03 06:22:37 UTC

Re: Form in a modal window in only one class

Hi!
Sorry, I'm not very clear.

What I wish to do :
a page with a button that opens a pop up window. In this pop up window, i
would like to have a form. The informations in this form (from the pop up)
will have to go back to the original page to be treated.

So I'm looking for the most efficient way to do that.
Do you have any idea ?

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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


Re: Form in a modal window in only one class

Posted by JavaTraveler <me...@gmail.com>.
So I think I managed to do it, by passing as a parameter of the panel's
constructor the object taking the data.

Thank you every one :)

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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


Re: Form in a modal window in only one class

Posted by Martin Grigorov <mg...@apache.org>.
The data is in the form's model.

I guess the easiest way to pass it to the rest of the Page is by using
Wicket events:
in YourModalWindowForm#onSubmit(AjaxRequestTarget) do:

MyDomainObject pojo = getModelObject();
send(getPage(). Broadcast.DEPTH, new YourSpecialEventPayload(target, pojo));

This way the Page itself and any component in it will be notified at
Component#onEvent(IEvent).
Check
https://ci.apache.org/projects/wicket/guide/7.x/single.html#_wicket_events_infrastructure
for more.

On Tue, Sep 4, 2018 at 10:41 AM JavaTraveler <me...@gmail.com> wrote:

> I see. Thank you. I did that.
> But as I understand it, the content of my modalWindow is another page :
>                   modalWindow.setContent(new
> AjouterArticle(modalWindow.getContentId());
>
> But then how do I get the data from this modal window ?
> I'm sorry if my questions are stupid. But I don't understand.
>
> Thank you in advance
>
> --
> Sent from:
> http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Form in a modal window in only one class

Posted by JavaTraveler <me...@gmail.com>.
I see. Thank you. I did that.
But as I understand it, the content of my modalWindow is another page :
                  modalWindow.setContent(new
AjouterArticle(modalWindow.getContentId());

But then how do I get the data from this modal window ?
I'm sorry if my questions are stupid. But I don't understand.

Thank you in advance

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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


Re: Form in a modal window in only one class

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

Use a modal window that is backed by a Panel.
Wicket-Extensions ModalWindow, Wicket-Bootstrap's Modal and
Wicket-JQuery-UI Dialog work this way.

A (modal) dialog is just a <div> in the page that is positioned on top of
the other HTML elements via CSS.

Wicket-extensions' ModalWindow can also be backed by a Page (see
PageCreator). In this case it uses <iframe>. Avoid it!

On Mon, Sep 3, 2018 at 9:22 AM JavaTraveler <me...@gmail.com> wrote:

> Hi!
> Sorry, I'm not very clear.
>
> What I wish to do :
> a page with a button that opens a pop up window. In this pop up window, i
> would like to have a form. The informations in this form (from the pop up)
> will have to go back to the original page to be treated.
>
> So I'm looking for the most efficient way to do that.
> Do you have any idea ?
>
> --
> Sent from:
> http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>