java - Replace text inside Wicket AjaxLink -


i have created new ajaxlink in .java file

add(new ajaxlink("link"){                                                                                                                                                                                                                                                                                                   private static final long serialversionuid = 1l;                                                                                                         @override                                                                                                                                               public void onclick(ajaxrequesttarget target) {                                                                                                         target.appendjavascript("window.open('http://www.cnn.com/2011/world/africa/02/23/libya.protests/index.html?hpt="+t1+"')");               }                                                                                                                                                       }); 

and added .html file

<a href="#" wicket:id="link">text replace</a>  

the url example t1 dynamic , .java file. "text replace" equal t1 string don't know how this. have tried creating label , adding

<a href="#" wicket:id="link"><span wicket:id="linklbl"></span></a>  

but gives error.

any suggestions?

thanks

the label right direction, have make sure add label in java code well, should child component of ajax link.

(on sidenote: might want consider using <wicket:container> instead of <span>. in case doesn't matter much, there cases <span> tag make html invalid.)


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -