[Seaside] How to use PTFactory>>evaluator for select list entry
(beginners question)
Gerhard Obermann
obi068 at gmail.com
Fri Jun 15 20:19:38 UTC 2012
Hi Sabine and welcome!
Try something like:
script prototype element id: 'formB'; update: [:renderer | self
renderSecondListOn: renderer ].
renderSecondListOn: html
html select
id: 'listBID';
list: #('1' '2' '3' '4' '5' '6');
selected: numb
Cheers
Gerhard
On Fri, Jun 15, 2012 at 12:45 PM, Sabine Knöfel <sabine.knoefel at gmail.com>wrote:
> Hello,
>
> I have 2 lists "ListA" and "ListB" and I want to follow "ListB" after
> "ListA".
> This means if I select a value in "listA", "listB" (which is in another
> Form) should update automatically.
>
> I have to use PTFactory>>evaluator, because I want to update more than one
> DOM elememts later.
>
> I succeed in *hiding* ListB after changing selection of ListA.
> But do not know what to send instead of "hide" for updating ListB with
> selection of ListA.
>
> The value to select should be stored in an instance variable "numb". This
> was working, when using "html scriptaculous updater" instead of "prototype
> evaluator". After changing the code to use evaluator, the callback does not
> work anymore.
>
> Cheers
> Sabine
> ###########
> renderListAOn: html
> html
> form: [
> html select
> id: 'listAID';
> list: #('1' '2' '3' '4' '5' '6');
> selected: numb;
> callback: [ :value | self numb: value ];
> onChange:
> (html prototype evaluator
> callback: [ :script |
> script prototype element id:
> 'listBID'. "hide"
> numb inspect ];
> return: false) ]
> ###########
> renderListBOn: html
> html form
> id: 'formB';
> with: [
> html select
> id: 'listBID';
> list: #('1' '2' '3' '4' '5' '6');
> selected: numb ]
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20120615/556f87b7/attachment.htm
More information about the seaside
mailing list