You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by George Christman <gc...@cardaddy.com> on 2013/09/19 14:57:00 UTC

Renaming options in select menu using .properties

Hello, I'm wondering if anybody knows how to rename the options in a select
menu using .properties or some other method. I currently have true false in
the menu and that needs to be changed to Y N.

Thanks,
George

Re: Renaming options in select menu using .properties

Posted by Michael <ga...@gmail.com>.
I've checked this code in 5.3.6 and in 5.4-alpha-23 and it's works fine 
w/o encoder. There were changes in SelectModel (TAP5-2184) recently.
Tapestry 5.4 is in development and not stable yet. Do you use it for 
production?

19.09.2013 18:46, George Christman пишет:
> I'm using 5.4.22 with blankOption="literal:NEVER" added as a parameter to
> my select component.
>
>
> On Thu, Sep 19, 2013 at 10:14 AM, Michael Gagauz<ga...@gmail.com>  wrote:
>
>> No idea. Which version of tapestry do you use? Try to add
>> blankOption="never" param to select.
>>
>> 19.09.2013 18:07, George Christman пишет:
>>
>>> Michael, Thanks that worked perfectly, however for some strange reason, I
>>> still need the value encoder. Without it, I get the following error.
>>>
>>> You must correct the following errors before continuing.
>>>
>>>      - Selected option is not listed in the model.
>>>
>>>
>>> It works perfectly fine with the encoder, I'm assuming it's not converting
>>> the client string back to a boolean. Any thoughts?
>>>
>>>
>>>
>>> On Thu, Sep 19, 2013 at 10:00 AM, Michael Gagauz<ga...@gmail.com>
>>>   wrote:
>>>
>>>   You can't do it using SelectModelFactory  unless you'll create some kind
>>>> of wrapper for Boolean. Try to create SelectModel manually:
>>>>
>>>>           List<OptionModel>   tardies = new ArrayList<OptionModel>();
>>>>           tardies.add(new OptionModelImpl("Y", true));
>>>>           tardies.add(new OptionModelImpl("N", false));
>>>>
>>>>           new SelectModelImpl(null, tardies);
>>>>
>>>> P.S. You don't need encoder for boolean.
>>>>
>>>> 19.09.2013 17:40, George Christman пишет:
>>>>
>>>>    I'm using a standard select menu nested within a loop. The boolean
>>>> values
>>>>
>>>>> come from my hibernate entity. I took a look at the enumSelectModel, I'm
>>>>> just not sure how to get it to work with my entity.
>>>>>
>>>>> .tml
>>>>>
>>>>>          <t:Loop source="fields" value="field" encoder="encoder">
>>>>>            <div class="col-xs-15">
>>>>>                <div>
>>>>>                    <t:Select value="field.propertyValue"
>>>>> clientId="${field.****propertyName}" model="selectModel"
>>>>>
>>>>> blankOption="literal:never" encoder="encoderSelect"/>
>>>>>                </div>
>>>>>            </div>
>>>>>        </t:Loop>
>>>>>
>>>>> .java
>>>>>
>>>>>        @Property
>>>>>        private FieldEntity field;
>>>>>
>>>>>        @Prroperty
>>>>>        private List<FieldEntity>    fields;
>>>>>
>>>>>        @Inject
>>>>>        private SelectModelFactory selectModelFactory
>>>>>
>>>>>        public SelectModel getSelectModel() {
>>>>>            List<Boolean>    tardies = new ArrayList<Boolean>();
>>>>>            tardies.add(true);
>>>>>            tardies.add(false);
>>>>>            return this.selectModelFactory.****create(tardies);
>>>>>
>>>>>        }
>>>>>
>>>>>        public ValueEncoder getEncoderSelect() {
>>>>>            return new ValueEncoder<Boolean>() {
>>>>>                public String toClient(Boolean value) {
>>>>>                    return value.toString();
>>>>>                }
>>>>>                public Boolean toValue(String clientValue) {
>>>>>                    return "true".equals(clientValue) ? true : false;
>>>>>                }
>>>>>            };
>>>>>        }
>>>>>
>>>>>
>>>>> FieldEntity.class
>>>>>
>>>>>        @NonVisual
>>>>>        private boolean tsTardy01;
>>>>>        @NonVisual
>>>>>        private boolean tsTardy02;
>>>>>        @NonVisual
>>>>>        private boolean tsTardy03;
>>>>>        @NonVisual
>>>>>        private boolean tsTardy04;
>>>>>
>>>>>
>>>>> On Thu, Sep 19, 2013 at 9:03 AM, Eugen<eu...@gmail.com>    wrote:
>>>>>
>>>>>    Hi,
>>>>>
>>>>>> which select model are You using?
>>>>>> if You use an EnumSelectModel the client side caption is build as
>>>>>> follow:
>>>>>> Enum.class.getSimpleName()+"."****+Enum.name()
>>>>>>
>>>>>>
>>>>>> 2013/9/19 George Christman<gchristman@cardaddy.****com<
>>>>>> gchristman@cardaddy.com>
>>>>>>
>>>>>>   :
>>>>>>> Hello, I'm wondering if anybody knows how to rename the options in a
>>>>>>>
>>>>>>>   select
>>>>>>   menu using .properties or some other method. I currently have true
>>>>>>> false
>>>>>>>
>>>>>>>   in
>>>>>>   the menu and that needs to be changed to Y N.
>>>>>>> Thanks,
>>>>>>> George
>>>>>>>
>>>>>>>   ------------------------------****----------------------------**--**
>>>>>> ---------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.**a**pache.org<http://apache.org>
>>>>>> <us...@tapestry.apache.org>
>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>   ------------------------------****----------------------------**
>>>> --**---------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.**a**pache.org<http://apache.org>
>>>> <us...@tapestry.apache.org>
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@tapestry.apache.org>
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>

