Thought I would post back my solution to this problem in case anyone else
needed to do this one day.
I found that I could use the wicket call urlFor to solve my problem.
So I can get the url for the page I want to link to in javascript and then
simply pass that url to the javascript and set it in my link. here is my
code.
PageParameters parameters = new PageParameters();
parameters.put("targetId", targetId);
String url = urlFor(MyPage.class, parameters).toString();
form.add(new AttributeModifier("onsubmit", true, new Model("return
MyJSFunction('"+url+"')")));
This works prefect for what I am wanting to do.
Thanks
T
taygolf wrote:
>
> I have a problem and I have thought of 2 ways to get it done but I can not
> make either work nor am I sure which one is the best.
>
> I want the user to be able to add as many customers as they want.
>
> So I have thought of 2 ways to do this.
>
> 1) I have a link that when clicked creates a popup with all the necessary
> form fields that need to be filled out to create a customer. When the the
> page is submitted I want the information to be stored on the parent page
> in a table. I also want the customer name to be a link so they can edit
> the customer if need be.
>
> I have the popup working and collecting all the data but the only way I
> see to get it to put the data on the parent page is with javascript and I
> can not seem to get the customer name to be a wicket link. so I guess the
> problem with this method is how can I get javascript to create a new
> wicket link on the fly or how can I populate the parent page from the
> onSubmit of the form on the popup page.
>
> 2) I have a link and when that link is clicked it opens a panel with all
> the necessary fields that need to be filled out. For some reason I can not
> get the link to add the panel to the parent page so I am stuck there.
>
> I would prefer option one because I think it looks cleaner. How can I fix
> these issues? am I thinking in the right direction for what I want to do?
> If not what do I need to be looking at?
>
> Thanks
>
> T
>
--
View this message in context:
http://www.nabble.com/link-onClick-add-panel-tp15860001p15988558.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]