<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi guys,<div class=""><br class=""></div><div class="">I would prefer that Seaside is able to do this:</div><div class=""><br class=""></div><div class="">html select</div><div class="">       callback: …;</div><div class="">       with:[ </div><div class="">           myItems do:[:anItem |</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>           html option</div><div class="">       <span class="Apple-tab-span" style="white-space:pre">           </span>        attributeAt: … put: …;</div><div class="">               <span class="Apple-tab-span" style="white-space:pre">             </span>value: anItem ] ]</div><div class=""><br class=""></div><div class="">Right now, you must do it like this (i.e. add a callback for each option):</div><div class=""><br class=""></div><div class=""><div class="">html select</div><div class="">       dispatchCallback;</div><div class="">       with:[ </div><div class="">           myItems do:[:anItem |</div><div class=""><span class="Apple-tab-span" style="white-space: pre;">   </span>           html option</div><div class="">       <span class="Apple-tab-span" style="white-space: pre;">         </span>        attributeAt: … put: …;</div><div class="">                        callback: [ …. ]</div><div class="">               <span class="Apple-tab-span" style="white-space: pre;">              </span>value: anItem ] ]</div></div><div class=""><br class=""></div><div class="">cheers,</div><div class="">Johan   </div><div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">On 3 Jul 2017, at 02:23, Mariano Martinez Peck <<a href="mailto:marianopeck@gmail.com" class="">marianopeck@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_extra"><br class="Apple-interchange-newline"><br class=""><div class="gmail_quote">On Sat, Jul 1, 2017 at 2:24 AM,<span class="Apple-converted-space"> </span><a href="mailto:jtuchel@objektfabrik.de" class="">jtuchel@objektfabrik.de</a><span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:jtuchel@objektfabrik.de" target="_blank" class="">jtuchel@objektfabrik.de</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">Hi,<br class=""><br class=""><br class="">I needed a way to add an attribute of each option in a select list, because Seaside uses the value attribute for its server side callback.<br class=""><br class="">The reason was I wanted to do something on the browser side onChange/onKeyUp based on some business values.<br class=""><br class=""><br class="">Here is what I changed in WASelectTag:<br class=""><br class="">* added inst var: itemConfigBlock with getter and setter<br class=""><br class="">* changed #renderListItemLabelled: to<br class=""><br class=""><br class="">renderListItem: anObject labelled: aString<br class=""><br class="">   <span class="Apple-converted-space"> </span>| option |<br class=""><br class="">   <span class="Apple-converted-space"> </span>option := canvas option.<br class="">   <span class="Apple-converted-space"> </span>self hasCallback ifTrue: [option value: (self valueFor: anObject)].<br class="">   <span class="Apple-converted-space"> </span>titleBlock isNil ifFalse: [option title: (self titleFor: anObject)].<br class="">   <span class="Apple-converted-space"> </span>itemConfigBlock ifNotNil: [:block | block value: option value: anObject].<br class="">   <span class="Apple-converted-space"> </span>option<br class="">       <span class="Apple-converted-space"> </span>selected: (self isSelected: anObject);<br class="">       <span class="Apple-converted-space"> </span>disabled: (self isEnabled: anObject) not;<br class="">       <span class="Apple-converted-space"> </span>with: aString<br class=""><br class=""><br class="">And this is how you can use it:<br class=""><br class=""><br class="">html select<br class=""><br class="">   <span class="Apple-converted-space"> </span>items: MyListOfItems;<br class=""><br class="">   <span class="Apple-converted-space"> </span>callback: [];<br class=""><br class="">   <span class="Apple-converted-space"> </span>itemConfigBlock: [:option :anObject| option attrbibuteAt: 'data-value' put: anObject someValue asString].<br class=""><br class=""><br class="">Was this available already and did I overlook it?<br class=""><br class="">Does this sound reasonable? Worth adding to Seaside?<br class=""><br class=""><br class=""></blockquote><div class=""><br class=""></div><div class="">Yes, I had to do exactly the same. </div><div class=""><br class=""></div><div class=""><br class=""></div></div>--<span class="Apple-converted-space"> </span><br class=""><div class="gmail_signature" data-smartmail="gmail_signature">Mariano<br class=""><a href="http://marianopeck.wordpress.com/" target="_blank" class="">http://marianopeck.wordpress.com</a><br class=""></div></div></div><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">seaside mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:seaside@lists.squeakfoundation.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">seaside@lists.squeakfoundation.org</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a></div></blockquote></div><br class=""></div></body></html>