[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-dev
Subject:    Request to change generated Enum code
From:       "Don Stewart" <Don.Stewart () corizon ! com>
Date:       2007-01-30 14:07:23
Message-ID: 588BC1025554CE4991BC8C769C18C886076ED1 () orion2 ! corizon ! com
[Download RAW message or body]

Hi,
 
I am having a small challenge with the generated Enums from Xmlbeans.
 
There is currently no way on the generated Enum to get the list of
supported string values, nor on the Enums inner public table. 
 
Now it is possible to iterate using a while loop using an int counter
until I get a null, except I am using Velocity to do the loop and there
is no for or while loops just foreach. In order to use foreach I would
need a Collection from the Enum. 
 
The reason for this is to be able to create a drop down list in HTML
with it populated with the supported Enum string values.
 
Anyone have any idea other than:-
 

1.	Modifying Velocity's VTL to support a for loop. 
2.	Modifying my Xmlbeans source to return a Collection. 
3.	Preprocessing in the JAVA before passing to the template engine.

I would however, ask that in the longer term that it is possible to
expose a Collection of the enum strings via the Enum classes public
interface.
 
Many Thanks
 
Don

[Attachment #3 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2>
<DIV dir=ltr align=left><SPAN class=978554513-30012007><FONT face=Arial 
size=2>Hi,</FONT></SPAN></DIV>
<DIV><SPAN class=978554513-30012007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=978554513-30012007><FONT face=Arial size=2>I am having a small 
challenge with the generated Enums from Xmlbeans.</FONT></SPAN></DIV>
<DIV><SPAN class=978554513-30012007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=978554513-30012007><FONT face=Arial size=2>There is currently 
no way on the generated Enum to get the list of supported string values, nor on 
the Enums inner public table. </FONT></SPAN></DIV>
<DIV><SPAN class=978554513-30012007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=978554513-30012007><FONT face=Arial size=2>Now it is possible 
to&nbsp;iterate using a&nbsp;while loop&nbsp;using an int counter until I get a 
null, except I am using Velocity to do the loop and there is no for or while 
loops just&nbsp;foreach. In order to use foreach I would need a Collection from 
the Enum. </FONT></SPAN></DIV>
<DIV><SPAN class=978554513-30012007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=978554513-30012007><FONT face=Arial size=2>The reason for this 
is to be able to create a drop down list in HTML with it populated with the 
supported Enum string values.</FONT></SPAN></DIV>
<DIV><SPAN class=978554513-30012007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=978554513-30012007><FONT face=Arial size=2>Anyone have any idea 
other than:-</FONT></SPAN></DIV>
<DIV><SPAN class=978554513-30012007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<OL>
  <LI><SPAN class=978554513-30012007><FONT face=Arial size=2>Modifying 
  Velocity's VTL to support a for loop.</FONT></SPAN> 
  <LI><SPAN class=978554513-30012007><FONT face=Arial size=2>Modifying my 
  Xmlbeans source to return a Collection.</FONT></SPAN> 
  <LI><SPAN class=978554513-30012007><FONT face=Arial size=2>Preprocessing in 
  the JAVA before passing to the template engine.</FONT></SPAN></LI></OL>
<DIV><SPAN class=978554513-30012007><FONT face=Arial size=2>I would however, ask 
that in the longer term that it is possible to expose a Collection of the enum 
strings via the Enum classes public interface.</FONT></SPAN></DIV>
<DIV><SPAN class=978554513-30012007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=978554513-30012007><FONT face=Arial size=2>Many 
Thanks</FONT></SPAN></DIV>
<DIV><SPAN class=978554513-30012007><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=978554513-30012007><FONT face=Arial 
size=2>Don</FONT></SPAN></FONT></DIV></DIV></BODY></HTML>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic