You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Siva Gurusamy <si...@ivycomptech.com> on 2007/02/27 06:20:00 UTC

Ajax Requirement

Hi,

 

I am new to Struts 2. I have following requirement on Ajax. Can somebody
explain me how to implement this requirement?

 

There is form in which there are 2 selects. One is a master select and other
is child select whose values changes based on master select. I want to
implement in Ajax. This is similar to having 2 selects one with Country and
other with states. Based on selection of Country, values in state select
changes.  There are also other fields in the form which will be submitted
when all the fields are entered properly.

 

Thanks

siva


Re: [S2] Ajax Requirement

Posted by Tim Azzopardi <ti...@tigerfive.com>.
i dont think struts2 provides any specific support for this. DWR (not part of
struts2) is very good at doing what you describe if you need to go to the
server to get the States list each time you change the Country. 


siva-2 wrote:
> 
> Hi,
> 
> I am new to Struts 2. I have following requirement on Ajax. Can somebody
> explain me how to implement this requirement?
> 
> 
> There is form in which there are 2 selects. One is a master select and
> other
> is child select whose values changes based on master select. I want to
> implement in Ajax. This is similar to having 2 selects one with Country
> and
> other with states. Based on selection of Country, values in state select
> changes.  There are also other fields in the form which will be submitted
> when all the fields are entered properly.
> 
>  
> 
> Thanks
> 
> siva
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Ajax-Requirement-tf3298487.html#a9181777
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Ajax Requirement

Posted by robin bajaj <ro...@gmail.com>.
Another good online example using JWP
http://www.learntechnology.net/content/ajax/ajax_select_alter.jsp

On 2/28/07, Siva Gurusamy <si...@ivycomptech.com> wrote:
>
> Thanks for the reply.
>
> Can you please tell me which cookbook example which you are referring.
>
> I went through showcase.war, there was doubleselect which was closest to
> my
> requirement, but, it doesn't hit the server for change in master select.
> But, in my case I want some sql query to be executed to find the result of
> child select.
>
> Is there any similar example anywhere which I can refer?
>
> Thanks
> siva
>
> -----Original Message-----
> From: Frank W. Zammetti [mailto:fzlists@omnytex.com]
> Sent: Tuesday, February 27, 2007 7:52 PM
> To: Struts Users Mailing List
> Subject: Re: Ajax Requirement
>
> JWP doesn't offer ready-made components such as this (yet!!), but it
> *does* make developing them very simple (and without you having to code
> Javascript usually)... this particular case is actually one of our
> cookbook examples, so I suppose you could in fact say it offer this
> particular item :)
>
> Frank
>
> Musachy Barroso wrote:
> > If you are using the "autocompleter" tag, this is done already, and
> > there is
> > an example on showcase. If not, you will have to do everything my hand,
> for
> > which I would recommend using a framework that already has it, like
> > AjaxTags, not sure if Java Web Parts has something like this also,
> Frank?
> >
> > regards
> > musachy
> >
> > On 2/27/07, Siva Gurusamy <si...@ivycomptech.com> wrote:
> >>
> >> Hi,
> >>
> >>
> >>
> >> I am new to Struts 2. I have following requirement on Ajax. Can
> somebody
> >> explain me how to implement this requirement?
> >>
> >>
> >>
> >> There is form in which there are 2 selects. One is a master select and
> >> other
> >> is child select whose values changes based on master select. I want to
> >> implement in Ajax. This is similar to having 2 selects one with Country
> >> and
> >> other with states. Based on selection of Country, values in state
> select
> >> changes.  There are also other fields in the form which will be
> submitted
> >> when all the fields are entered properly.
> >>
> >>
> >>
> >> Thanks
> >>
> >> siva
> >>
> >>
> >
> >
>
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
> AIM/Yahoo: fzammetti
> MSN: fzammetti@hotmail.com
> Author of "Practical Ajax Projects With Java Technology"
>   (2006, Apress, ISBN 1-59059-695-1)
> Java Web Parts - http://javawebparts.sourceforge.net
>   Supplying the wheel, so you don't have to reinvent it!
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Ajax Requirement

Posted by Musachy Barroso <mu...@gmail.com>.
In the ajax section(in showcase), look for the Autocompleter Tag. Also here:

http://struts.apache.org/2.x/docs/ajax-tags.html

musachy