-- 
Best regards,
Michael Gagauz


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


Re: Renaming options in select menu using .properties

Posted by George Christman <gc...@cardaddy.com>.
I'm using 5.4.22 with blankOption="literal:NEVER" added as a parameter to
my select component.


On Thu, Sep 19, 2013 at 10:14 AM, Michael Gagauz <ga...@gmail.com> wrote:

> No idea. Which version of tapestry do you use? Try to add
> blankOption="never" param to select.
>
> 19.09.2013 18:07, George Christman пишет:
>
>> Michael, Thanks that worked perfectly, however for some strange reason, I
>> still need the value encoder. Without it, I get the following error.
>>
>> You must correct the following errors before continuing.
>>
>>     - Selected option is not listed in the model.
>>
>>
>> It works perfectly fine with the encoder, I'm assuming it's not converting
>> the client string back to a boolean. Any thoughts?
>>
>>
>>
>> On Thu, Sep 19, 2013 at 10:00 AM, Michael Gagauz<ga...@gmail.com>
>>  wrote:
>>
>>  You can't do it using SelectModelFactory  unless you'll create some kind
>>> of wrapper for Boolean. Try to create SelectModel manually:
>>>
>>>          List<OptionModel>  tardies = new ArrayList<OptionModel>();
>>>          tardies.add(new OptionModelImpl("Y", true));
>>>          tardies.add(new OptionModelImpl("N", false));
>>>
>>>          new SelectModelImpl(null, tardies);
>>>
>>> P.S. You don't need encoder for boolean.
>>>
>>> 19.09.2013 17:40, George Christman пишет:
>>>
>>>   I'm using a standard select menu nested within a loop. The boolean
>>> values
>>>
>>>> come from my hibernate entity. I took a look at the enumSelectModel, I'm
>>>> just not sure how to get it to work with my entity.
>>>>
>>>> .tml
>>>>
>>>>         <t:Loop source="fields" value="field" encoder="encoder">
>>>>           <div class="col-xs-15">
>>>>               <div>
>>>>                   <t:Select value="field.propertyValue"
>>>> clientId="${field.****propertyName}" model="selectModel"
>>>>
>>>> blankOption="literal:never" encoder="encoderSelect"/>
>>>>               </div>
>>>>           </div>
>>>>       </t:Loop>
>>>>
>>>> .java
>>>>
>>>>       @Property
>>>>       private FieldEntity field;
>>>>
>>>>       @Prroperty
>>>>       private List<FieldEntity>   fields;
>>>>
>>>>       @Inject
>>>>       private SelectModelFactory selectModelFactory
>>>>
>>>>       public SelectModel getSelectModel() {
>>>>           List<Boolean>   tardies = new ArrayList<Boolean>();
>>>>           tardies.add(true);
>>>>           tardies.add(false);
>>>>           return this.selectModelFactory.****create(tardies);
>>>>
>>>>       }
>>>>
>>>>       public ValueEncoder getEncoderSelect() {
>>>>           return new ValueEncoder<Boolean>() {
>>>>               public String toClient(Boolean value) {
>>>>                   return value.toString();
>>>>               }
>>>>               public Boolean toValue(String clientValue) {
>>>>                   return "true".equals(clientValue) ? true : false;
>>>>               }
>>>>           };
>>>>       }
>>>>
>>>>
>>>> FieldEntity.class
>>>>
>>>>       @NonVisual
>>>>       private boolean tsTardy01;
>>>>       @NonVisual
>>>>       private boolean tsTardy02;
>>>>       @NonVisual
>>>>       private boolean tsTardy03;
>>>>       @NonVisual
>>>>       private boolean tsTardy04;
>>>>
>>>>
>>>> On Thu, Sep 19, 2013 at 9:03 AM, Eugen<eu...@gmail.com>   wrote:
>>>>
>>>>   Hi,
>>>>
>>>>> which select model are You using?
>>>>> if You use an EnumSelectModel the client side caption is build as
>>>>> follow:
>>>>> Enum.class.getSimpleName()+"."****+Enum.name()
>>>>>
>>>>>
>>>>> 2013/9/19 George Christman<gchristman@cardaddy.****com<
>>>>> gchristman@cardaddy.com>
>>>>>
>>>>>  :
>>>>>> Hello, I'm wondering if anybody knows how to rename the options in a
>>>>>>
>>>>>>  select
>>>>>
>>>>>  menu using .properties or some other method. I currently have true
>>>>>> false
>>>>>>
>>>>>>  in
>>>>>
>>>>>  the menu and that needs to be changed to Y N.
>>>>>>
>>>>>> Thanks,
>>>>>> George
>>>>>>
>>>>>>  ------------------------------****----------------------------**--**
>>>>> ---------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.**a**pache.org<http://apache.org>
>>>>> <us...@tapestry.apache.org>
>>>>> >
>>>>>
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>>>
>>>>>  ------------------------------****----------------------------**
>>> --**---------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.**a**pache.org<http://apache.org>
>>> <us...@tapestry.apache.org>
>>> >
>>>
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@tapestry.apache.org>
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
George Christman
www.CarDaddy.com
P.O. Box 735
Johnstown, New York

