Re: anchor tag for a dynamic text
Yes, more or less on this line only. But not exactly like this as the link's position in the text would depend on the message and the message would be fetched from the properties file, so its going to be dynamic. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/anchor-tag-for-a-dynamic-text-tp4670190p4670211.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: anchor tag for a dynamic text
Hi, I am still not sure that I understand you but here is my take: you need something like: prefixLabel = new Label("prefix", "Hey!!!"); link = new Link(...) {...}.setBody(Model.of(" Click Here ")); suffixLabel = new Label("suffix", "now"); someParent.add(prefixLabel, link, suffixLabel); On Tue, Apr 7, 2015 at 1:30 PM, avchavan wrote: > Hi Martin, > > String someTextMessage = "Hey!!! Click Here now."; > Lable message = new Lable("messageLable", someTextMessage); > message.setEscapeModelStrings(true); > Link printLink = new Link("printLink") { > @Override > public void onClick() { >System.out.println("inside onClick"); > } > }; > this.add(printLink); > this.add(message); > > What i want is to have a link inside the text message that i would like to > display. > And the error message can change based on different conditions. > So i could have two messages, one given above and another one where i would > have another text with Link. > > I hope i am more clear now. > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/anchor-tag-for-a-dynamic-text-tp4670190p4670201.html > Sent from the Users forum mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: anchor tag for a dynamic text
Hi Martin, String someTextMessage = "Hey!!! Click Here now."; Lable message = new Lable("messageLable", someTextMessage); message.setEscapeModelStrings(true); Link printLink = new Link("printLink") { @Override public void onClick() { System.out.println("inside onClick"); } }; this.add(printLink); this.add(message); What i want is to have a link inside the text message that i would like to display. And the error message can change based on different conditions. So i could have two messages, one given above and another one where i would have another text with Link. I hope i am more clear now. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/anchor-tag-for-a-dynamic-text-tp4670190p4670201.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: anchor tag for a dynamic text
Hi, Sorry but your question is not very clear. Please try to explain the problem again and give us exact copy of your code. "Click here" text could not be generated from the code snippet you have provided. Martin Grigorov Freelancer, available for hire! Wicket Training and Consulting https://twitter.com/mtgrigorov On Tue, Apr 7, 2015 at 12:39 PM, avchavan wrote: > Actual text message is something like this: > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/anchor-tag-for-a-dynamic-text-tp4670190p4670199.html > Sent from the Users forum mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: anchor tag for a dynamic text
Actual text message is something like this: -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/anchor-tag-for-a-dynamic-text-tp4670190p4670199.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: anchor tag for a dynamic text
i did something like this: Message in the properties file --> 123= Here's the link!! //get message from properties file String someTextMessage = getMessage(123); Lable message = new Lable("messageLable", someTextMessage); message.setEscapeModelStrings(true); Link printLink = new Link("printLink") { @Override public void onClick() { System.out.println("inside onClick"); } }; this.add(printLink); -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/anchor-tag-for-a-dynamic-text-tp4670190p4670196.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: anchor tag for a dynamic text
Hi, You need a Link component that is a parent of a Label component. The Label should use a IModel that produces dynamic String for each render of the Label. Show us some code so we can tell you what is wrong in your version. Martin Grigorov Freelancer, available for hire! Wicket Training and Consulting https://twitter.com/mtgrigorov On Tue, Apr 7, 2015 at 8:06 AM, avchavan wrote: > Hi, i would like to know if its possible to have a clickable link for a > dynamic text. > > I have tried by using the anchor tag with some wicket id and adding an > onclick behavior to it, i could see the text with link on my screen but the > onclick call of t he link was never triggered. > What could possibly be the issue? > > i did something like this: > Message in the properties file --> 123= Here's the link!! > i used this wicket id and added it to the page and attached an onclick > behavior to this. > I have checked t he firebug console but there was no onclick call made for > the link's click. > > Thanks. > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/anchor-tag-for-a-dynamic-text-tp4670190.html > Sent from the Users forum mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
anchor tag for a dynamic text
Hi, i would like to know if its possible to have a clickable link for a dynamic text. I have tried by using the anchor tag with some wicket id and adding an onclick behavior to it, i could see the text with link on my screen but the onclick call of t he link was never triggered. What could possibly be the issue? i did something like this: Message in the properties file --> 123= Here's the link!! i used this wicket id and added it to the page and attached an onclick behavior to this. I have checked t he firebug console but there was no onclick call made for the link's click. Thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/anchor-tag-for-a-dynamic-text-tp4670190.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org