On 2/28/07, Siva Gurusamy <si...@ivycomptech.com> wrote:
>
> Thanks for the reply.
>
> Can you please tell me which cookbook example which you are referring.
>
> I went through showcase.war, there was doubleselect which was closest to
> my
> requirement, but, it doesn't hit the server for change in master select.
> But, in my case I want some sql query to be executed to find the result of
> child select.
>
> Is there any similar example anywhere which I can refer?
>
> Thanks
> siva
>
> -----Original Message-----
> From: Frank W. Zammetti [mailto:fzlists@omnytex.com]
> Sent: Tuesday, February 27, 2007 7:52 PM
> To: Struts Users Mailing List
> Subject: Re: Ajax Requirement
>
> JWP doesn't offer ready-made components such as this (yet!!), but it
> *does* make developing them very simple (and without you having to code
> Javascript usually)... this particular case is actually one of our
> cookbook examples, so I suppose you could in fact say it offer this
> particular item :)
>
> Frank
>
> Musachy Barroso wrote:
> > If you are using the "autocompleter" tag, this is done already, and
> > there is
> > an example on showcase. If not, you will have to do everything my hand,
> for
> > which I would recommend using a framework that already has it, like
> > AjaxTags, not sure if Java Web Parts has something like this also,
> Frank?
> >
> > regards
> > musachy
> >
> > On 2/27/07, Siva Gurusamy <si...@ivycomptech.com> wrote:
> >>
> >> Hi,
> >>
> >>
> >>
> >> I am new to Struts 2. I have following requirement on Ajax. Can
> somebody
> >> explain me how to implement this requirement?
> >>
> >>
> >>
> >> There is form in which there are 2 selects. One is a master select and
> >> other
> >> is child select whose values changes based on master select. I want to
> >> implement in Ajax. This is similar to having 2 selects one with Country
> >> and
> >> other with states. Based on selection of Country, values in state
> select
> >> changes.  There are also other fields in the form which will be
> submitted
> >> when all the fields are entered properly.
> >>
> >>
> >>
> >> Thanks
> >>
> >> siva
> >>
> >>
> >
> >
>
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
> AIM/Yahoo: fzammetti
> MSN: fzammetti@hotmail.com
> Author of "Practical Ajax Projects With Java Technology"
>   (2006, Apress, ISBN 1-59059-695-1)
> Java Web Parts - http://javawebparts.sourceforge.net
>   Supplying the wheel, so you don't have to reinvent it!
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

RE: Ajax Requirement

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
I was referring to the JWP cookbook actually :)

JWP, short for Java Web Parts, can be found here:

http://javawebparts.sourceforge.net

The part you will be most interested in for this is APT, the AjaxParts
Taglib:

http://javawebparts.sourceforge.net/javadocs/javawebparts/ajaxparts/taglib/package-summary.html

The cookbook, where APT is used to do a dynamic double-select as you
describe is here:

http://sourceforge.net/project/showfiles.php?group_id=140728&package_id=167877

Frank


-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM/Yahoo: fzammetti
MSN: fzammetti@hotmail.com
Author of "Practical Ajax Projects With Java Technology"
 (2006, Apress, ISBN 1-59059-695-1)
Java Web Parts - http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!

On Wed, February 28, 2007 3:11 am, Siva Gurusamy wrote:
> Thanks for the reply.
>
> Can you please tell me which cookbook example which you are referring.
>
> I went through showcase.war, there was doubleselect which was closest to
> my
> requirement, but, it doesn't hit the server for change in master select.
> But, in my case I want some sql query to be executed to find the result of
> child select.
>
> Is there any similar example anywhere which I can refer?
>
> Thanks
> siva
>
> -----Original Message-----
> From: Frank W. Zammetti [mailto:fzlists@omnytex.com]
> Sent: Tuesday, February 27, 2007 7:52 PM
> To: Struts Users Mailing List
> Subject: Re: Ajax Requirement
>
> JWP doesn't offer ready-made components such as this (yet!!), but it
> *does* make developing them very simple (and without you having to code
> Javascript usually)... this particular case is actually one of our
> cookbook examples, so I suppose you could in fact say it offer this
> particular item :)
>
> Frank
>
> Musachy Barroso wrote:
>> If you are using the "autocompleter" tag, this is done already, and
>> there is
>> an example on showcase. If not, you will have to do everything my hand,
> for
>> which I would recommend using a framework that already has it, like
>> AjaxTags, not sure if Java Web Parts has something like this also,
>> Frank?
>>
>> regards
>> musachy
>>
>> On 2/27/07, Siva Gurusamy <si...@ivycomptech.com> wrote:
>>>
>>> Hi,
>>>
>>>
>>>
>>> I am new to Struts 2. I have following requirement on Ajax. Can
>>> somebody
>>> explain me how to implement this requirement?
>>>
>>>
>>>
>>> There is form in which there are 2 selects. One is a master select and
>>> other
>>> is child select whose values changes based on master select. I want to
>>> implement in Ajax. This is similar to having 2 selects one with Country
>>> and
>>> other with states. Based on selection of Country, values in state
>>> select
>>> changes.  There are also other fields in the form which will be
>>> submitted
>>> when all the fields are entered properly.
>>>
>>>
>>>
>>> Thanks
>>>
>>> siva
>>>
>>>
>>
>>
>
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
> AIM/Yahoo: fzammetti
> MSN: fzammetti@hotmail.com
> Author of "Practical Ajax Projects With Java Technology"
>   (2006, Apress, ISBN 1-59059-695-1)
> Java Web Parts - http://javawebparts.sourceforge.net
>   Supplying the wheel, so you don't have to reinvent it!
>
>
>
>
> ---------------------------------------------------------------------
> 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


