You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by salmas <ss...@ecascabel.com> on 2007/08/29 22:11:57 UTC

wantOnSelectionChangedNotifications causing table redraw

I have a DataTable in which I have a panel which contains a textfield and a
radiogroup. When the user changes the selection in the radiogroup I'd like
to populate a value in the textfield. I subclassesed RadioGroup to catch the
selectionChangedEvent

RadioGroup choice = new RadioGroup(workflowFrame_radioPanel_radioGroup,new
Model()){
	protected void onSelectionChanged(java.lang.Object newSelection) {
            //Figure out what is selected and set value in textfield
	}
			
	 protected boolean wantOnSelectionChangedNotifications() { 
	   return true; 
	} 
};

As soon as I override the wantOnSelectionChangedNotifications method I get
the notifications but the table is redrawn as soon as the user selects an
option in the radiogroup while if I do not override this method the UI does
not do this ugly redraw when the user toggles the selection in the
radiogroup. I am using AJAX to redraw my table in other instances so that
the table redraw is smooth. Is there any way I can catch the selection
changed event and have the table not redraw? I can redraw it myself with an
AJAX target after I set the value in the textfield.

-- 
View this message in context: http://www.nabble.com/wantOnSelectionChangedNotifications-causing-table-redraw-tf4350095.html#a12394832
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: wantOnSelectionChangedNotifications causing table redraw

Posted by Matthijs Wensveen <m....@func.nl>.
Instead of using wantOnSelectionChangedNotifications you could add an 
AjaxEventBehavior or AjaxFormSubmitBehavior on "onchange", depending on 
whether you want the form to be processed or not.
wantOnSelectionChangedNotifications is a bit strange in that it uses 
normal javascript to submit the form the formcomponent is in.

I'd rather have that onSelectionChanged would be called _any_ which way 
the form was submitted, be it javascript (wantOSCN), normal submit or 
ajax. Would this be the same then as onModelChanged?

Matthijs

salmas wrote:
> I have a DataTable in which I have a panel which contains a textfield and a
> radiogroup. When the user changes the selection in the radiogroup I'd like
> to populate a value in the textfield. I subclassesed RadioGroup to catch the
> selectionChangedEvent
>
> RadioGroup choice = new RadioGroup(workflowFrame_radioPanel_radioGroup,new
> Model()){
> 	protected void onSelectionChanged(java.lang.Object newSelection) {
>             //Figure out what is selected and set value in textfield
> 	}
> 			
> 	 protected boolean wantOnSelectionChangedNotifications() { 
> 	   return true; 
> 	} 
> };
>
> As soon as I override the wantOnSelectionChangedNotifications method I get
> the notifications but the table is redrawn as soon as the user selects an
> option in the radiogroup while if I do not override this method the UI does
> not do this ugly redraw when the user toggles the selection in the
> radiogroup. I am using AJAX to redraw my table in other instances so that
> the table redraw is smooth. Is there any way I can catch the selection
> changed event and have the table not redraw? I can redraw it myself with an
> AJAX target after I set the value in the textfield.
>
>   


-- 
Matthijs Wensveen
Func. Internet Integration
W http://www.func.nl
T +31 20 4230000
F +31 20 4223500 


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