Alright, Following is what exactly am I trying to achieve:
In our application we have to develop number of screens (more than 200)
which have a table listing with 10 rows shown at a time and facility for
next and previous page being given in the form of buttons.
I wish to write a generic TILE which could be passed with an arraylist of
some DTO, to render the table, thus reducing the coding effort. We as have
written a generic Value List Handler component to suit our need.
While developing the subject TILE we need to specify the DTO's type at
run-time (in JSP), and we are not able to achieve this. As you can see in
the code given, we try to give the "type" attribute with the help of
bean:write.
Hope this clears up the problem.
Regards,
Puneet Agarwal
Ext: 1031
Struts ... Action ... Struts in Action ... Action in Struts ... Action
"with" Struts ...
James
Mitchell To: Struts Users Mailing List <[EMAIL
PROTECTED]>
<[EMAIL PROTECTED] cc:
ache.org> Subject: Re: [Logic Tag] Can This work
03/29/03
07:44 PM
Please
respond to
"Struts Users
Mailing List"
On Sat, 2003-03-29 at 02:46, Puneet Agarwal wrote:
> Unfortunately, this did not work, mostly because this will substitute the
> value at a later stage than required.
I can't really help, if you don't specify your requirements.
>
> We need some other solution to this....
>
> Any more clues !!!
>
> ------------James Mitchell Suggested:
> ------------------------------------------------
> Did you try this?
>
> <bean:define id="myType">
> <bean:write name="txtInput">
> </bean:define>
> <logic:iterate id="idDataClass" property="vData" type="<%=myType%>">
>
> ------------Original Problem
> --------------------------------------------------------
> Can this work
>
> <logic:iterate id="idDataClass" property="vData" type="<bean:write
> name=txtInput>">
>
> I want to give the "type" at run time to make a re-usable TILE for our
> application.
>
> Complete code is shown below.
>
> --------------------
> <%@ taglib uri="/tags/struts-bean" prefix="bean" %>
> <%@ taglib uri="/tags/struts-html" prefix="html" %>
> <%@ taglib uri="/tags/struts-logic" prefix="logic" %>
> <%@ taglib uri="/tags/struts-tiles" prefix="tiles" %>
>
> <html:html locale="true">
> <head>
> <html:base/>
> </head>
> <BODY class="BodyClass">
> <html:form name="FormTableRO" action="/pages/TableRO.do"
> type="com.tiger.inf.forms.FormTableRO">
> <logic:iterate id="idDataClass" property="vData" type="<bean:write
> name=txtInput>">
> <bean:write name="idDataClass" property="time"/>
> <bean:write name="idDataClass" property="day"/>
> </logic:iterate>
> </html:form>
> </body>
> </html:html>
>
------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--
James Mitchell
Software Developer/Struts Evangelist
http://www.open-tools.org
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]