You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by mailtorakeshp <ma...@gmail.com> on 2008/05/28 08:04:05 UTC

optiontransferselect Problem

Hi,
I just started using the optiontransferselect tag and am bugged up with the
following problem.

The selected values for the double list (on the right side) are null in the
action class.

JSP code:


Action Class code:
        private List topCampLog;
        private List topCampFilter;
        private List defaultTopCampLog;
        private List defaultTopCampFilter;

        public List getTopCampLog() {
		return topCampLog;
	}
	public void setTopCampLog(List topCampLog) {
		this.topCampLog = topCampLog;
	}
	public List getTopCampFilter() {
		return topCampFilter;
	}
	public void setTopCampFilter(List topCampFilter) {
		this.topCampFilter = topCampFilter;
	}
	public List getDefaultTopCampLog() {
		return defaultTopCampLog;
	}
	public void setDefaultTopCampLog(List defaultTopCampLog) {
		this.defaultTopCampLog = defaultTopCampLog;
	}
	public List getDefaultTopCampFilter() {
		return defaultTopCampFilter;
	}
	public void setDefaultTopCampFilter(List defaultTopCampFilter) {
		this.defaultTopCampFilter = defaultTopCampFilter;
	}

        public String execute() {
                ......
                do something with the selected values on the right.
                .......
                return SUCCESS;
        }

list is populated from the database without any issues and doubleList is
empty (Just the please select header is present). When I transfer few values
from left to right and submit the page, I cannot find any values for the
selected list, in the action class. ie. getTopCampFilter() and topCampFilter
are null.

Am I missing something here? Why can't I see the selected list in the action
class? Why is it null?
Any kind of help would be greatly appreciated.

Thanks
Rakesh
-- 
View this message in context: http://www.nabble.com/optiontransferselect-Problem-tp17505760p17505760.html
Sent from the Struts - User mailing list archive at Nabble.com.

Re: optiontransferselect Problem

Posted by mailtorakeshp <ma...@gmail.com>.
It's working now. The problem was with the submit button and the javascript.
Usually, all the values in those select boxes should be selected(generated
javascript does that for you) once you click on the submit button; this was
not happening in my case  as I had an onclick event for the form submission,
which was causing the generated javascript to not get executed. Submit
button should be simple enough as follows.
<s:submit action="TestingTool_filter" value="Filter Logs"/>

cheers
Rakesh


