Re: DropDownChoice selection won't update form fields

2012-02-25 Thread Andrea Del Bene

Well, if it does its job I think it should be ok :)

I got it working, but I'm not sure if the way I did it is correct. Here's the
final code:



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-selection-won-t-update-form-fields-tp4413980p4417640.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




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: DropDownChoice selection won't update form fields

2012-02-24 Thread oggie
I got it working, but I'm not sure if the way I did it is correct. Here's the
final code:



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-selection-won-t-update-form-fields-tp4413980p4417640.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



DropDownChoice selection won't update form fields

2012-02-23 Thread oggie
I have a dropdownchoice populated from a database call. When a user selects
an item from the drop down, I want to load the values of the drop down
object into the form. 

I can't seem to be able to just get the form to reload with the chosen
object. But I can change the form fields individually by setting the model
on each text field. 

If I do : id.setModel(new PropertyModel(chosenConfigType, configTypeId)); 
It works. I was hoping that I wouldn't have to modify the model for each
field.  If I populate the configType field in the beginning (with 9) it
works and is displayed on page load. I would like to avoid this since I'm
going to have other pages with larger forms.

CommonBO is just a business object that has the business rules in it and
makes calls to the DAO objects to get the DTO objects.

The ConfigTypeDTO is just a POJO.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-selection-won-t-update-form-fields-tp4413980p4413980.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: DropDownChoice selection won't update form fields

2012-02-23 Thread oggie
Also, the drop down is not part of the form. Here's the HTML:


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-selection-won-t-update-form-fields-tp4413980p4414035.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: DropDownChoice selection won't update form fields

2012-02-23 Thread Andrea Del Bene

Hi,

you can clean up your page using a CompundPropertyModel for your form 
and a Model for dropDownChoice.  I would make a chain of models passing 
Model to CompoundPropertyModel:


model = new Model(configType);//for dropDownChoice
CompoundPropertyModel cpm = new CompoundPropertyModel(model) //for form

Then change the id of your FormComponents in accordance with the name of 
the field they should read/write. In this way you don't need the code 
inside onUpdate, just leave 'target.add(form);'



Also, the drop down is not part of the form. Here's the HTML:


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-selection-won-t-update-form-fields-tp4413980p4414035.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




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: DropDownChoice selection won't update form fields

2012-02-23 Thread oggie
That worked. Thanks!

The only downside is that the wicket plugin for netbeans is throwing a bunch
of errors at me due to the way it's now set up. 

It's saying that everything I add to the form is a child in Java and not in
HTML.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-selection-won-t-update-form-fields-tp4413980p4414600.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: DropDownChoice selection won't update form fields

2012-02-23 Thread oggie
I jumped the gun on that one. It didn't work. 

I was still calling the old page from my menu. Once I fixed that and I am
now calling a new page with your suggestions, the form objects never get
updated. Here's the code:


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-selection-won-t-update-form-fields-tp4413980p4414709.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: DropDownChoice selection won't update form fields

2012-02-23 Thread Andrea Del Bene
Maybe the problem is with resetButton. The code inside onSubmit breaks 
the model chain. If you want to reset form's field try just with


form.setModelObject(new ConfigTypeDTO());

I jumped the gun on that one. It didn't work.

I was still calling the old page from my menu. Once I fixed that and I am
now calling a new page with your suggestions, the form objects never get
updated. Here's the code:


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-selection-won-t-update-form-fields-tp4413980p4414709.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




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: DropDownChoice selection won't update form fields

2012-02-23 Thread oggie
Once again, you make it simpler than I thought it would be. Thanks again. 

Finally, how do I reset the form from the onSubmit button of the form? I
tried this:


But it doesn't work. The form never gets reset. I'm able to get the updated
list from the DB and repopulate the list. And the list is updated on the
page. But the form isn't.


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-selection-won-t-update-form-fields-tp4413980p4415082.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: DropDownChoice selection won't update form fields

2012-02-23 Thread Andrea Del Bene

This is strange. Can you post the code of the full page?

Once again, you make it simpler than I thought it would be. Thanks again.

Finally, how do I reset the form from the onSubmit button of the form? I
tried this:


But it doesn't work. The form never gets reset. I'm able to get the updated
list from the DB and repopulate the list. And the list is updated on the
page. But the form isn't.


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-selection-won-t-update-form-fields-tp4413980p4415082.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




-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org