if you call form.process() then all the values of the form are processed and
stored to the model
(if the onselectionchange was done with a hidden form submit)
but only form.clear() should clear all input that was stored as a temp
variable in the form components
and then when you rerender it the real model values are rendered.

johan


On 5/21/07, kubino <[EMAIL PROTECTED]> wrote:


I tried form.clear() also, but it did not do anything. I can see strange
behaviour in my example :

I put process(); in onselectionChanged method.

Now when I start the page, first model is set and selected.

Now, when I update the textfield and click the other radio button, screen
is
refreshed , first model is updated.

But the textfields are not refreshed, and when I change the textfields
again
the first model is updated again.

I cannot understand it, becouse the selectedModel property is updated well
and both textfields have a selectedModel property as nested object model.

Thanks.


Johan Compagner wrote:
>
> you need to clear the input of the fields:  Form.clearInput()
>
>
>
> On 5/19/07, kubino <[EMAIL PROTECTED]> wrote:
>>
>>
>> Yes Igor, i tried, right in this example , I have added
>> getForm().process();
>> , but nothing happend. :-(
>>
>> Kubino
>>
>>
>>
>> igor.vaynberg wrote:
>> >
>> > have you tried:
>> >
>> > onselectionchanged() { form.process(); } ?
>> >
>> > -igor
>> >
>> >
>> > On 5/18/07, kubino <[EMAIL PROTECTED]> wrote:
>> >>
>> >>
>> >> I made a functional code, so everyone can test it. What I want is
>> that,
>> >> when
>> >> I click on radio button to automatically update textfields according
>> to
>> >> their model. I do NOT want to use method
>> textField.setModelValue(String
>> >> d)
>> >> in onSelectionChanged method...
>> >>
>> >> Thanks for help.
>> >>
>> >>
>> >> ///html
>> >>
>> >> <html>
>> >> <head>
>> >> </head>
>> >> <body>
>> >>
>> >> <form wicket:id="myForm">
>> >>
>> >>         <table>
>> >>
>> >>
>> >>
>> >>                         <tr wicket:id="table">
>> >>                                 <td><input type="radio"
>> >> wicket:id="sys_radio" /></td>
>> >>                                 <td wicket:id="sys_name"> </td>
>> >>                                 <td wicket:id="sys_desc"> </td>
>> >>                         </tr>
>> >>
>> >>
>> >>
>> >>         </table>
>> >>
>> >> <input type="text" wicket:id="textFieldName" />
>> >> <input type="text" wicket:id="textFieldDesc" />
>> >>
>> >> </form>
>> >>
>> >> </body>
>> >> </html>
>> >>
>> >>
>> >> // Wicket page
>> >>
>> >>
>> >> import java.io.Serializable;
>> >> import java.util.Arrays;
>> >> import java.util.List;
>> >>
>> >> import wicket.markup.html.basic.Label;
>> >> import wicket.markup.html.form.Form;
>> >> import wicket.markup.html.form.Radio;
>> >> import wicket.markup.html.form.RadioGroup;
>> >> import wicket.markup.html.form.TextField;
>> >> import wicket.markup.html.list.ListItem;
>> >> import wicket.markup.html.list.ListView;
>> >> import wicket.model.PropertyModel;
>> >>
>> >>
>> >> public class TestPage extends WebPage {
>> >>
>> >>
>> >>   private List<SystemM> systems = Arrays.asList(new
>> >> SystemM("aa","aa"),new
>> >> SystemM("bb","bb"),new SystemM("cc","cc"));
>> >>
>> >>
>> >>   private SystemM selectedSystem;
>> >>
>> >>
>> >>   public TestPage() {
>> >>
>> >>     Form myForm = new Form("myForm");
>> >>
>> >>     selectedSystem = systems.get(0);
>> >>
>> >>
>> >>     RadioGroup radioGroup = new RadioGroup("radioGroup",new
>> >> PropertyModel(this,"selectedSystem")) {
>> >>
>> >>
>> >>       @Override
>> >>       protected boolean wantOnSelectionChangedNotifications() {
>> >>         return true;
>> >>       }
>> >>
>> >>       @Override
>> >>       protected void onModelChanging() {
>> >>
>> >>       }
>> >>
>> >>       @Override
>> >>       protected void onSelectionChanged(Object arg0) {
>> >>
>> >>       }
>> >>     };
>> >>
>> >>       ListView table = new ListView("table", systems) {
>> >>
>> >>
>> >>       @Override
>> >>       protected void populateItem(final ListItem item) {
>> >>
>> >>         final SystemM model = (SystemM)item.getModelObject();
>> >>
>> >>           item.add(new Radio("sys_radio",item.getModel()));
>> >>           item.add(new Label("sys_name",model.getName()));
>> >>           item.add(new Label("sys_desc",model.getDesc()));
>> >>
>> >>         }
>> >>     };
>> >>
>> >>
>> >>     TextField nameTextField = new TextField("textFieldName",new
>> >> PropertyModel(selectedSystem,"name"));
>> >>     TextField descTextField = new TextField("textFieldDesc",new
>> >> PropertyModel(selectedSystem,"desc"));
>> >>
>> >>     radioGroup.add(table);
>> >>
>> >>     myForm.add(radioGroup);
>> >>
>> >>     myForm.add(nameTextField);
>> >>     myForm.add(descTextField);
>> >>
>> >>     add(myForm);
>> >>
>> >> }
>> >>
>> >>   public class SystemM implements Serializable{
>> >>
>> >>     private String name;
>> >>     private String desc;
>> >>
>> >>     /**
>> >>      *
>> >>      */
>> >>     public SystemM(String n, String d) {
>> >>
>> >>       this.name = n;
>> >>       this.desc = d;
>> >>
>> >>     }
>> >>
>> >>     public String getName() {
>> >>       return name;
>> >>     }
>> >>     public void setName(String name) {
>> >>       this.name = name;
>> >>     }
>> >>     public String getDesc() {
>> >>       return desc;
>> >>     }
>> >>     public void setDesc(String desc) {
>> >>       this.desc = desc;
>> >>     }
>> >>
>> >>
>> >>
>> >>   }
>> >>
>> >>   public SystemM getSelectedSystem() {
>> >>     return selectedSystem;
>> >>   }
>> >>
>> >>   public void setSelectedSystem(SystemM selectedSystem) {
>> >>     this.selectedSystem = selectedSystem;
>> >>   }
>> >>
>> >>
>> >> }
>> >> --
>> >> View this message in context:
>> >>
>>
http://www.nabble.com/Updating-formComponents-on-round-trip-tf3770603.html#a10677724
>> >> Sent from the Wicket - User mailing list archive at Nabble.com.
>> >>
>> >>
>> >>
>>
-------------------------------------------------------------------------
>> >> This SF.net email is sponsored by DB2 Express
>> >> Download DB2 Express C - the FREE version of DB2 express and take
>> >> control of your XML. No limits. Just data. Click to get it now.
>> >> http://sourceforge.net/powerbar/db2/
>> >> _______________________________________________
>> >> Wicket-user mailing list
>> >> Wicket-user@lists.sourceforge.net
>> >> https://lists.sourceforge.net/lists/listinfo/wicket-user
>> >>
>> >
>> >
>>
-------------------------------------------------------------------------
>> > This SF.net email is sponsored by DB2 Express
>> > Download DB2 Express C - the FREE version of DB2 express and take
>> > control of your XML. No limits. Just data. Click to get it now.
>> > http://sourceforge.net/powerbar/db2/
>> > _______________________________________________
>> > Wicket-user mailing list
>> > Wicket-user@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/wicket-user
>> >
>> >
>>
>> --
>> View this message in context:
>>
http://www.nabble.com/Updating-formComponents-on-round-trip-tf3770603.html#a10700783
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>>
-------------------------------------------------------------------------
>> This SF.net email is sponsored by DB2 Express
>> Download DB2 Express C - the FREE version of DB2 express and take
>> control of your XML. No limits. Just data. Click to get it now.
>> http://sourceforge.net/powerbar/db2/
>> _______________________________________________
>> Wicket-user mailing list
>> Wicket-user@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/wicket-user
>>
>
>
-------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>

--
View this message in context:
http://www.nabble.com/Updating-formComponents-on-round-trip-tf3770603.html#a10726350
Sent from the Wicket - User mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to