mailtorakeshp wrote:
> 
> Hi Sagarlotiya,
> Thanks a lot for the quick reply.
> I am new bee to struts 2 world and do not know much about
> 'paramPrepareParamStack'. I googled for 'paramPrepareParamStack', but no
> luck on (google returned just 4 results, all of them are the replies from
> you :-)) what exactly is meant by this term. Can you please explain what
> it is and how it works and may be a sample code that can resolve my
> issues.
> 
> Thanks
> Rakesh
> 
> 
> sagarlotiya wrote:
>> 
>> hi,
>> Your jsp code looks ok...
>> But when will u submit form and try to set the parameter using getter and
>> setter, be sure that u are using paramPrepareParamStack  other wise it
>> will not set any value on getter and setter.
>> 
>> 
>> mailtorakeshp wrote:
>>> 
>>> Hi,
>>> I just started using the optiontransferselect tag and am bugged up with
>>> the following problem.
>>> 
>>> The selected values for the double list (on the right side) are null in
>>> the action class.
>>> 
>>> JSP code:
>>> 
>>> <s:optiontransferselect 
>>> 	                label="Log Filter for Top Level Campaign"
>>> 	                name="topCampLog"
>>> 	                leftTitle="Elements of Log"
>>> 	                rightTitle="Filtered Elements of Log"
>>> 	                list="defaultTopCampLog"
>>> 	                headerKey="headerKey"
>>> 	                headerValue="--- Please Select ---"
>>> 	                doubleName="topCampFilter"
>>> 	                doubleList="defaultTopCampFilter"
>>> 	                doubleHeaderKey="doubleHeaderKey"
>>> 	                doubleHeaderValue="--- Please Select ---" />
>>> 
>>> Action Class code:
>>> 
>>>         private List topCampLog;
>>>         private List topCampFilter;
>>>         private List defaultTopCampLog;
>>>         private List defaultTopCampFilter;
>>> 
>>>         public List getTopCampLog() {
>>> 		return topCampLog;
>>> 	}
>>> 	public void setTopCampLog(List topCampLog) {
>>> 		this.topCampLog = topCampLog;
>>> 	}
>>> 	public List getTopCampFilter() {
>>> 		return topCampFilter;
>>> 	}
>>> 	public void setTopCampFilter(List topCampFilter) {
>>> 		this.topCampFilter = topCampFilter;
>>> 	}
>>> 	public List getDefaultTopCampLog() {
>>> 		return defaultTopCampLog;
>>> 	}
>>> 	public void setDefaultTopCampLog(List defaultTopCampLog) {
>>> 		this.defaultTopCampLog = defaultTopCampLog;
>>> 	}
>>> 	public List getDefaultTopCampFilter() {
>>> 		return defaultTopCampFilter;
>>> 	}
>>> 	public void setDefaultTopCampFilter(List defaultTopCampFilter) {
>>> 		this.defaultTopCampFilter = defaultTopCampFilter;
>>> 	}
>>> 
>>>         public String execute() {
>>>                 ......
>>>                 do something with the selected values on the right.
>>>                 .......
>>>                 return SUCCESS;
>>>         }
>>> 
>>> list is populated from the database without any issues and doubleList is
>>> empty (Just the please select header is present). When I transfer few
>>> values from left to right and submit the page, I cannot find any values
>>> for the selected list, in the action class. ie. getTopCampFilter() and
>>> topCampFilter are null.
>>> 
>>> Am I missing something here? Why can't I see the selected list in the
>>> action class? Why is it null?
>>> Any kind of help would be greatly appreciated.
>>> 
>>> Thanks
>>> Rakesh
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/optiontransferselect-Problem-tp17505760p17523169.html
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: optiontransferselect Problem

Posted by mailtorakeshp <ma...@gmail.com>.
Hi Sagarlotiya,
Thanks a lot for the quick reply.
I am new bee to struts 2 world and do not know much about
'paramPrepareParamStack'. I googled for 'paramPrepareParamStack', but no
luck on (google returned just 4 results, all of them are the replies from
you :-)) what exactly is meant by this term. Can you please explain what it
is and how it works and may be a sample code that can resolve my issues.

Thanks
Rakesh


sagarlotiya wrote:
> 
> hi,
> Your jsp code looks ok...
> But when will u submit form and try to set the parameter using getter and
> setter, be sure that u are using paramPrepareParamStack  other wise it
> will not set any value on getter and setter.
> 
> 
> mailtorakeshp wrote:
>> 
>> Hi,
>> I just started using the optiontransferselect tag and am bugged up with
>> the following problem.
>> 
>> The selected values for the double list (on the right side) are null in
>> the action class.
>> 
>> JSP code:
>> 
>> <s:optiontransferselect 
>> 	                label="Log Filter for Top Level Campaign"
>> 	                name="topCampLog"
>> 	                leftTitle="Elements of Log"
>> 	                rightTitle="Filtered Elements of Log"
>> 	                list="defaultTopCampLog"
>> 	                headerKey="headerKey"
>> 	                headerValue="--- Please Select ---"
>> 	                doubleName="topCampFilter"
>> 	                doubleList="defaultTopCampFilter"
>> 	                doubleHeaderKey="doubleHeaderKey"
>> 	                doubleHeaderValue="--- Please Select ---" />
>> 
>> Action Class code:
>> 
>>         private List topCampLog;
>>         private List topCampFilter;
>>         private List defaultTopCampLog;
>>         private List defaultTopCampFilter;
>> 
>>         public List getTopCampLog() {
>> 		return topCampLog;
>> 	}
>> 	public void setTopCampLog(List topCampLog) {
>> 		this.topCampLog = topCampLog;
>> 	}
>> 	public List getTopCampFilter() {
>> 		return topCampFilter;
>> 	}
>> 	public void setTopCampFilter(List topCampFilter) {
>> 		this.topCampFilter = topCampFilter;
>> 	}
>> 	public List getDefaultTopCampLog() {
>> 		return defaultTopCampLog;
>> 	}
>> 	public void setDefaultTopCampLog(List defaultTopCampLog) {
>> 		this.defaultTopCampLog = defaultTopCampLog;
>> 	}
>> 	public List getDefaultTopCampFilter() {
>> 		return defaultTopCampFilter;
>> 	}
>> 	public void setDefaultTopCampFilter(List defaultTopCampFilter) {
>> 		this.defaultTopCampFilter = defaultTopCampFilter;
>> 	}
>> 
>>         public String execute() {
>>                 ......
>>                 do something with the selected values on the right.
>>                 .......
>>                 return SUCCESS;
>>         }
>> 
>> list is populated from the database without any issues and doubleList is
>> empty (Just the please select header is present). When I transfer few
>> values from left to right and submit the page, I cannot find any values
>> for the selected list, in the action class. ie. getTopCampFilter() and
>> topCampFilter are null.
>> 
>> Am I missing something here? Why can't I see the selected list in the
>> action class? Why is it null?
>> Any kind of help would be greatly appreciated.
>> 
>> Thanks
>> Rakesh
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/optiontransferselect-Problem-tp17505760p17514423.html
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: optiontransferselect Problem

