[Seaside] Re: Jquery select then hide

Hilaire hilaire at drgeo.eu
Mon Apr 27 08:50:34 UTC 2015

Thanks for your tips.

Based on your tips, I have to do it a bit differently as my select list
is built from symbols (#mister, #miss #misses) and Seaside in that case,
only store index number in the option list value attribute:

          <option value="1">Madame</option>
          <option value="2" selected="selected">Mademoiselle</option>
          <option value="3">Monsieur</option>

Therefore the (JSStream on: 'options[selectedIndex].text') sent to the
ajax callback these index number (1 2 or 3) and not my symbol.

However I discover the 'html jQuery ajax serialize:' does two things:
send the jqueried input field value to the server and fire its Seaside
callback, where my symbol are known.

(field := mold at: #civility)
    onChange: [ :aHtml |
        html jQuery ajax
            serialize: html jQuery this;
            script: [ :s |
                field input == #missis
                    ifTrue: [s << (s jQuery: #maiden) show]
                    ifFalse: [s << (s jQuery: #maiden) hide]]

Now it seems to work locally, but stuff is uncoupled and asynchrone:
do I have the risk the script is fired before the serialize is terminated?



Le 27/04/2015 00:57, Bob Arning a écrit :
> This works for me:

Dr. Geo - http://drgeo.eu
iStoa - http://istoa.drgeo.eu

More information about the seaside mailing list