Re: Renaming options in select menu using .properties

Posted by Michael Gagauz <ga...@gmail.com>.
No idea. Which version of tapestry do you use? Try to add 
blankOption="never" param to select.

19.09.2013 18:07, George Christman пишет:
> Michael, Thanks that worked perfectly, however for some strange reason, I
> still need the value encoder. Without it, I get the following error.
>
> You must correct the following errors before continuing.
>
>     - Selected option is not listed in the model.
>
> It works perfectly fine with the encoder, I'm assuming it's not converting
> the client string back to a boolean. Any thoughts?
>
>
>
> On Thu, Sep 19, 2013 at 10:00 AM, Michael Gagauz<ga...@gmail.com>  wrote:
>
>> You can't do it using SelectModelFactory  unless you'll create some kind
>> of wrapper for Boolean. Try to create SelectModel manually:
>>
>>          List<OptionModel>  tardies = new ArrayList<OptionModel>();
>>          tardies.add(new OptionModelImpl("Y", true));
>>          tardies.add(new OptionModelImpl("N", false));
>>
>>          new SelectModelImpl(null, tardies);
>>
>> P.S. You don't need encoder for boolean.
>>
>> 19.09.2013 17:40, George Christman пишет:
>>
>>   I'm using a standard select menu nested within a loop. The boolean values
>>> come from my hibernate entity. I took a look at the enumSelectModel, I'm
>>> just not sure how to get it to work with my entity.
>>>
>>> .tml
>>>
>>>         <t:Loop source="fields" value="field" encoder="encoder">
>>>           <div class="col-xs-15">
>>>               <div>
>>>                   <t:Select value="field.propertyValue"
>>> clientId="${field.**propertyName}" model="selectModel"
>>> blankOption="literal:never" encoder="encoderSelect"/>
>>>               </div>
>>>           </div>
>>>       </t:Loop>
>>>
>>> .java
>>>
>>>       @Property
>>>       private FieldEntity field;
>>>
>>>       @Prroperty
>>>       private List<FieldEntity>   fields;
>>>
>>>       @Inject
>>>       private SelectModelFactory selectModelFactory
>>>
>>>       public SelectModel getSelectModel() {
>>>           List<Boolean>   tardies = new ArrayList<Boolean>();
>>>           tardies.add(true);
>>>           tardies.add(false);
>>>           return this.selectModelFactory.**create(tardies);
>>>       }
>>>
>>>       public ValueEncoder getEncoderSelect() {
>>>           return new ValueEncoder<Boolean>() {
>>>               public String toClient(Boolean value) {
>>>                   return value.toString();
>>>               }
>>>               public Boolean toValue(String clientValue) {
>>>                   return "true".equals(clientValue) ? true : false;
>>>               }
>>>           };
>>>       }
>>>
>>>
>>> FieldEntity.class
>>>
>>>       @NonVisual
>>>       private boolean tsTardy01;
>>>       @NonVisual
>>>       private boolean tsTardy02;
>>>       @NonVisual
>>>       private boolean tsTardy03;
>>>       @NonVisual
>>>       private boolean tsTardy04;
>>>
>>>
>>> On Thu, Sep 19, 2013 at 9:03 AM, Eugen<eu...@gmail.com>   wrote:
>>>
>>>   Hi,
>>>> which select model are You using?
>>>> if You use an EnumSelectModel the client side caption is build as follow:
>>>> Enum.class.getSimpleName()+"."**+Enum.name()
>>>>
>>>>
>>>> 2013/9/19 George Christman<gc...@cardaddy.com>
>>>>> :
>>>>> Hello, I'm wondering if anybody knows how to rename the options in a
>>>>>
>>>> select
>>>>
>>>>> menu using .properties or some other method. I currently have true false
>>>>>
>>>> in
>>>>
>>>>> the menu and that needs to be changed to Y N.
>>>>>
>>>>> Thanks,
>>>>> George
>>>>>
>>>> ------------------------------**------------------------------**
>>>> ---------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@tapestry.apache.org>
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@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: Renaming options in select menu using .properties

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Thu, 19 Sep 2013 11:07:20 -0300, George Christman  
<gc...@cardaddy.com> wrote:

