In regards to your "color" example, the reason you're getting an error is likely due to missing required parameter. If you look at component reference for Select, you'll see that besides "model", another required parameter is "value". The example on the website is somewhat flawed because it is incomplete as it doesn't include value parameter and thus it mislead you. Try this:
<t:select t:id="color" model="literal:FF0000=Red,00FF00=Green,0000FF=Blue" t:value="literal:FF0000"/> Now, the value above is a very naive implementation which always selects color red. Almost certainly you want a property in your page which manages this value, so your example more realistically would be: <t:select t:id="color" model="literal:FF0000=Red,00FF00=Green,0000FF=Blue" t:value="selectedColor"/> and in your page class you'd have @Property private String _selectedColor; Now, when form with dropdown is submitted, your _selectColor member will have a value you selected and submitted. Anyway, the example on Tapestry website should probably be enhanced to mention value parameter. In regards to your question #2, above explanation of _selectedColor property should give you the answer. -adam On Wed, Apr 2, 2008 at 7:12 AM, Tomasz Dziurko <[EMAIL PROTECTED]> wrote: > Hi. > > Currently I am working on project using Tapestry 5. I need to use > select component and I found some missing features or/and possible > bugs. > > 1. At site > http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry/corelib/components/Select.html > there is an example saying: > > <t:select t:id="color" > model="literal:FF0000=Red,00FF00=Green,0000FF=Blue"/> will let me put > on page component with colour names and their hex values as option > values. > > This example isn't working and I have question: is it known bug or I > just missed solution placed somewhere? > > 2. I couldn't find any way to force Tapestry to mark as "selected" > option different than first one. > > Thank you in advance for your time and answers. > > Regards, > Tomasz Dziurko > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
