Re: [Wicket-user] Wicket newbie - Duplicate code - what am I doing wrong?
we don't support scripting in html. That is not the way we want to work.What you can use is maybe a IComponentResolver where you add youre labels on the java code dynamicaly when you encouter component in the html that isn't specified in java. johanOn 3/8/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Dear Wicket,I've just started to look at Wicket so I apologize if this is a complete newbie question. I've searched the docs but haven't found an answer tomy question, so I was hoping you could help.Briefly, I have a List of POJOs which I want to display. Do I reallyhave to do this? (In Java code)add(new ListView(users, view.getUsers()) {public void populateItem(final ListItem p_item) {final User user = (User) p_item.getModelObject(); p_item.add(new Label(username, user.getUsername()));p_item.add(new Label(password, user.getPassword()));}});(In HTML template) tr wicket:id=userstdspan wicket:id=username/span/tdtdspan wicket:id=password/span/td /trEvery time I add a property to my User POJO, I have to add a line ofcode in the Java code *and* in the HTML template. This violates the DRYprinciple in my book.Isn't there a way to bind a POJO directly and then access its properties in the HTML template in a OGNL/FreeMarker/etc. type of way?Many thanks for your help!Fred--[EMAIL PROTECTED]--- This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcastand join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642___ Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] Wicket newbie - Duplicate code - what am I doing wrong?
i dont think this violates anything. one defines data model, the other defines presentation. true these have to be in sync. just like xml schema and xslt have to be in sync, etc.-Igor On 3/8/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Dear Wicket,I've just started to look at Wicket so I apologize if this is a completenewbie question. I've searched the docs but haven't found an answer tomy question, so I was hoping you could help. Briefly, I have a List of POJOs which I want to display. Do I reallyhave to do this?(In Java code)add(new ListView(users, view.getUsers()) {public void populateItem(final ListItem p_item) { final User user = (User) p_item.getModelObject();p_item.add(new Label(username, user.getUsername()));p_item.add(new Label(password, user.getPassword ()));}});(In HTML template)tr wicket:id=userstdspan wicket:id=username/span/tdtdspan wicket:id=password/span/td /trEvery time I add a property to my User POJO, I have to add a line ofcode in the Java code *and* in the HTML template. This violates the DRYprinciple in my book.Isn't there a way to bind a POJO directly and then access its properties in the HTML template in a OGNL/FreeMarker/etc. type of way?Many thanks for your help!Fred--[EMAIL PROTECTED]--- This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcastand join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642___ Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user