You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Ghanakota, Vishu" <GV...@firstam.com> on 2003/10/24 01:29:16 UTC

RE: Hi Ted, any more on ?

Did you take a look at
Middlegen(http://sourceforge.net/projects/middlegen/)?
It's pretty close to what you are describing. In fact it goes couple steps
backwards and forwards generating JSPs/Struts action classes directly from
database. It has plug-ins for EJB and JDO. If have a site with simple forms,
it saves you a lot of time by generating all the forms with get/set.

-----Original Message-----
From: Sonam Belbase [mailto:Sonam.Belbase@morganstanley.com]
Sent: Thursday, October 23, 2003 4:14 PM
To: Struts Users Mailing List
Subject: Hi Ted, any more on <html:control>?


Hi Ted,

Has the <html:control> you mention below been implemented already
or is it in the works at all?

Thanks,
SB

Ted Husted wrote:

> Shishir K. Singh wrote:
>  > Is there a way that I can create a form dynamically based on some XML
>  > configurable file. The configurable file will say  what kind of  input
>  > type it is. Eg "text", "checkbox" etc and accordingly, I  create the
>  > form input types and  then display the fields.
>
> AFAIK, there's no such beast right now, though I keep thinking there
> should be.
>
> Essentially, the idea would be to represent the entire form and all of
> its fields as a JavaBean (or Map of JavaBeans, or Map of Maps), which
> could be instantiated by an XML file. Not unlike the XML form element
> the Validator uses, only more so.
>
> A JSP Tag (or Velocity Tool) could then render the control based on the
> properties of the JavaBean form. So instead of having something like
>
> <html:input property="xyz" ... />
>
> you'd have something like
>
> <html:control property="xyz" ... />
>
> The tag would then lookup the "xyz" property, and then the "controlType"
> property on the xyz JavaBean, and use that value to decide which control
> to render (input, select, ... ).
>
> For extra credit, there could also be tag/tool that could write a
> plain-vanilla version of the entire form as a simple table.
>
> I end up doing this myself eventually, but keep hoping someone will beat
> me to it =:)
>
> -Ted.
>
> --
> Ted Husted,
>    Junit in Action  - <http://www.manning.com/massol/>,
>    Struts in Action - <http://husted.com/struts/book.html>,
>    JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.
>
> Shishir K. Singh wrote:
> > Hello,
> >
> > Is there a way that I can create a form dynamically based on some XML
> > configurable file. The configurable file will say  what kind of  input
> > type it is. Eg "text", "checkbox" etc and accordingly, I  create the
> > form input types and  then display the fields.
> >
> > Eg
> >
> > My JSP looks like this right now (I am using tiles and this is the
> > content section )
> >
> > ------------------------------------------------------------------------
> > ------------
> > <%@ taglib uri="/core"          prefix="c" %>
> > <%@ taglib uri="/struts-tiles"  prefix="tiles" %>
> > <%@ taglib uri="/struts-html"   prefix="html" %>
> >
> > <br><br>
> >
> > <html:form action="/createContentAction">
> >       <table width="60%" border="0.5">
> >               <c:forEach var="lines" items="${contentForm.map.lines}"
> >
> >                       <tr>
> >                               <td><c:out
> > value="${lines.attributeName}"/> </td>
> >                               <td><html:text  indexed="true"
> > name="lines" property="attributeValue"/></td>
> >                       </tr>
> >               </c:forEach>
> >                       <tr>
> >                               <td><html:submit/></td>
> >                       </tr>
> >       </table>
> > </html:form>
> >     <tr>
> >         <td><html:submit/></td>
> >     </tr>
> > </table>
> > </html:form>
> >
> > ------------------------------------------------------------------------
> > ----------------------------
> > Basically my intent is to load  some predefined attributes (by parsing
> > an XML file) and creating the
> > Form on the fly using indexed DynaActionForm (contentForm) . I have been
> > able to get the fields up in the form, but only
> > as text input fields as I am using <html:text tags. However, my input
> > type can be check boxes, or select type and
> > I would like that to be configurable instead of hard coding in the JSP.
> > Is this doable ??
> >
> > Any hints/tips would be appreciated.
> >
> > TIA
> > Shishir
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org

--
NOTICE: If received in error, please destroy and notify sender.  Sender does
not waive confidentiality or privilege, and use is prohibited.



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


"MMS <firstam.com>" made the following
 annotations on 10/23/2003 04:29:28 PM
------------------------------------------------------------------------------
"THIS E-MAIL MESSAGE AND ANY FILES TRANSMITTED HEREWITH, ARE INTENDED SOLELY
FOR THE USE OF THE INDIVIDUAL(S) ADDRESSED AND MAY CONTAIN CONFIDENTIAL,
PROPRIETARY OR PRIVILEGED INFORMATION.  IF YOU ARE NOT THE ADDRESSEE INDICATED
IN THIS MESSAGE (OR RESPONSIBLE FOR DELIVERY OF THIS MESSAGE TO SUCH PERSON)
YOU MAY NOT REVIEW, USE, DISCLOSE OR DISTRIBUTE THIS MESSAGE OR ANY FILES
TRANSMITTED HEREWITH.  IF YOU RECEIVE THIS MESSAGE IN ERROR, PLEASE CONTACT
THE SENDER BY REPLY E-MAIL AND DELETE THIS MESSAGE AND ALL COPIES OF IT FROM
YOUR SYSTEM."
==============================================================================


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org