[Seaside] Update select display when selection changed
bobn at rogers.com
Mon Jan 31 13:07:24 UTC 2011
How do I get the rendered display of a drop-down select list to show an
updated selection from another session?
Here is the scenario: I have a domain object with an attribute displayed in
a drop-down list. Some other session updates the attribute. I refresh my
display, but the rendered selection does not change. Using Firebug, the
generated html shows the updated selection. This may be basic HTML
knowledge, but should the displayed value not update to show the changed
'selected' option? Or is the value intended to be set only on the initial
page display and then only by a user action?
Here is an example. I have a demo Seaside component with a class variable
#testStateListSelection which is selected to 'one' in a Seaside session. If
I change the value to 'three' in another Seaside session, the displayed
value stays as 'one' in the original session after rendering again, even
though the "selected" in the generated HTML shows "three".
html form: [
list: #('one' 'two' 'three' 'four' 'five');
selected: self class testStateListSelection;
callback: [:value | self class testStateListSelection: value].
callback: [Transcript cr; show: self class testStateListSelection];
...the displayed value shows 'one', even though the HTML is...
<option value="3" selected="selected">three</option>
How do I get the drop-down selected value to show 'three'?
BTW: all I know about HTML & browser behaviour I've learned from coding
Seaside, so I may have a skewed perspective ;-)
Thanks for any help,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the seaside