You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by deepak va <de...@hotmail.com> on 2007/06/06 12:03:41 UTC

Passing a list from VM file to action class

Hi,

Please sugest how to send List from the vm file to the action class.

We get the records from the database as a list in the VM file and display in 
textboxes using <table> tags.

Each record is provided with a checkbox. When the user checks few of them 
and clicks update button all the records corresponding to the checkbox need 
to be submitted to the action class.
They would then be inserted into the database.


Regards
Deepak

_________________________________________________________________
Catch all the cricketing action right here. Live score, match reports, 
photos et al. http://content.msn.co.in/Sports/Cricket/Default.aspx


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


Re: Passing a list from VM file to action class

Posted by Will Glass-Husain <wg...@gmail.com>.
Sure, why not?  All Velocity does is generate HTML files.  Anything you can
do with HTML you can do with a Velocity generated HTML file.

WILL

On 6/7/07, deepak va <de...@hotmail.com> wrote:
>
> Hi Will,
>
> Thanks a lot. Please let me know if it is correct to use JavaScript for
> client side validation of the form feilds in velocity VM files.
>
> Regards
> Deepak
>
>
> >From: "Will Glass-Husain" <wg...@gmail.com>
> >Reply-To: "Velocity Users List" <us...@velocity.apache.org>
> >To: "Velocity Users List" <us...@velocity.apache.org>
> >Subject: Re: Passing a list from VM file to action class
> >Date: Wed, 6 Jun 2007 08:38:57 -0700
> >
> >Hi Deepak,
> >
> >Not really a velocity issue, more of a general web/MVC issue.  The exact
> >way
> >to do this depends on what framework you are using (Struts, Turbine,
> >VelocityViewServlet, your own).
> >
> >When I'm using my own servlet, I usually set the name of the checkbox to
> >"id" and the value to the record id.  When the page is submitted, my
> >servlet
> >collects all the values for the parameter "id" and does a select
> statement
> >with an IN operator.
> >
> >WILL
> >
> >On 6/6/07, deepak va <de...@hotmail.com> wrote:
> >>
> >>Hi,
> >>
> >>Please sugest how to send List from the vm file to the action class.
> >>
> >>We get the records from the database as a list in the VM file and
> display
> >>in
> >>textboxes using <table> tags.
> >>
> >>Each record is provided with a checkbox. When the user checks few of
> them
> >>and clicks update button all the records corresponding to the checkbox
> >>need
> >>to be submitted to the action class.
> >>They would then be inserted into the database.
> >>
> >>
> >>Regards
> >>Deepak
> >>
> >>_________________________________________________________________
> >>Catch all the cricketing action right here. Live score, match reports,
> >>photos et al. http://content.msn.co.in/Sports/Cricket/Default.aspx
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> >>For additional commands, e-mail: user-help@velocity.apache.org
> >>
> >>
> >
> >
> >--
> >Forio Business Simulations
> >
> >Will Glass-Husain
> >wglass@forio.com
> >www.forio.com
>
> _________________________________________________________________
> Voice your questions and our experts will answer them
> http://content.msn.co.in/Lifestyle/AskExpert/Default01.htm
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>


-- 
Forio Business Simulations

Will Glass-Husain
wglass@forio.com
www.forio.com

Re: Passing a list from VM file to action class

Posted by deepak va <de...@hotmail.com>.
Hi Will,

Thanks a lot. Please let me know if it is correct to use JavaScript for 
client side validation of the form feilds in velocity VM files.

Regards
Deepak


>From: "Will Glass-Husain" <wg...@gmail.com>
>Reply-To: "Velocity Users List" <us...@velocity.apache.org>
>To: "Velocity Users List" <us...@velocity.apache.org>
>Subject: Re: Passing a list from VM file to action class
>Date: Wed, 6 Jun 2007 08:38:57 -0700
>
>Hi Deepak,
>
>Not really a velocity issue, more of a general web/MVC issue.  The exact 
>way
>to do this depends on what framework you are using (Struts, Turbine,
>VelocityViewServlet, your own).
>
>When I'm using my own servlet, I usually set the name of the checkbox to
>"id" and the value to the record id.  When the page is submitted, my 
>servlet
>collects all the values for the parameter "id" and does a select statement
>with an IN operator.
>
>WILL
>
>On 6/6/07, deepak va <de...@hotmail.com> wrote:
>>
>>Hi,
>>
>>Please sugest how to send List from the vm file to the action class.
>>
>>We get the records from the database as a list in the VM file and display
>>in
>>textboxes using <table> tags.
>>
>>Each record is provided with a checkbox. When the user checks few of them
>>and clicks update button all the records corresponding to the checkbox
>>need
>>to be submitted to the action class.
>>They would then be inserted into the database.
>>
>>
>>Regards
>>Deepak
>>
>>_________________________________________________________________
>>Catch all the cricketing action right here. Live score, match reports,
>>photos et al. http://content.msn.co.in/Sports/Cricket/Default.aspx
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
>>For additional commands, e-mail: user-help@velocity.apache.org
>>
>>
>
>
>--
>Forio Business Simulations
>
>Will Glass-Husain
>wglass@forio.com
>www.forio.com

_________________________________________________________________
Voice your questions and our experts will answer them 
http://content.msn.co.in/Lifestyle/AskExpert/Default01.htm


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


Re: Passing a list from VM file to action class

Posted by Will Glass-Husain <wg...@gmail.com>.
Hi Deepak,

Not really a velocity issue, more of a general web/MVC issue.  The exact way
to do this depends on what framework you are using (Struts, Turbine,
VelocityViewServlet, your own).

When I'm using my own servlet, I usually set the name of the checkbox to
"id" and the value to the record id.  When the page is submitted, my servlet
collects all the values for the parameter "id" and does a select statement
with an IN operator.

WILL

On 6/6/07, deepak va <de...@hotmail.com> wrote:
>
> Hi,
>
> Please sugest how to send List from the vm file to the action class.
>
> We get the records from the database as a list in the VM file and display
> in
> textboxes using <table> tags.
>
> Each record is provided with a checkbox. When the user checks few of them
> and clicks update button all the records corresponding to the checkbox
> need
> to be submitted to the action class.
> They would then be inserted into the database.
>
>
> Regards
> Deepak
>
> _________________________________________________________________
> Catch all the cricketing action right here. Live score, match reports,
> photos et al. http://content.msn.co.in/Sports/Cricket/Default.aspx
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>


-- 
Forio Business Simulations

Will Glass-Husain
wglass@forio.com
www.forio.com