Thanks Sven , it is working now , In the beginning it wasn't working at all but after that I put the ListView and submitLink in a form and then worked. Thanks again..
<form wicket:id="ListForm"> <tr> <td><strong><font size=4>Employer :</font></strong></td> </tr> <tr wicket:id="employersList"> <td><input type="text" wicket:id="companyName" /></td> <td><input type="text" wicket:id="startDate" /></td> <td><input type="text" wicket:id="endDate" /></td> </tr> <tr> <td><a wicket:id="add" href="#">add</a></td> </tr> </form> On Fri, Dec 25, 2009 at 3:00 PM, Sven Meier <s...@meiers.net> wrote: > Hi, > > if you're using a Link, the browser won't send the edited values back to > your application. > Use a SubmitLink instead. > > Sven > > ayman elwany wrote: > >> Hi All , >> I'm new to Apache Wicket , I started working with it from 2 weeks and I'm >> really enjoying it .but I have a little problem that I don't know what is >> the problem with it . >> >> I have a Listview contains three text fields as a table data raw with a >> Link which "onClick" adds a raw to the List view ,and everything works >> fine >> except that the text fields gets cleared whenever I Press the add Link and >> a >> new raw added . here is my Html Mark up >> >> *HTML:* >> <tr wicket:id="employersList"> >> <td><input type="text" wicket:id="companyName" /></td> >> <td><input type="text" wicket:id="startDate" /></td> >> <td><input type="text" wicket:id="endDate" /></td> >> </tr> >> <tr> >> <td><a wicket:id="add" href="#">add</a></td> >> </tr> >> >> *J**ava code:* >> >> >> *public class CarPage extends WebPage {* >> * ...... * >> * .......* >> * ** *private List<Employer> employerList =new >> ArrayList<Employer>(); >> >> public CarPage() { >> >> *........* >> * ........* >> ListView employersListView=getEmployersListView(); >> add(employersListView); >> Link addLink=new Link("add") {...@override >> public void onClick() { >> // TODO Auto-generated method stub >> employerList.add(new Employer()); >> } >> }; >> add(addLink); >> >> } >> >> private ListView getEmployersListView() { >> // TODO Auto-generated method stub >> ListView employersListView=new ListView("employersList",employerList) { >> @Override >> protected void populateItem(ListItem item) { >> // TODO Auto-generated method stub >> Employer employer=(Employer)item.getModelObject(); >> item.add(new TextField<String>("companyName",new >> PropertyModel<String>(employer, "companyName"))); >> item.add(new DateTextField("startDate", >> new PropertyModel<Date>(employer, "startDate"), new StyleDateConverter( >> "S-", true)).add(new DatePicker())); >> >> item.add(new DateTextField("endDate", >> new PropertyModel<Date>(employer, "endDate"), new StyleDateConverter( >> "S-", true)).add(new DatePicker())); >> } >> }; >> return employersListView; >> } >> * .......* >> *.......* >> } >> class Employer implements Serializable{ >> >> String companyName; >> Date startDate, endDate; >> //Setters and getters >> } >> >> >> Thanks in advnce ... >> >> >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >