You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jose4u <cj...@gmail.com> on 2007/10/04 04:22:44 UTC

struts2 issue- not retaining..

In my jsp file i have three<s:select>combo boxes.  1 & 2 needs to be loaded
from the db and the 3rd needs to loaded based on the (2)second combo box
selection. I have implemented in such a way that in my action i have 3
collection objects. Intially b4 moving to jsp iam loading two collection
object values from the db and in the jsp on change event of the (2)second
list  box i am calling the action class again and loading the third
collection object with values but my problem is the previous two collection
object is null. do i need to load the previous two collection objects every
time on calling the action class? Please provide me the solution how to
implement in struts2. 

Thanks in advance 
joseph
-- 
View this message in context: http://www.nabble.com/struts2-%3Cs%3Aselect%3E-issue--not-retaining..-tf4565452.html#a13031516
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: struts2 issue- not retaining..

Posted by Jose4u <cj...@gmail.com>.
thanks  Ramita
Can u send  a sample code and if any help material
and can u provide how it can be done in this implementation.


Ramita Gambhir wrote:
> 
> Hi,
> 
> You can try using DWR for AJAX implementation...Its very easy to use.
> There are few other libraries like prototype.js, DOJO toolkit...I haven't
> used them but you may want to explore them too...
> I have worked on DWR and its really helpful...
> 
> Regards,
> Ramita
> 
> 
> Jose4u wrote:
>> 
>> thank for the reply
>> Since the data is too large, i think its not advisable to load everthing
>> in the session scope.
>> Since like this i have some 4  to 5 combo boxes.
>> 
>> Can you please help me out, how i can do this implementation using AJAX
>> call.
>> 
>> Thanks in advance
>> Joseph
>> 
>> 
>> Zarar Siddiqi wrote:
>>> 
>>> Yeah, you're going to have to load them every time.  You could store
>>> the collections in session or application scope if that's feasible but
>>> other than that you don't really have a choice.  Alternately, I think
>>> the cleanest way of doing this might be to make an Ajax call to load
>>> the third selection instead of reloading your page by submitting to
>>> the action again.
>>> 
>>> If you choose to call the action every time, you can have your action
>>> implement the Preparable interface where you can do the collection
>>> initialization in the prepare() method.
>>> 
>>> Zarar
>>> 
>>> On 10/3/07, Jose4u <cj...@gmail.com> wrote:
>>>>
>>>> In my jsp file i have three<s:select>combo boxes.  1 & 2 needs to be
>>>> loaded
>>>> from the db and the 3rd needs to loaded based on the (2)second combo
>>>> box
>>>> selection. I have implemented in such a way that in my action i have 3
>>>> collection objects. Intially b4 moving to jsp iam loading two
>>>> collection
>>>> object values from the db and in the jsp on change event of the
>>>> (2)second
>>>> list  box i am calling the action class again and loading the third
>>>> collection object with values but my problem is the previous two
>>>> collection
>>>> object is null. do i need to load the previous two collection objects
>>>> every
>>>> time on calling the action class? Please provide me the solution how to
>>>> implement in struts2.
>>>>
>>>> Thanks in advance
>>>> joseph
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/struts2-%3Cs%3Aselect%3E-issue--not-retaining..-tf4565452.html#a13031516
>>>> 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
>>>>
>>>>
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/struts2-%3Cs%3Aselect%3E-issue--not-retaining..-tf4565452.html#a13043130
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: struts2 issue- not retaining..

Posted by Ramita Gambhir <ra...@gmail.com>.
Hi,

You can try using DWR for AJAX implementation...Its very easy to use. There
are few other libraries like prototype.js, DOJO toolkit...I haven't used
them but you may want to explore them too...
I have worked on DWR and its really helpful...

Regards,
Ramita


