When using the HTML <select> tag, the changed "selected" value does not appear in Firefox

Hi (this is a copy of my message on the Seaside mailing list, try stackoverflow first) How do I get the displayed display of a dropdown list to show an updated selection from another session in Firefox? (I am using 3.6.13)

This issue does not appear in Chrome, IE, or Opera.

Here is the scenario: I have a domain object with the attribute displayed in the drop-down list. Some other sessions update the attribute. I am updating my screen, but the rendered selection does not change. Using Firebug, the generated html shows an updated selection. This may be basic knowledge of HTML, but should the displayed value not be updated to show the modified "selected" option? Or a value intended to be set only on the initial screen of the page, and then only on the user's action?

Example. I have a demo Seaside component with a class variable #testStateListSelection, which is selected for "one" in the "Seaside" session. If I change the value to “three” in another Seaside session, the displayed value will remain as “one” in the original session after rendering again, even if the “selected” in the generated HTML shows “three”.


renderSelectionListOn: html
    html form: [
        html select 
            list: #('one' 'two' 'three' 'four' 'five'); 
            selected: self class testStateListSelection; 
            callback: [:value | self class testStateListSelection: value].
        html break.
        html submitButton
            callback: [Transcript cr; show: self class testStateListSelection];
            with: 'Save']

...the displayed value shows 'one', even though the HTML is...

<select name="1">
 <option value="1">one</option>
 <option value="2">two</option>
 <option value="3" selected="selected">three</option>
 <option value="4">four</option>
 <option value="5">five</option>
 </select>

How to get a drop-down selected value to show three?

BTW: everything I know about the behavior of HTML and browsers that I learned from Seaside coding, so I can have a skewed perspective ;-)

Thanks for any help.

+5
source share
4 answers

, , . , Mozillazine

. "", "", - select

+8

, . , -. , :

html form noAutocomplete; with: [ ...
+2

, , self class testStateListSelection.

Actually the code you provide works fine for me. Are you sure accessors are working properly?

testStateListSelection
   ^ testStateListSelection    " <-- forgetting the return is a common problem "

testStateListSelection: aString
   testStateListSelection := aString
+1
source

If you use javascript to refresh the page ...

window.location.reload();

... will NOT re-display the selection items. They will retain their dynamic values ​​no matter what the new HTML source says.

To force selection items to re-display, use ...

window.location.reload(true);
+1
source

All Articles