I'm not sure, but give it a try: In the onClick, set the property address2 to be the same as property address1. Add myAddress2 to the target.
If you use compoundpropertymodel, it should work. Eyal Golan egola...@gmail.com Visit: http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74 P Save a tree. Please don't print this e-mail unless it's really necessary On Mon, Jun 1, 2009 at 12:55 AM, hill180 <hill...@gmail.com> wrote: > I have looked through the archives and there were a couple references to > this question but no examples and I was hoping for some help. > > I have a form with Address One and Address Two, > > I have a link that I just want to copy the data over. I am thinking it > should use Javascript, but I am new to wicket and not sure how to implement. > > The textfields are a compound property model which is hitting a hibernate > POJO. > > > private static class AddressPanel extends Panel > { > > public AddressPanel(String id, Form f,final AssociateDB a) > { > super(id); > final TextField myAddress1 = new TextField("Address1"); // > First Address > add(myAddress1); > final TextField myAddress2 = new TextField("Address2"); // > First Address > myAddress2.setOutputMarkupId(true); > add(myAddress2); > > > Link link = new Link("copyAddress"){ > @Override > //TODO ADD JAVASCRIPT COPY, FAILS TO SAVE BEFORE COPY OF DATA > public void onClick() { > > } > > }; > > > > add(link); > } > > }; > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >