Re: Dataview help
https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/markup/html/link/AbstractLink.java#L124 Try harder ;-) I write the code in my mail client, so it may have errors. Use your IDE to fix them! Martin Grigorov Wicket Training and Consulting On Fri, Jun 13, 2014 at 4:59 PM, kumar ramanathan wrote: > Hi Martin,I have used the link code as you have suggested as below and > getting the error at setBody(Model.of(person.getId()))* The method > setBody(Model) is undefined for the type new Link(){} *.Code > used:repeatingView.add(new Link(repeatingView.newChildId()) { > public void onClick() { setResponsePage(new Output()); > } }.setBody(Model.of(person.getId(;item.add(repeatingView);So i > have altered the code as below ,removed the .setbody part. But inoutput am > unable to get the link in Id column ofoutput.code > altered:repeatingView.add(new Link(repeatingView.newChildId()) { > public void onClick() { setResponsePage(new Output()); > } });item.add(repeatingView);O/p Got:Name IdSamRamNo values displayed > in id column as above. Please help me. > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Dataview-help-tp4666151p4666255.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: Dataview help
Hi Martin,I have used the link code as you have suggested as below and getting the error at setBody(Model.of(person.getId()))* The method setBody(Model) is undefined for the type new Link(){} *.Code used:repeatingView.add(new Link(repeatingView.newChildId()) { public void onClick() { setResponsePage(new Output()); } }.setBody(Model.of(person.getId(;item.add(repeatingView);So i have altered the code as below ,removed the .setbody part. But inoutput am unable to get the link in Id column ofoutput.code altered:repeatingView.add(new Link(repeatingView.newChildId()) { public void onClick() { setResponsePage(new Output()); } });item.add(repeatingView);O/p Got:Name IdSamRamNo values displayed in id column as above. Please help me. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dataview-help-tp4666151p4666255.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: Dataview help
et-examples/index.html > > > > Direct link: > > http://www.wicket-library.com/wicket-examples/repeater/ > > > > They are also explained in the Wicket Free Guide at: > > http://wicket.apache.org/guide/guide/single.html#repeaters > > > > Let us know if you have a more specific question. > > > > > > On Fri, Jun 6, 2014 at 9:29 AM, kumar ramanathan < > kumarramana...@gmail.com> > > wrote: > > > >> Hi Friends, > >> I am new beginner of wicket and trying to implement the table as below > >> using > >> data view. > >> > >> name id > >> sam 21(link) > >> ram 16(link) > >> > >> once i click the id it show the sam/ram details in next page. I have > >> tried > >> many ways to implement it using simple data view , but not able to do. > >> Hoping you for help on this. > >> I have tried cwiki examples, wicket library examples but those are very > >> long > >> to understand.Can you please share a simple project similar to my > >> requirement above. Please help me, am struggling for nearly three months > >> on > >> this. > >> > >> Thanks, > >> Kumar > >> > >> -- > >> View this message in context: > >> http://apache-wicket.1842946.n4.nabble.com/Dataview-help-tp4666151.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 > >> > >> > > > > > > - > > ~ Thank you, > > p...@bors.ws > > ___ > > If you reply to this email, your message will be added to the discussion > > below: > > > http://apache-wicket.1842946.n4.nabble.com/Dataview-help-tp4666151p4666157.html > > > > To unsubscribe from Dataview help, visit > > > http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4666151&code=a3VtYXJyYW1hbmF0aGFAZ21haWwuY29tfDQ2NjYxNTF8LTQ2Njc1NzExMg== > > > -- > with regards, > Kumar R M > Save the Earth.She will take care of you > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Dataview-help-tp4666151p4666161.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: Dataview help
Hi Paul, Thanks So much i have succesfully displayed the data in table using repeating view.The code is shown below. HelloWorldApplication.java package com.lnn.app; import org.apache.wicket.Page; import org.apache.wicket.protocol.http.WebApplication; import com.lnn.page.HelloWorld; public class HelloWorldApplication extends WebApplication { @Override public Class getHomePage() { // TODO Auto-generated method stub return HelloWorld.class; } } HelloWorld.java package com.lnn.page; import java.util.ArrayList; import java.util.List; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.repeater.data.DataView; import java.io.Serializable; import java.util.ArrayList; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.link.Link; import org.apache.wicket.markup.html.navigation.paging.PagingNavigator; import org.apache.wicket.markup.repeater.Item; import org.apache.wicket.markup.repeater.RepeatingView; import org.apache.wicket.markup.repeater.data.DataView; import org.apache.wicket.markup.repeater.data.ListDataProvider; import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; public class HelloWorld extends WebPage { public HelloWorld(){ List list = new ArrayList(); list.add(new Persons("sam","one")); list.add(new Persons("ram","two")); ListDataProvider listDataProvider = new ListDataProvider(list); DataView dataView = new DataView("rows", listDataProvider){ protected void populateItem(Item item){ Persons person = item.getModelObject(); RepeatingView repeatingView = new RepeatingView("dataRow"); repeatingView.add(new Label(repeatingView.newChildId(), person.getName())); repeatingView.add(new Label( repeatingView.newChildId(),person.getId())); item.add(repeatingView); } }; add(dataView);}} HelloWorld.html http://www.w3.org/1999/xhtml"; xmlns:wicket="http://wicket.apache.org";> NameId Persons.java package com.lnn.page; import java.io.Serializable; public class Persons implements Serializable{ String name; String id; public Persons(String name,String id){ this.name=name;this.id=id; } public void setId(String id){ this.id=id; } public String getId(){ return this.id; } public void setName(String name){ this.name=name; } public String getName(){ return this.name; } } O/P: Name Id sam one ram two In the above i have displayed the id a s lable. I want ot show it as link using the following change in the code of helloworld.java public class HelloWorld extends WebPage { public HelloWorld(){ List list = new ArrayList(); list.add(new Persons("sam","one")); list.add(new Persons("ram","two")); ListDataProvider listDataProvider = new ListDataProvider(list); DataView dataView = new DataView("rows", listDataProvider){ protected void populateItem(Item item){ Persons person = item.getModelObject(); RepeatingView repeatingView = new RepeatingView("dataRow"); repeatingView.add(new Label(repeatingView.newChildId(), person.getName())); repeatingView.add(new Label( repeatingView.newChildId(),person.getId()){ public void onClick(){ setResponsePage(Output.class); } }); item.add(repeatingView); } }; add(dataView);}} no link/data in the Id column displayed. Please help.How toget the link over there. O/P: Name Id Sam Ram Thanks, Kumar On 6/9/14, Paul Bors [via Apache Wicket] wrote: > > > Have you tried one of the Repeaters from: > http://www.wicket-library.com/wicket-examples/index.html > > Direct link: > http://www.wicket-library.com/wicket-examples/repeater/ > > They are also explained in the Wicket Free Guide at: > http://wicket.apache.org/guide/guide/single.html#repeaters > > Let us know if you have a more specific question. > > > On Fri, Jun 6, 2014 at 9:29 AM, kumar ramanathan > wrote: > >> Hi Friends, >> I am new beginner of wicket and trying to implement the table as below >> using >> data view. >> >> name id >> sam 21(link) >> ram 16(link) >> >> once i click the id it show the sam/ram details in next page. I have >> tried >> many ways to implement it using simple data view , but not able to do. >> Hoping you for help on this. >> I have tried cwiki examples, wicket library examples but those are very >> long >> to understand.Can you please share a simple project similar to my >>
Re: Dataview help
Have you tried one of the Repeaters from: http://www.wicket-library.com/wicket-examples/index.html Direct link: http://www.wicket-library.com/wicket-examples/repeater/ They are also explained in the Wicket Free Guide at: http://wicket.apache.org/guide/guide/single.html#repeaters Let us know if you have a more specific question. On Fri, Jun 6, 2014 at 9:29 AM, kumar ramanathan wrote: > Hi Friends, > I am new beginner of wicket and trying to implement the table as below > using > data view. > > name id > sam 21(link) > ram 16(link) > > once i click the id it show the sam/ram details in next page. I have tried > many ways to implement it using simple data view , but not able to do. > Hoping you for help on this. > I have tried cwiki examples, wicket library examples but those are very > long > to understand.Can you please share a simple project similar to my > requirement above. Please help me, am struggling for nearly three months on > this. > > Thanks, > Kumar > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Dataview-help-tp4666151.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 > >
Dataview help
Hi Friends, I am new beginner of wicket and trying to implement the table as below using data view. name id sam 21(link) ram 16(link) once i click the id it show the sam/ram details in next page. I have tried many ways to implement it using simple data view , but not able to do. Hoping you for help on this. I have tried cwiki examples, wicket library examples but those are very long to understand.Can you please share a simple project similar to my requirement above. Please help me, am struggling for nearly three months on this. Thanks, Kumar -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dataview-help-tp4666151.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