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/08/30 13:12:38 UTC

Form in a modal window in only one class

Hello everyone,

I wanted to add a modal window with a form inside it on a page.
But I'd like to do it in juste one class. Describe the modal window and then
call it in one class.

I can do it with two classes, but I'm not satsfied by this solution.

Is there any way ?

Thanks in advance. And have a good day :)

--
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
>
>

Re: Form in a modal window in only one class

Posted by JavaTraveler <me...@gmail.com>.
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 Sven Meier <sv...@meiers.net>.
Hi,

I'm afraid I didn't understand what count of classes you want to minimize.

Perhaps you want to collect inputs without a matching data class?
You can use a CompoundPropertyModel with a backing map for that.

Let us know more details.

Have fun
Sven


Am 31.08.2018 um 14:47 schrieb JavaTraveler:
> Well, or does anyone know how to retrieve the data from the inputs of a panel
> ?
>
> --
> 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
>


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


Re: AW: Form in a modal window in only one class

Posted by JavaTraveler <me...@gmail.com>.
Well, or does anyone know how to retrieve the data from the inputs of a panel
?

--
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: AW: Form in a modal window in only one class

Posted by JavaTraveler <me...@gmail.com>.
Right sorry.
A wicket modal window.

--
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