> Michael, Thanks that worked perfectly, however for some strange reason, I
> still need the value encoder. Without it, I get the following error.
>
> You must correct the following errors before continuing.
>
>    - Selected option is not listed in the model.

ValueEncoder is completely independent of SelectModel and vice-versa.  
ValueEncoder makes object -> String conversions used as the value  
attribute of <select> conversions and vice-versa. SelectModel defines the  
options (OptionModel instances), and OptionModel defines the object and  
its labels.

-- 
Thiago H. de Paula Figueiredo

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


Re: Renaming options in select menu using .properties

Posted by George Christman <gc...@cardaddy.com>.
Michael, Thanks that worked perfectly, however for some strange reason, I
still need the value encoder. Without it, I get the following error.

You must correct the following errors before continuing.

   - Selected option is not listed in the model.

It works perfectly fine with the encoder, I'm assuming it's not converting
the client string back to a boolean. Any thoughts?



On Thu, Sep 19, 2013 at 10:00 AM, Michael Gagauz <ga...@gmail.com> wrote:

> You can't do it using SelectModelFactory  unless you'll create some kind
> of wrapper for Boolean. Try to create SelectModel manually:
>
>         List<OptionModel> tardies = new ArrayList<OptionModel>();
>         tardies.add(new OptionModelImpl("Y", true));
>         tardies.add(new OptionModelImpl("N", false));
>
>         new SelectModelImpl(null, tardies);
>
> P.S. You don't need encoder for boolean.
>
> 19.09.2013 17:40, George Christman пишет:
>
>  I'm using a standard select menu nested within a loop. The boolean values
>> come from my hibernate entity. I took a look at the enumSelectModel, I'm
>> just not sure how to get it to work with my entity.
>>
>> .tml
>>
>>        <t:Loop source="fields" value="field" encoder="encoder">
>>          <div class="col-xs-15">
>>              <div>
>>                  <t:Select value="field.propertyValue"
>> clientId="${field.**propertyName}" model="selectModel"
>> blankOption="literal:never" encoder="encoderSelect"/>
>>              </div>
>>          </div>
>>      </t:Loop>
>>
>> .java
>>
>>      @Property
>>      private FieldEntity field;
>>
>>      @Prroperty
>>      private List<FieldEntity>  fields;
>>
>>      @Inject
>>      private SelectModelFactory selectModelFactory
>>
>>      public SelectModel getSelectModel() {
>>          List<Boolean>  tardies = new ArrayList<Boolean>();
>>          tardies.add(true);
>>          tardies.add(false);
>>          return this.selectModelFactory.**create(tardies);
>>      }
>>
>>      public ValueEncoder getEncoderSelect() {
>>          return new ValueEncoder<Boolean>() {
>>              public String toClient(Boolean value) {
>>                  return value.toString();
>>              }
>>              public Boolean toValue(String clientValue) {
>>                  return "true".equals(clientValue) ? true : false;
>>              }
>>          };
>>      }
>>
>>
>> FieldEntity.class
>>
>>      @NonVisual
>>      private boolean tsTardy01;
>>      @NonVisual
>>      private boolean tsTardy02;
>>      @NonVisual
>>      private boolean tsTardy03;
>>      @NonVisual
>>      private boolean tsTardy04;
>>
>>
>> On Thu, Sep 19, 2013 at 9:03 AM, Eugen<eu...@gmail.com>  wrote:
>>
>>  Hi,
>>> which select model are You using?
>>> if You use an EnumSelectModel the client side caption is build as follow:
>>> Enum.class.getSimpleName()+"."**+Enum.name()
>>>
>>>
>>> 2013/9/19 George Christman<gc...@cardaddy.com>
>>> >:
>>>
>>>> Hello, I'm wondering if anybody knows how to rename the options in a
>>>>
>>> select
>>>
>>>> menu using .properties or some other method. I currently have true false
>>>>
>>> in
>>>
>>>> the menu and that needs to be changed to Y N.
>>>>
>>>> Thanks,
>>>> George
>>>>
>>> ------------------------------**------------------------------**
>>> ---------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@tapestry.apache.org>
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@tapestry.apache.org>
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
George Christman
www.CarDaddy.com
P.O. Box 735
Johnstown, New York

