[Petal] Neato Tricks That Aren't Documented Anywhere

Warren Smith wsmith at platinumtel.com
Thu Jan 13 23:34:14 GMT 2005


This reminds me. There's a small bug in the Decode.pm. It needs to have
return undef; as the last line of process. Then you can use it in
petal:attribute statements:

Given {
	myselect => 2,
	options => [
		{ value => 1, label => 'Bob' },
		{ value => 2, label => 'Joe' },
		{ value => 3, label => 'Connor' }
	],
}
	
<select>
  <option petal:repeat="option options" petal:attributes="selected
decode: option myselect 1">
</select>

and the proper value for this select option will have the selected
attribute.



More information about the Petal mailing list