Nino Saturnino Martinez Vazquez Wael wrote:

> Hi Currently the gmap contrib just have hardcoded ids, I need to 
> interpolate the generated id's og some of the ajax buttons into the 
> javascript on the html side. How do I do this?

I'm not sure if I'm understanding you correctly, but I use some of the
Wicket Extensions for 1.2.6 and do this in one of my Pages:

add(new JavaScriptReference("appliedScript", getClass(), "AppliedPage.js"));

// The page to which the Applied Page redirects is
// configurable, so configure it.
final HashMap<String, String> hm = new HashMap<String, String>();
hm.put("RANDOM_ACCESS_PAGE", urlFor(RandomAccessPage.class,
null).toString());

// Apply the configuration mentioned above to the JavaScript,
// and put it in the Page.
add(new StringHeaderContributor((new JavaScriptTemplate((new
PackagedTextTemplate(getClass(), "AppliedPage.js",
"text/javascript")).interpolate(hm))).asString()));

In the Javascript, I have ${RANDOM_ACCESS_PAGE} where I want the variable to
be substituted.  Instead of the urlFor call, you can use the String for the
markup ID.
-- 
View this message in context: 
http://www.nabble.com/-GMAP-contrib-1.2.6--Howto-interpolate-markup-id-into-javascript---tf4072717.html#a11581556
Sent from the Wicket - User mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to