Re: Renaming options in select menu using .properties

Posted by Michael Gagauz <ga...@gmail.com>.
You can't do it using SelectModelFactory  unless you'll create some kind 
of wrapper for Boolean. Try to create SelectModel manually:

         List<OptionModel> tardies = new ArrayList<OptionModel>();
         tardies.add(new OptionModelImpl("Y", true));
         tardies.add(new OptionModelImpl("N", false));

         new SelectModelImpl(null, tardies);

P.S. You don't need encoder for boolean.

19.09.2013 17:40, George Christman пишет:
> I'm using a standard select menu nested within a loop. The boolean values
> come from my hibernate entity. I took a look at the enumSelectModel, I'm
> just not sure how to get it to work with my entity.
>
> .tml
>
>        <t:Loop source="fields" value="field" encoder="encoder">
>          <div class="col-xs-15">
>              <div>
>                  <t:Select value="field.propertyValue"
> clientId="${field.propertyName}" model="selectModel"
> blankOption="literal:never" encoder="encoderSelect"/>
>              </div>
>          </div>
>      </t:Loop>
>
> .java
>
>      @Property
>      private FieldEntity field;
>
>      @Prroperty
>      private List<FieldEntity>  fields;
>
>      @Inject
>      private SelectModelFactory selectModelFactory
>
>      public SelectModel getSelectModel() {
>          List<Boolean>  tardies = new ArrayList<Boolean>();
>          tardies.add(true);
>          tardies.add(false);
>          return this.selectModelFactory.create(tardies);
>      }
>
>      public ValueEncoder getEncoderSelect() {
>          return new ValueEncoder<Boolean>() {
>              public String toClient(Boolean value) {
>                  return value.toString();
>              }
>              public Boolean toValue(String clientValue) {
>                  return "true".equals(clientValue) ? true : false;
>              }
>          };
>      }
>
>
> FieldEntity.class
>
>      @NonVisual
>      private boolean tsTardy01;
>      @NonVisual
>      private boolean tsTardy02;
>      @NonVisual
>      private boolean tsTardy03;
>      @NonVisual
>      private boolean tsTardy04;
>
>
> On Thu, Sep 19, 2013 at 9:03 AM, Eugen<eu...@gmail.com>  wrote:
>
>> Hi,
>> which select model are You using?
>> if You use an EnumSelectModel the client side caption is build as follow:
>> Enum.class.getSimpleName()+"."+Enum.name()
>>
>>
>> 2013/9/19 George Christman<gc...@cardaddy.com>:
>>> Hello, I'm wondering if anybody knows how to rename the options in a
>> select
>>> menu using .properties or some other method. I currently have true false
>> in
>>> the menu and that needs to be changed to Y N.
>>>
>>> Thanks,
>>> George
>> ---------------------------------------------------------------------
>> 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: Renaming options in select menu using .properties

