Re: [Wicket-user] How to set a markup ID of a HTML element to javascript
Thanks, this work nice On 1/29/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > in 1.x you cannot call getmarkupid() from the constructor, so you have to > use an attribute modifier with imodel to retrieve the id during render time > once all the components have been linked to their parents > > -igor > > > > On 1/28/07, Carfield Yim <[EMAIL PROTECTED]> wrote: > > > > Thanks, just try it today, I have code like: > > > > dateField.setOutputMarkupId(true); > > final String javascript="Calendar.setup({ inputField : > > \""+dateField.getMarkupId()+"\", ifFormat : \"%d-%b-%Y > %H:%M\", button > > : \"trigger\" });"; > > > > However, the ID generated at input field is > > > "main_border_cust_menu_orderSearchForm_startTime_date_textfield" > but > > in the script I get from getMarkupId() is "date_textfield", which, is > > the wicket:id I've specified. > > > > Am I need to do something else to get the generated ID ? > > > > On 1/27/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > > > Component c=... > > > String javascript="calendar blah=new > > > calendar(`"+c.getmarkupid()+"'`);...") > > > > > > new label("script", > > > javascript).setescapemodelstrings(false); > > > > > > > > > is the easiest way for very simple javascript stings > > > > > > there is also PackagedTextTemplate for more complex stings that require > > > variable replacement, as well as CssTemplate and JavasScriptTemplate. > have a > > > look. > > > > > > -igor > > > > > > > > > > > > On 1/26/07, Carfield Yim < [EMAIL PROTECTED]> wrote: > > > > > > > > I found a datetime picket with is more suitable for my application and > > > > I would like to integrate that javascript to my application. > > > > > > > > I can get the markup id using getMarkId() method of Component. However > > > > I don't know how to press it to that javascript. I have talk of look > > > > of > > > > http://www.mail-archive.com/wicket-user@lists.sourceforge.net/msg22608.html > > > > and I wonder can I have similar ${backGroundElementId} at HTML > > > > template instead of js file? > > > > > > > > > > > > - > > > > Take Surveys. Earn Cash. Influence the Future of IT > > > > Join SourceForge.net's Techsay panel and you'll get the chance to > share > > > your > > > > opinions on IT & business topics through brief surveys - and earn cash > > > > > > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > > ___ > > > > Wicket-user mailing list > > > > Wicket-user@lists.sourceforge.net > > > > > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > > > > > > > > > > > > - > > > Take Surveys. Earn Cash. Influence the Future of IT > > > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > > > opinions on IT & business topics through brief surveys - and earn cash > > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > > > > ___ > > > Wicket-user mailing list > > > Wicket-user@lists.sourceforge.net > > > > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > > > > > > > > > > > > - > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > > opinions on IT & business topics through brief surveys - and earn cash > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > ___ > > Wicket-user mailing list > > Wicket-user@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > > > - > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > ___ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] How to set a markup ID of a HTML element to javascript
in 1.x you cannot call getmarkupid() from the constructor, so you have to use an attribute modifier with imodel to retrieve the id during render time once all the components have been linked to their parents -igor On 1/28/07, Carfield Yim <[EMAIL PROTECTED]> wrote: Thanks, just try it today, I have code like: dateField.setOutputMarkupId(true); final String javascript="Calendar.setup({ inputField : \""+dateField.getMarkupId()+"\", ifFormat : \"%d-%b-%Y %H:%M\", button : \"trigger\" });"; However, the ID generated at input field is "main_border_cust_menu_orderSearchForm_startTime_date_textfield" but in the script I get from getMarkupId() is "date_textfield", which, is the wicket:id I've specified. Am I need to do something else to get the generated ID ? On 1/27/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > Component c=... > String javascript="calendar blah=new > calendar(`"+c.getmarkupid()+"'`);...") > > new label("script", > javascript).setescapemodelstrings(false); > > > is the easiest way for very simple javascript stings > > there is also PackagedTextTemplate for more complex stings that require > variable replacement, as well as CssTemplate and JavasScriptTemplate. have a > look. > > -igor > > > > On 1/26/07, Carfield Yim <[EMAIL PROTECTED]> wrote: > > > > I found a datetime picket with is more suitable for my application and > > I would like to integrate that javascript to my application. > > > > I can get the markup id using getMarkId() method of Component. However > > I don't know how to press it to that javascript. I have talk of look > > of > http://www.mail-archive.com/wicket-user@lists.sourceforge.net/msg22608.html > > and I wonder can I have similar ${backGroundElementId} at HTML > > template instead of js file? > > > > > - > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > > opinions on IT & business topics through brief surveys - and earn cash > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > ___ > > Wicket-user mailing list > > Wicket-user@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > > > - > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > ___ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] How to set a markup ID of a HTML element to javascript
Thanks, just try it today, I have code like: dateField.setOutputMarkupId(true); final String javascript="Calendar.setup({ inputField : \""+dateField.getMarkupId()+"\", ifFormat : \"%d-%b-%Y %H:%M\", button : \"trigger\" });"; However, the ID generated at input field is "main_border_cust_menu_orderSearchForm_startTime_date_textfield" but in the script I get from getMarkupId() is "date_textfield", which, is the wicket:id I've specified. Am I need to do something else to get the generated ID ? On 1/27/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > Component c=... > String javascript="calendar blah=new > calendar(`"+c.getmarkupid()+"'`);...") > > new label("script", > javascript).setescapemodelstrings(false); > > > is the easiest way for very simple javascript stings > > there is also PackagedTextTemplate for more complex stings that require > variable replacement, as well as CssTemplate and JavasScriptTemplate. have a > look. > > -igor > > > > On 1/26/07, Carfield Yim <[EMAIL PROTECTED]> wrote: > > > > I found a datetime picket with is more suitable for my application and > > I would like to integrate that javascript to my application. > > > > I can get the markup id using getMarkId() method of Component. However > > I don't know how to press it to that javascript. I have talk of look > > of > http://www.mail-archive.com/wicket-user@lists.sourceforge.net/msg22608.html > > and I wonder can I have similar ${backGroundElementId} at HTML > > template instead of js file? > > > > > - > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > > opinions on IT & business topics through brief surveys - and earn cash > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > ___ > > Wicket-user mailing list > > Wicket-user@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > > > - > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > ___ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > > > - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] How to set a markup ID of a HTML element to javascript
Component c=... String javascript="calendar blah=new calendar(`"+c.getmarkupid()+"'`);...") new label("script", javascript).setescapemodelstrings(false); is the easiest way for very simple javascript stings there is also PackagedTextTemplate for more complex stings that require variable replacement, as well as CssTemplate and JavasScriptTemplate. have a look. -igor On 1/26/07, Carfield Yim <[EMAIL PROTECTED]> wrote: I found a datetime picket with is more suitable for my application and I would like to integrate that javascript to my application. I can get the markup id using getMarkId() method of Component. However I don't know how to press it to that javascript. I have talk of look of http://www.mail-archive.com/wicket-user@lists.sourceforge.net/msg22608.html and I wonder can I have similar ${backGroundElementId} at HTML template instead of js file? - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] How to set a markup ID of a HTML element to javascript
- Original Message From: Carfield Yim <[EMAIL PROTECTED]> To: wicket-user@lists.sourceforge.net Sent: Friday, January 26, 2007 12:01:05 PM Subject: Re: [Wicket-user] How to set a markup ID of a HTML element to javascript > 1) Why don't just just set the markup id in your markup? > > > Then you can access it normally with JavaScript. Wicket will > honour HTML ids set in the HTML template. > Because that component will use mulitple time in same page, if I do so that the ID will be confilct each other Maybe something like: startTimeTextField.add(new SimpleAttributeModifier("id", "timeField"+customIndex)); from java could do the job Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. http://advision.webevents.yahoo.com/mailbeta/features_spam.html- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] How to set a markup ID of a HTML element to javascript
On Fri, 26 Jan 2007, Carfield Yim wrote: > Because that component will use mulitple time in same page, if I do so > that the ID will be confilct each other How do you use the JavaScript component in your own code? Is this an example? >size="15"> > > > If you pass the element id to the JavaScript from your own (JavaScript) code, I think you should be able to do something like this It might be I don't understand the issue correctly though. -- Timo Rantalaiho Reaktor Innovations Oyhttp://www.ri.fi/ > - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] How to set a markup ID of a HTML element to javascript
> 1) Why don't just just set the markup id in your markup? > > > Then you can access it normally with JavaScript. Wicket will > honour HTML ids set in the HTML template. > Because that component will use mulitple time in same page, if I do so that the ID will be confilct each other > 2) I don't think so, but you can certainly use a Wicket > component to output it if you like: > > > > new Label(parent, "timeFieldId", timeField.getMarkupId()); > > or something such. Normally 1) is more straight forward > though. I don't know how to use that. The HTML like But doing that is not ok, as date_textfield will duplication with same component - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] How to set a markup ID of a HTML element to javascript
On Fri, 26 Jan 2007, Carfield Yim wrote: > I found a datetime picket with is more suitable for my application and > I would like to integrate that javascript to my application. > > I can get the markup id using getMarkId() method of Component. However > I don't know how to press it to that javascript. I have talk of look 1) Why don't just just set the markup id in your markup? of http://www.mail-archive.com/wicket-user@lists.sourceforge.net/msg22608.html > and I wonder can I have similar ${backGroundElementId} at HTML > template instead of js file? 2) I don't think so, but you can certainly use a Wicket component to output it if you like: new Label(parent, "timeFieldId", timeField.getMarkupId()); or something such. Normally 1) is more straight forward though. -- Timo Rantalaiho Reaktor Innovations Oyhttp://www.ri.fi/ > - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
[Wicket-user] How to set a markup ID of a HTML element to javascript
I found a datetime picket with is more suitable for my application and I would like to integrate that javascript to my application. I can get the markup id using getMarkId() method of Component. However I don't know how to press it to that javascript. I have talk of look of http://www.mail-archive.com/wicket-user@lists.sourceforge.net/msg22608.html and I wonder can I have similar ${backGroundElementId} at HTML template instead of js file? - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user