Discussion:
Form in a modal window in only one class
JavaTraveler
2018-08-30 13:12:38 UTC
Permalink
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-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org
JavaTraveler
2018-08-30 13:28:43 UTC
Permalink
Right sorry.
A wicket modal window.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org
JavaTraveler
2018-08-31 12:47:45 UTC
Permalink
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-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org
Sven Meier
2018-08-31 16:52:59 UTC
Permalink
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
Post by 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-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org
JavaTraveler
2018-09-03 06:22:37 UTC
Permalink
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-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org
Martin Grigorov
2018-09-03 07:24:34 UTC
Permalink
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!
Post by JavaTraveler
Hi!
Sorry, I'm not very clear.
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 ?
--
http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
---------------------------------------------------------------------
JavaTraveler
2018-09-04 07:41:19 UTC
Permalink
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-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org
Martin Grigorov
2018-09-04 12:19:16 UTC
Permalink
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.
Post by JavaTraveler
I see. Thank you. I did that.
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
--
http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
---------------------------------------------------------------------
JavaTraveler
2018-09-05 06:30:27 UTC
Permalink
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-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org

Loading...