You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Angelo Chen <an...@yahoo.com.hk> on 2009/05/08 11:02:11 UTC

t5: model with same entry got two 'selected'

Hi,

In a drop down list using select, I have a list of countries, to make it
easier, I put some common countries in the top, rest at bottom, the common
countries got repeated as well, now when Tapestry 5 generates the html code,
it generates two 'selected' entries in the html list, this is logical, but
when clicked, browser will select the one at the bottom, instead at the
common countries area, is there a way to generate only one 'selected' entry?
or any good idea in dropping down a long list like countries and give user
option to choose from common ones? Thanks,

Angelo


<input t:type="select" t:id="country" model="countries" t:value="country" />

<option selected="selected" value="US">US</option>
<option value="PN">Pitcairn</option>
<option value="PL">Poland</option>
<option value="PT">Portugal</option>
<option selected="selected" value="US">US</option>  // any way to remove
'selected' attribute?


-- 
View this message in context: http://www.nabble.com/t5%3A-model-with-same-entry-got-two-%27selected%27-tp23442499p23442499.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: t5: model with same entry got two 'selected'

Posted by Ulrich Stärk <ul...@spielviel.de>.
You could try with option groups. See 
http://tapestry.formos.com/nightly/tapestry5/apidocs/org/apache/tapestry5/SelectModel.html

Uli

Am 08.05.2009 11:02 schrieb Angelo Chen:
> Hi,
> 
> In a drop down list using select, I have a list of countries, to make it
> easier, I put some common countries in the top, rest at bottom, the common
> countries got repeated as well, now when Tapestry 5 generates the html code,
> it generates two 'selected' entries in the html list, this is logical, but
> when clicked, browser will select the one at the bottom, instead at the
> common countries area, is there a way to generate only one 'selected' entry?
> or any good idea in dropping down a long list like countries and give user
> option to choose from common ones? Thanks,
> 
> Angelo
> 
> 
> <input t:type="select" t:id="country" model="countries" t:value="country" />
> 
> <option selected="selected" value="US">US</option>
> <option value="PN">Pitcairn</option>
> <option value="PL">Poland</option>
> <option value="PT">Portugal</option>
> <option selected="selected" value="US">US</option>  // any way to remove
> 'selected' attribute?
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org