Posted by sagarlotiya <sa...@aspl.in>.
hi,
Your jsp code looks ok...
But when will u submit form and try to set the parameter using getter and
setter, be sure that u are using paramPrepareParamStack  other wise it will
not set any value on getter and setter.


mailtorakeshp wrote:
> 
> Hi,
> I just started using the optiontransferselect tag and am bugged up with
> the following problem.
> 
> The selected values for the double list (on the right side) are null in
> the action class.
> 
> JSP code:
> 
> <s:optiontransferselect 
> 	                label="Log Filter for Top Level Campaign"
> 	                name="topCampLog"
> 	                leftTitle="Elements of Log"
> 	                rightTitle="Filtered Elements of Log"
> 	                list="defaultTopCampLog"
> 	                headerKey="headerKey"
> 	                headerValue="--- Please Select ---"
> 	                doubleName="topCampFilter"
> 	                doubleList="defaultTopCampFilter"
> 	                doubleHeaderKey="doubleHeaderKey"
> 	                doubleHeaderValue="--- Please Select ---" />
> 
> Action Class code:
> 
>         private List topCampLog;
>         private List topCampFilter;
>         private List defaultTopCampLog;
>         private List defaultTopCampFilter;
> 
>         public List getTopCampLog() {
> 		return topCampLog;
> 	}
> 	public void setTopCampLog(List topCampLog) {
> 		this.topCampLog = topCampLog;
> 	}
> 	public List getTopCampFilter() {
> 		return topCampFilter;
> 	}
> 	public void setTopCampFilter(List topCampFilter) {
> 		this.topCampFilter = topCampFilter;
> 	}
> 	public List getDefaultTopCampLog() {
> 		return defaultTopCampLog;
> 	}
> 	public void setDefaultTopCampLog(List defaultTopCampLog) {
> 		this.defaultTopCampLog = defaultTopCampLog;
> 	}
> 	public List getDefaultTopCampFilter() {
> 		return defaultTopCampFilter;
> 	}
> 	public void setDefaultTopCampFilter(List defaultTopCampFilter) {
> 		this.defaultTopCampFilter = defaultTopCampFilter;
> 	}
> 
>         public String execute() {
>                 ......
>                 do something with the selected values on the right.
>                 .......
>                 return SUCCESS;
>         }
> 
> list is populated from the database without any issues and doubleList is
> empty (Just the please select header is present). When I transfer few
> values from left to right and submit the page, I cannot find any values
> for the selected list, in the action class. ie. getTopCampFilter() and
> topCampFilter are null.
> 
> Am I missing something here? Why can't I see the selected list in the
> action class? Why is it null?
> Any kind of help would be greatly appreciated.
> 
> Thanks
> Rakesh
> 

-- 
View this message in context: http://www.nabble.com/optiontransferselect-Problem-tp17505760p17506115.html
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