You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by jammyjohn <jc...@yahoo.com> on 2010/06/16 01:42:54 UTC
How to create a Popup Button
Could anybody suggest how to create a popup button. I read in the forum that
a link can be attached to a button. But it did not help me.
Not sure, where is the mistake in the below code.
html code
--------------
//having a link id inside a button..
<input type="button" wicket:id="mawbNotes" value='Mawb Notes' /> #
java code.
-----------
PopupSettings popupSettings = new PopupSettings(PopupSettings.LOCATION_BAR |
PopupSettings.RESIZABLE |
PopupSettings.SCROLLBARS).setHeight(300).setWidth(730).setTop(300).setLeft(180);
//Link
Link notesLink = new Link("notesLink") {
@Override
public void onClick() {
}
};
notesLink.setPopupSettings(popupSettings);
//Button
Button mawbNotes = new Button("mawbNotes") {
@Override
public void onSubmit() {
setResponsePage(getPage())
}
};
//adding link to a button
mawbNotes.add(notesLink);
//adding button to the from
mawbForm.add(mawbNotes.setDefaultFormProcessing(false));
The above code does not pop up.. rather opens the page in the same window.
Thanks in advance for your help.
Jamuna.
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-create-a-Popup-Button-tp2256714p2256714.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How to create a Popup Button
Posted by Jeremy Thomerson <je...@wickettraining.com>.
On Tue, Jun 15, 2010 at 6:42 PM, jammyjohn <jc...@yahoo.com> wrote:
>
> Could anybody suggest how to create a popup button. I read in the forum
> that
> a link can be attached to a button. But it did not help me.
>
> Not sure, where is the mistake in the below code.
>
> html code
> --------------
> //having a link id inside a button..
>
> <input type="button" wicket:id="mawbNotes" value='Mawb Notes' /> #
>
> java code.
> -----------
>
> PopupSettings popupSettings = new PopupSettings(PopupSettings.LOCATION_BAR
> |
> PopupSettings.RESIZABLE |
>
> PopupSettings.SCROLLBARS).setHeight(300).setWidth(730).setTop(300).setLeft(180);
>
> //Link
> Link notesLink = new Link("notesLink") {
> @Override
> public void onClick() {
>
> }
> };
>
> notesLink.setPopupSettings(popupSettings);
>
> //Button
> Button mawbNotes = new Button("mawbNotes") {
> @Override
> public void onSubmit() {
> setResponsePage(getPage())
> }
> };
>
>
> //adding link to a button
> mawbNotes.add(notesLink);
>
> //adding button to the from
> mawbForm.add(mawbNotes.setDefaultFormProcessing(false));
>
>
> The above code does not pop up.. rather opens the page in the same window.
>
> Thanks in advance for your help.
>
> Jamuna.
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/How-to-create-a-Popup-Button-tp2256714p2256714.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Your code works fine for me:
<input type="button" value="button" wicket:id="link" />
PopupSettings popupSettings = new PopupSettings(PopupSettings.LOCATION_BAR |
PopupSettings.RESIZABLE | PopupSettings.SCROLLBARS).setHeight(
300).setWidth(730).setTop(300).setLeft(180);
Link link = new Link("link") {
@Override
public void onClick() {
System.out.println("clicked");
setResponsePage(HomePage.class);
}
};
link.setPopupSettings(popupSettings);
add(link);
--
Jeremy Thomerson
http://www.wickettraining.com
Re: How to create a Popup Button
Posted by James Carman <ja...@carmanconsulting.com>.
Try <button wicket:id="mawbNotes">Mawb Notes</button>
On Tue, Jun 15, 2010 at 7:42 PM, jammyjohn <jc...@yahoo.com> wrote:
>
> Could anybody suggest how to create a popup button. I read in the forum that
> a link can be attached to a button. But it did not help me.
>
> Not sure, where is the mistake in the below code.
>
> html code
> --------------
> //having a link id inside a button..
>
> <input type="button" wicket:id="mawbNotes" value='Mawb Notes' /> #
>
> java code.
> -----------
>
> PopupSettings popupSettings = new PopupSettings(PopupSettings.LOCATION_BAR |
> PopupSettings.RESIZABLE |
> PopupSettings.SCROLLBARS).setHeight(300).setWidth(730).setTop(300).setLeft(180);
>
> //Link
> Link notesLink = new Link("notesLink") {
> @Override
> public void onClick() {
>
> }
> };
>
> notesLink.setPopupSettings(popupSettings);
>
> //Button
> Button mawbNotes = new Button("mawbNotes") {
> @Override
> public void onSubmit() {
> setResponsePage(getPage())
> }
> };
>
>
> //adding link to a button
> mawbNotes.add(notesLink);
>
> //adding button to the from
> mawbForm.add(mawbNotes.setDefaultFormProcessing(false));
>
>
> The above code does not pop up.. rather opens the page in the same window.
>
> Thanks in advance for your help.
>
> Jamuna.
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-create-a-Popup-Button-tp2256714p2256714.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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