RE: Ajax Requirement

Posted by Siva Gurusamy <si...@ivycomptech.com>.
Thanks for the reply.

Can you please tell me which cookbook example which you are referring.

I went through showcase.war, there was doubleselect which was closest to my
requirement, but, it doesn't hit the server for change in master select.
But, in my case I want some sql query to be executed to find the result of
child select. 

Is there any similar example anywhere which I can refer?

Thanks
siva

-----Original Message-----
From: Frank W. Zammetti [mailto:fzlists@omnytex.com] 
Sent: Tuesday, February 27, 2007 7:52 PM
To: Struts Users Mailing List
Subject: Re: Ajax Requirement

JWP doesn't offer ready-made components such as this (yet!!), but it 
*does* make developing them very simple (and without you having to code 
Javascript usually)... this particular case is actually one of our 
cookbook examples, so I suppose you could in fact say it offer this 
particular item :)

Frank

Musachy Barroso wrote:
> If you are using the "autocompleter" tag, this is done already, and 
> there is
> an example on showcase. If not, you will have to do everything my hand,
for
> which I would recommend using a framework that already has it, like
> AjaxTags, not sure if Java Web Parts has something like this also, Frank?
> 
> regards
> musachy
> 
> On 2/27/07, Siva Gurusamy <si...@ivycomptech.com> wrote:
>>
>> Hi,
>>
>>
>>
>> I am new to Struts 2. I have following requirement on Ajax. Can somebody
>> explain me how to implement this requirement?
>>
>>
>>
>> There is form in which there are 2 selects. One is a master select and
>> other
>> is child select whose values changes based on master select. I want to
>> implement in Ajax. This is similar to having 2 selects one with Country
>> and
>> other with states. Based on selection of Country, values in state select
>> changes.  There are also other fields in the form which will be submitted
>> when all the fields are entered properly.
>>
>>
>>
>> Thanks
>>
>> siva
>>
>>
> 
> 

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM/Yahoo: fzammetti
MSN: fzammetti@hotmail.com
Author of "Practical Ajax Projects With Java Technology"
  (2006, Apress, ISBN 1-59059-695-1)
Java Web Parts - http://javawebparts.sourceforge.net
  Supplying the wheel, so you don't have to reinvent it!




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


Re: Ajax Requirement

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
JWP doesn't offer ready-made components such as this (yet!!), but it 
*does* make developing them very simple (and without you having to code 
Javascript usually)... this particular case is actually one of our 
cookbook examples, so I suppose you could in fact say it offer this 
particular item :)

Frank

Musachy Barroso wrote:
> If you are using the "autocompleter" tag, this is done already, and 
> there is
> an example on showcase. If not, you will have to do everything my hand, for
> which I would recommend using a framework that already has it, like
> AjaxTags, not sure if Java Web Parts has something like this also, Frank?
> 
> regards
> musachy
> 
> On 2/27/07, Siva Gurusamy <si...@ivycomptech.com> wrote:
>>
>> Hi,
>>
>>
>>
>> I am new to Struts 2. I have following requirement on Ajax. Can somebody
>> explain me how to implement this requirement?
>>
>>
>>
>> There is form in which there are 2 selects. One is a master select and
>> other
>> is child select whose values changes based on master select. I want to
>> implement in Ajax. This is similar to having 2 selects one with Country
>> and
>> other with states. Based on selection of Country, values in state select
>> changes.  There are also other fields in the form which will be submitted
>> when all the fields are entered properly.
>>
>>
>>
>> Thanks
>>
>> siva
>>
>>
> 
> 

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM/Yahoo: fzammetti
MSN: fzammetti@hotmail.com
Author of "Practical Ajax Projects With Java Technology"
  (2006, Apress, ISBN 1-59059-695-1)
Java Web Parts - http://javawebparts.sourceforge.net
  Supplying the wheel, so you don't have to reinvent it!

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


Re: Ajax Requirement

Posted by Musachy Barroso <mu...@gmail.com>.
If you are using the "autocompleter" tag, this is done already, and there is
an example on showcase. If not, you will have to do everything my hand, for
which I would recommend using a framework that already has it, like
AjaxTags, not sure if Java Web Parts has something like this also, Frank?

regards
musachy

On 2/27/07, Siva Gurusamy <si...@ivycomptech.com> wrote:
>
> Hi,
>
>
>
> I am new to Struts 2. I have following requirement on Ajax. Can somebody
> explain me how to implement this requirement?
>
>
>
> There is form in which there are 2 selects. One is a master select and
> other
> is child select whose values changes based on master select. I want to
> implement in Ajax. This is similar to having 2 selects one with Country
> and
> other with states. Based on selection of Country, values in state select
> changes.  There are also other fields in the form which will be submitted
> when all the fields are entered properly.
>
>
>
> Thanks
>
> siva
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd