You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by neo anderson <ja...@yahoo.co.uk> on 2007/11/28 00:03:13 UTC

Re: Change value property in @Option

I have similar problem. Is anyone know how to solve it?

Thanks in advice.



Blackwings wrote:
> 
> Hi,
> 
> I'm looking for the way to change the how the value property of the
> @Option
> can be change. By default, it put an index from 0 to n. But I don't want
> that. I would like to be able to do something like :
> 
> <select jwcid="requester@Select" name="searchCriteria.requester" size="1"
> tabindex="6" class="comboBox9pt">
>   
>     <option jwcid="@Option" label="ognl:currentRequester.display"
> selected="ognl:currentRequester" value="ognl:currentRequester.code"/>
>   
> </select>
> 
> In this code, when the form is submit, the field
> searchCriteria.requestershould be fill-in with
> currentRequester.code. Tapestry 4 doesn't allow to have an explicit
> "value"
> property defined.
> 
> Is it possible to create a component from the @Option component, rewrite
> the
> "render" method and use the setValue(myValues) ?
> 
> Thanks
> 
> BW
> 
> 

-- 
View this message in context: http://www.nabble.com/Change-value-property-in-%40Option-tf2002912.html#a13982179
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: Change value property in @Option

Posted by Robert Zeigler <ro...@scazdl.org>.
I think most of us use the PropertySelection component instead of  
select and option.
Then you would encode your values via an IPropertySelectionModel.

Cheers,

Robert

On Nov 27, 2007, at 11/275:03 PM , neo anderson wrote:

>
> I have similar problem. Is anyone know how to solve it?
>
> Thanks in advice.
>
>
>
> Blackwings wrote:
>>
>> Hi,
>>
>> I'm looking for the way to change the how the value property of the
>> @Option
>> can be change. By default, it put an index from 0 to n. But I don't  
>> want
>> that. I would like to be able to do something like :
>>
>> <select jwcid="requester@Select" name="searchCriteria.requester"  
>> size="1"
>> tabindex="6" class="comboBox9pt">
>>
>>    <option jwcid="@Option" label="ognl:currentRequester.display"
>> selected="ognl:currentRequester" value="ognl:currentRequester.code"/>
>>
>> </select>
>>
>> In this code, when the form is submit, the field
>> searchCriteria.requestershould be fill-in with
>> currentRequester.code. Tapestry 4 doesn't allow to have an explicit
>> "value"
>> property defined.
>>
>> Is it possible to create a component from the @Option component,  
>> rewrite
>> the
>> "render" method and use the setValue(myValues) ?
>>
>> Thanks
>>
>> BW
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/Change-value-property-in-%40Option-tf2002912.html#a13982179
> 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


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


Re: Change value property in @Option

Posted by Andreas Andreou <an...@gmail.com>.
Why do you need to change that? Are you submitting to a tapestry form?

On Nov 28, 2007 1:03 AM, neo anderson <ja...@yahoo.co.uk> wrote:
>
> I have similar problem. Is anyone know how to solve it?
>
> Thanks in advice.
>
>
>
> Blackwings wrote:
> >
> > Hi,
> >
> > I'm looking for the way to change the how the value property of the
> > @Option
> > can be change. By default, it put an index from 0 to n. But I don't want
> > that. I would like to be able to do something like :
> >
> > <select jwcid="requester@Select" name="searchCriteria.requester" size="1"
> > tabindex="6" class="comboBox9pt">
> >
> >     <option jwcid="@Option" label="ognl:currentRequester.display"
> > selected="ognl:currentRequester" value="ognl:currentRequester.code"/>
> >
> > </select>
> >
> > In this code, when the form is submit, the field
> > searchCriteria.requestershould be fill-in with
> > currentRequester.code. Tapestry 4 doesn't allow to have an explicit
> > "value"
> > property defined.
> >
> > Is it possible to create a component from the @Option component, rewrite
> > the
> > "render" method and use the setValue(myValues) ?
> >
> > Thanks
> >
> > BW
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Change-value-property-in-%40Option-tf2002912.html#a13982179
> 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
>
>



-- 
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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


Re: Change value property in @Option

Posted by Steve Shucker <ss...@vmsinfo.com>.
You should look at the @PropertySelection component to render a select 
dropdown complete with options.  It takes a "model" attribute (interface 
IPropertySelectionModel) which essentially wraps a collection/array of 
options.  For your case, you probably want the 
BeanPropertySelectionModel or StringConvertedPropertySelectionModel.  If 
those don't suit your needs, you can easily write a custom model.

-Steve

neo anderson wrote:
> I have similar problem. Is anyone know how to solve it?
>
> Thanks in advice.
>
>
>
> Blackwings wrote:
>   
>> Hi,
>>
>> I'm looking for the way to change the how the value property of the
>> @Option
>> can be change. By default, it put an index from 0 to n. But I don't want
>> that. I would like to be able to do something like :
>>
>> <select jwcid="requester@Select" name="searchCriteria.requester" size="1"
>> tabindex="6" class="comboBox9pt">
>>   
>>     <option jwcid="@Option" label="ognl:currentRequester.display"
>> selected="ognl:currentRequester" value="ognl:currentRequester.code"/>
>>   
>> </select>
>>
>> In this code, when the form is submit, the field
>> searchCriteria.requestershould be fill-in with
>> currentRequester.code. Tapestry 4 doesn't allow to have an explicit
>> "value"
>> property defined.
>>
>> Is it possible to create a component from the @Option component, rewrite
>> the
>> "render" method and use the setValue(myValues) ?
>>
>> Thanks
>>
>> BW
>>
>>
>>     
>
>   

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