You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by fea jabi <zy...@hotmail.com> on 2005/12/01 15:05:36 UTC

RE: design question --- struts & displaytag

can someone help me with this please?

Thanks.


>From: "fea jabi" <zy...@hotmail.com>
>Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
>To: user@struts.apache.org
>Subject: design question --- struts & displaytag
>Date: Wed, 30 Nov 2005 16:02:26 -0500
>
>Have a table as below -- will be using displaytag for this.
>
>              Hrs
>Loans          3
>deposit        5
>
>
>For this I created a DynaValidatorForm with
>loans, deposits as it's form properties.
>
><form-bean name="HoursForm" 
>type="org.apache.struts.validator.DynaValidatorForm" dynamic="true">
>         <form-property name="loans" type="java.lang.Integer"/>
>         <form-property name="deposits" type="java.lang.Integer"/>
>    </form-bean>
>
><action
>        path="/PrepareHoursAction"
>        type="com.actions.PrepareHoursAction"
>        name="HoursForm"
>        scope="session">
>        <forward name="success" path="/Hours.jsp" redirect="false"/>
>     </action>
>
>In action
>
>public ActionForward execute(ActionMapping mapping,
>                           ActionForm form,
>                           HttpServletRequest request,
>                           HttpServletResponse response)
>                   throws ServletException, IOException {
>
>        DynaValidatorForm hrsForm = (DynaValidatorForm) form;
>       request.setAttribute("hrs", gethrs(hrsForm) );
>        return mapping.findForward("success");
>    }
>
>private ArrayList getAdminHrs(DynaValidatorForm hrsForm) {
>        hrsForm.set("loans",3);
>        hrsForm.set("deposits",5);
>
>
>        ArrayList hrs = new ArrayList();
>
>        hrs .add(hrsForm.get("loans"));
>        hrs.add(hrsForm.get("deposits"));
>
>        return hrs;
>    }
>
>In Jsp
>...............
>...........
>
>           <display:table name="hrs" >
>            <display:column property="" /> ---------------------- not sure 
>how to get this value
>          </display:table>
>
>.....................
>....................
>
>
>IS this the right way of doing this? I am stuck here in jsp not knowing 
>what to do.
>
>Thanks.
>
>_________________________________________________________________
>Don’t just search. Find. Check out the new MSN Search! 
>http://search.msn.click-url.com/go/onm00200636ave/direct/01/
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


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


Re: design question --- struts & displaytag

Posted by fea jabi <zy...@hotmail.com>.
thankyou for your responses.


>From: Dave Newton <ne...@pingsite.com>
>Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
>To: Struts Users Mailing List <us...@struts.apache.org>
>Subject: Re: design question --- struts & displaytag
>Date: Thu, 01 Dec 2005 09:44:38 -0500
>
>fea jabi wrote:
>
>>can someone help me with this please?
>
>What are you doing this for? In other words, is this for your job, school 
>work, etc.?
>
>For displaytag questions you'll want to look at the displaytag docs or 
>utilize their mailing list.
>
>Dave
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>

_________________________________________________________________
Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ 
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


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


Re: design question --- struts & displaytag

Posted by Dave Newton <ne...@pingsite.com>.
fea jabi wrote:

> can someone help me with this please?

What are you doing this for? In other words, is this for your job, 
school work, etc.?

For displaytag questions you'll want to look at the displaytag docs or 
utilize their mailing list.

Dave



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


Re: design question --- struts & displaytag

Posted by Matt Morton <ma...@gmail.com>.
You will place the name of the properties asscoiated with hrs bean, 
So if it has a property called name then place "name" in there.  You
can also break open the tag a bit and use the follwing syntax
<display:column>${hrs.name}</display:column>

Then you can manipulate the value like you want.  This is off the top
of my head so double check it with the displaytag docs.

Matt Morton

On 12/1/05, fea jabi <zy...@hotmail.com> wrote:
> can someone help me with this please?
>
> Thanks.
>
>
> >From: "fea jabi" <zy...@hotmail.com>
> >Reply-To: "Struts Users Mailing List" <us...@struts.apache.org>
> >To: user@struts.apache.org
> >Subject: design question --- struts & displaytag
> >Date: Wed, 30 Nov 2005 16:02:26 -0500
> >
> >Have a table as below -- will be using displaytag for this.
> >
> >              Hrs
> >Loans          3
> >deposit        5
> >
> >
> >For this I created a DynaValidatorForm with
> >loans, deposits as it's form properties.
> >
> ><form-bean name="HoursForm"
> >type="org.apache.struts.validator.DynaValidatorForm" dynamic="true">
> >         <form-property name="loans" type="java.lang.Integer"/>
> >         <form-property name="deposits" type="java.lang.Integer"/>
> >    </form-bean>
> >
> ><action
> >        path="/PrepareHoursAction"
> >        type="com.actions.PrepareHoursAction"
> >        name="HoursForm"
> >        scope="session">
> >        <forward name="success" path="/Hours.jsp" redirect="false"/>
> >     </action>
> >
> >In action
> >
> >public ActionForward execute(ActionMapping mapping,
> >                           ActionForm form,
> >                           HttpServletRequest request,
> >                           HttpServletResponse response)
> >                   throws ServletException, IOException {
> >
> >        DynaValidatorForm hrsForm = (DynaValidatorForm) form;
> >       request.setAttribute("hrs", gethrs(hrsForm) );
> >        return mapping.findForward("success");
> >    }
> >
> >private ArrayList getAdminHrs(DynaValidatorForm hrsForm) {
> >        hrsForm.set("loans",3);
> >        hrsForm.set("deposits",5);
> >
> >
> >        ArrayList hrs = new ArrayList();
> >
> >        hrs .add(hrsForm.get("loans"));
> >        hrs.add(hrsForm.get("deposits"));
> >
> >        return hrs;
> >    }
> >
> >In Jsp
> >...............
> >...........
> >
> >           <display:table name="hrs" >
> >            <display:column property="" /> ---------------------- not sure
> >how to get this value
> >          </display:table>
> >
> >.....................
> >....................
> >
> >
> >IS this the right way of doing this? I am stuck here in jsp not knowing
> >what to do.
> >
> >Thanks.
> >
> >_________________________________________________________________
> >Don't just search. Find. Check out the new MSN Search!
> >http://search.msn.click-url.com/go/onm00200636ave/direct/01/
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >For additional commands, e-mail: user-help@struts.apache.org
> >
>
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today - it's FREE!
> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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