Tapestry looks for a label in your message catalog, if none is found it uses 
name() to automatically create a proper label.
toString() is not used.


To fix your problem, put this in the message catalog (YourPage.properties):

oms = OMS
payment = Payment


On Thu, 09 Jul 2009 08:28:18 +0200, Balduran Bu <balduran...@bleum.com> wrote:

> Hello,
>
> 
>
> When t:Select component generates option labels for enums, the
> toString() method is not honored at all. It currently generates both
> labels and values based on Enum.name() method. In my understanding, the
> labels shall be generated based on toString() method instead.
>
> 
>
> Here is a piece of HTML code T5 generated:
>
> <select id="team" name="team">
> <option value="OMS">Oms</option>
> <option value="PAYMENT">Payment</option>
> </select>
> 
> And I expect it shall look like
> <select id="team" name="team">
> <option value="OMS">OMS</option>
> <option value="PAYMENT">Payment</option>
> </select>
>
> 
>
> Here is the enum class:
>
> public enum Team {
>
>   OMS, PAYMENT;
>
>   public String toString() {
>
>      switch(this)  {
>
>        OMS:
>
>           return "OMS";
>
>        PAYMENT:
>
>           return "Payment";
>
>      }
>
>      return "":
>
>   }
>
> 
>
> This issue is found in Tapestry 5.1.0.5.
>
> 
>
> Regards,
>
> Balduran

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

Reply via email to