Posted by George Christman <gc...@cardaddy.com>.
I'm using a standard select menu nested within a loop. The boolean values
come from my hibernate entity. I took a look at the enumSelectModel, I'm
just not sure how to get it to work with my entity.

.tml

      <t:Loop source="fields" value="field" encoder="encoder">
        <div class="col-xs-15">
            <div>
                <t:Select value="field.propertyValue"
clientId="${field.propertyName}" model="selectModel"
blankOption="literal:never" encoder="encoderSelect"/>
            </div>
        </div>
    </t:Loop>

.java

    @Property
    private FieldEntity field;

    @Prroperty
    private List<FieldEntity> fields;

    @Inject
    private SelectModelFactory selectModelFactory

    public SelectModel getSelectModel() {
        List<Boolean> tardies = new ArrayList<Boolean>();
        tardies.add(true);
        tardies.add(false);
        return this.selectModelFactory.create(tardies);
    }

    public ValueEncoder getEncoderSelect() {
        return new ValueEncoder<Boolean>() {
            public String toClient(Boolean value) {
                return value.toString();
            }
            public Boolean toValue(String clientValue) {
                return "true".equals(clientValue) ? true : false;
            }
        };
    }


FieldEntity.class

    @NonVisual
    private boolean tsTardy01;
    @NonVisual
    private boolean tsTardy02;
    @NonVisual
    private boolean tsTardy03;
    @NonVisual
    private boolean tsTardy04;


On Thu, Sep 19, 2013 at 9:03 AM, Eugen <eu...@gmail.com> wrote:

> Hi,
> which select model are You using?
> if You use an EnumSelectModel the client side caption is build as follow:
> Enum.class.getSimpleName()+"."+Enum.name()
>
>
> 2013/9/19 George Christman <gc...@cardaddy.com>:
> > Hello, I'm wondering if anybody knows how to rename the options in a
> select
> > menu using .properties or some other method. I currently have true false
> in
> > the menu and that needs to be changed to Y N.
> >
> > Thanks,
> > George
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
George Christman
www.CarDaddy.com
P.O. Box 735
Johnstown, New York

Re: Renaming options in select menu using .properties

Posted by Eugen <eu...@gmail.com>.
Hi,
which select model are You using?
if You use an EnumSelectModel the client side caption is build as follow:
Enum.class.getSimpleName()+"."+Enum.name()


2013/9/19 George Christman <gc...@cardaddy.com>:
> Hello, I'm wondering if anybody knows how to rename the options in a select
> menu using .properties or some other method. I currently have true false in
> the menu and that needs to be changed to Y N.
>
> Thanks,
> George

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