Jose4u wrote:
> 
> thank for the reply
> Since the data is too large, i think its not advisable to load everthing
> in the session scope.
> Since like this i have some 4  to 5 combo boxes.
> 
> Can you please help me out, how i can do this implementation using AJAX
> call.
> 
> Thanks in advance
> Joseph
> 
> 
> Zarar Siddiqi wrote:
>> 
>> Yeah, you're going to have to load them every time.  You could store
>> the collections in session or application scope if that's feasible but
>> other than that you don't really have a choice.  Alternately, I think
>> the cleanest way of doing this might be to make an Ajax call to load
>> the third selection instead of reloading your page by submitting to
>> the action again.
>> 
>> If you choose to call the action every time, you can have your action
>> implement the Preparable interface where you can do the collection
>> initialization in the prepare() method.
>> 
>> Zarar
>> 
>> On 10/3/07, Jose4u <cj...@gmail.com> wrote:
>>>
>>> In my jsp file i have three<s:select>combo boxes.  1 & 2 needs to be
>>> loaded
>>> from the db and the 3rd needs to loaded based on the (2)second combo box
>>> selection. I have implemented in such a way that in my action i have 3
>>> collection objects. Intially b4 moving to jsp iam loading two collection
>>> object values from the db and in the jsp on change event of the
>>> (2)second
>>> list  box i am calling the action class again and loading the third
>>> collection object with values but my problem is the previous two
>>> collection
>>> object is null. do i need to load the previous two collection objects
>>> every
>>> time on calling the action class? Please provide me the solution how to
>>> implement in struts2.
>>>
>>> Thanks in advance
>>> joseph
>>> --
>>> View this message in context:
>>> http://www.nabble.com/struts2-%3Cs%3Aselect%3E-issue--not-retaining..-tf4565452.html#a13031516
>>> 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
>>>
>>>
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/struts2-%3Cs%3Aselect%3E-issue--not-retaining..-tf4565452.html#a13042330
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: struts2 issue- not retaining..

Posted by Jose4u <cj...@gmail.com>.
thank for the reply
Can you please help me out, how i can do this implementation using AJAX
call.

Thanks in advance
Joseph


Zarar Siddiqi wrote:
> 
> Yeah, you're going to have to load them every time.  You could store
> the collections in session or application scope if that's feasible but
> other than that you don't really have a choice.  Alternately, I think
> the cleanest way of doing this might be to make an Ajax call to load
> the third selection instead of reloading your page by submitting to
> the action again.
> 
> If you choose to call the action every time, you can have your action
> implement the Preparable interface where you can do the collection
> initialization in the prepare() method.
> 
> Zarar
> 
> On 10/3/07, Jose4u <cj...@gmail.com> wrote:
>>
>> In my jsp file i have three<s:select>combo boxes.  1 & 2 needs to be
>> loaded
>> from the db and the 3rd needs to loaded based on the (2)second combo box
>> selection. I have implemented in such a way that in my action i have 3
>> collection objects. Intially b4 moving to jsp iam loading two collection
>> object values from the db and in the jsp on change event of the (2)second
>> list  box i am calling the action class again and loading the third
>> collection object with values but my problem is the previous two
>> collection
>> object is null. do i need to load the previous two collection objects
>> every
>> time on calling the action class? Please provide me the solution how to
>> implement in struts2.
>>
>> Thanks in advance
>> joseph
>> --
>> View this message in context:
>> http://www.nabble.com/struts2-%3Cs%3Aselect%3E-issue--not-retaining..-tf4565452.html#a13031516
>> 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
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/struts2-%3Cs%3Aselect%3E-issue--not-retaining..-tf4565452.html#a13034802
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: struts2 issue- not retaining..

Posted by Zarar Siddiqi <za...@gmail.com>.
Yeah, you're going to have to load them every time.  You could store
the collections in session or application scope if that's feasible but
other than that you don't really have a choice.  Alternately, I think
the cleanest way of doing this might be to make an Ajax call to load
the third selection instead of reloading your page by submitting to
the action again.

If you choose to call the action every time, you can have your action
implement the Preparable interface where you can do the collection
initialization in the prepare() method.

Zarar

On 10/3/07, Jose4u <cj...@gmail.com> wrote:
>
> In my jsp file i have three<s:select>combo boxes.  1 & 2 needs to be loaded
> from the db and the 3rd needs to loaded based on the (2)second combo box
> selection. I have implemented in such a way that in my action i have 3
> collection objects. Intially b4 moving to jsp iam loading two collection
> object values from the db and in the jsp on change event of the (2)second
> list  box i am calling the action class again and loading the third
> collection object with values but my problem is the previous two collection
> object is null. do i need to load the previous two collection objects every
> time on calling the action class? Please provide me the solution how to
> implement in struts2.
>
> Thanks in advance
> joseph
> --
> View this message in context: http://www.nabble.com/struts2-%3Cs%3Aselect%3E-issue--not-retaining..-tf4565452.html#a13031516
> 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
>
>

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