sj:select value problem
Hello, As a beginner in struts field, I send this question to see if I get any help. Here it is. I have a multiple dropdown menu. What I want to do is to pre-select related items based the value passed in. Specifically, I have html:select name=echo multiple=multiple id=pattern0 class=multiselect option value=-1Select keywords/option option/option option value=1 Cool1 Cool/option option value=1 Heat1 Heat/option option value=3 Heat3 Heat/option option value=1 Heat/1 Cool1 Heat/1 Cool/option/select jsp: sj:select href=%{remoteurl_pattern02} id=selectWithReloadTopic_pattern02 formIds=formSelectReload reloadTopics=reloadsecondlist_pattern02 name=echo_pattern02 list=reloadList_pattern02 multiple=true selectable=true cssClass=multiselect dataType=jsonemptyOption=true headerKey=-1headerValue=Select keywords resizableMinHeight=15resizableMaxHeight=20 value=%{patternKeyword2} / and I pass in an array to value. The array has [1 Cool, 1 Heat, 1 Heat/1 Cool]. The array's name is patternKeyword2. When I ran the code, I found that these three items [1 Cool, 1 Heat, 1 Heat/1 Cool] were not selected in the dropdown menu. Anybody knows how to fix this? Thanks so much. David
Re: sj:select value problem
2013/8/6 David Wang dwang...@hotmail.com: Hello, As a beginner in struts field, I send this question to see if I get any help. Here it is. I have a multiple dropdown menu. What I want to do is to pre-select related items based the value passed in. Specifically, I have html:select name=echo multiple=multiple id=pattern0 class=multiselect option value=-1Select keywords/option option/option option value=1 Cool1 Cool/option option value=1 Heat1 Heat/option option value=3 Heat3 Heat/option option value=1 Heat/1 Cool1 Heat/1 Cool/option/select jsp: sj:select href=%{remoteurl_pattern02} id=selectWithReloadTopic_pattern02 formIds=formSelectReload reloadTopics=reloadsecondlist_pattern02 name=echo_pattern02 list=reloadList_pattern02 multiple=true selectable=true cssClass=multiselect dataType=jsonemptyOption=true headerKey=-1headerValue=Select keywords resizableMinHeight=15resizableMaxHeight=20 value=%{patternKeyword2} / and I pass in an array to value. The array has [1 Cool, 1 Heat, 1 Heat/1 Cool]. The array's name is patternKeyword2. When I ran the code, I found that these three items [1 Cool, 1 Heat, 1 Heat/1 Cool] were not selected in the dropdown menu. Anybody knows how to fix this? Do you the Struts 2 jQuery plugin? And some better formatting please :-) Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
struts 1 to struts2 migration.
Hi All, We are migrating from struts1 to struts2. In our pages we have multiple buttons which through struts1 DispatchAction can be guided to different methods in Action class. For that we need minimal changes. Such as In action mapping if we add parameter=action and in JSP if the URL is like x.do?action=method1, it happily directs the control to method1 in Action class. I got the bellow link for struts2, but for that also we need much changes to be done. http://struts.apache.org/development/2.x/docs/multiple-submit-buttons.html Is there any such way we do similar functionality in struts2 with minimal changes. Thanks
sj:a json return result question
Question for Sjquery's sj:a tag as the following s:url id=ajax value=ReportAction/ sj:a id=ajaxlink href=%{ajax} targets=result TOTAL # PARTS /sj:a div id=result s:property value=sum//div public class ReportkeyAction extends extends ActionSupport { private int sum; public int getSum() { return sum; } public void setSum(int sum) { this.sum = sum; } public String execute() throws Exception { sum=310; System.out.println(sum get fired for json, val=+sum); return success; } public String getJSON() throws Exception { System.out.println(json get triggered for json, val=+sum); return execute(); } } the render return result/display is the following TOTAL # PARTS {JSON:success,sum:310} I only expect result of 310 get returned, why heading info also get returned? obvioulsy, s:property value=sum/ even did not working. how can i just display 310 only? thanks in advance john
Re: sj:a json return result question
Configure your result's `root` to be `sum`, otherwise it will serialize the entire action. On Tue, Aug 6, 2013 at 10:31 AM, john lee sh_thorn_b...@yahoo.com wrote: Question for Sjquery's sj:a tag as the following s:url id=ajax value=ReportAction/ sj:a id=ajaxlink href=%{ajax} targets=result TOTAL # PARTS /sj:a div id=result s:property value=sum//div public class ReportkeyAction extends extends ActionSupport { private int sum; public int getSum() { return sum; } public void setSum(int sum) { this.sum = sum; } public String execute() throws Exception {sum=310; System.out.println(sum get fired for json, val=+sum); return success; } public String getJSON() throws Exception { System.out.println(json get triggered for json, val=+sum); return execute(); } } the render return result/display is the following TOTAL # PARTS {JSON:success,sum:310} I only expect result of 310 get returned, why heading info also get returned? obvioulsy, s:property value=sum/ even did not working. how can i just display 310 only? thanks in advance john -- e: davelnew...@gmail.com m: 908-380-8699 s: davelnewton_skype t: @dave_newton https://twitter.com/dave_newton b: Bucky Bits http://buckybits.blogspot.com/ g: davelnewton https://github.com/davelnewton so: Dave Newton http://stackoverflow.com/users/438992/dave-newton
Re: sj:a json return result question
Dave, Thanks your very much, it works very well brw, the book you wrote/published, i had it. john From: Dave Newton davelnew...@gmail.com To: Struts Users Mailing List user@struts.apache.org; john lee sh_thorn_b...@yahoo.com Sent: Tuesday, August 6, 2013 11:26 AM Subject: Re: sj:a json return result question Configure your result's `root` to be `sum`, otherwise it will serialize the entire action. On Tue, Aug 6, 2013 at 10:31 AM, john lee sh_thorn_b...@yahoo.com wrote: Question for Sjquery's sj:a tag as the following s:url id=ajax value=ReportAction/ sj:a id=ajaxlink href=%{ajax} targets=result TOTAL # PARTS /sj:a div id=result s:property value=sum//div public class ReportkeyAction extends extends ActionSupport { private int sum; public int getSum() { return sum; } public void setSum(int sum) { this.sum = sum; } public String execute() throws Exception { sum=310; System.out.println(sum get fired for json, val=+sum); return success; } public String getJSON() throws Exception { System.out.println(json get triggered for json, val=+sum); return execute(); } } the render return result/display is the following TOTAL # PARTS {JSON:success,sum:310} I only expect result of 310 get returned, why heading info also get returned? obvioulsy, s:property value=sum/ even did not working. how can i just display 310 only? thanks in advance john -- e: davelnew...@gmail.com m: 908-380-8699 s: davelnewton_skype t: @dave_newton b: Bucky Bits g: davelnewton so: Dave Newton
RE: sj:select value problem
Hi Lukasz, Thanks a lot for your reply. I use Struts 2 Jquery Plugin. Here is formatted code. html: select name=echo multiple=multiple id=pattern0 class=multiselect option value=-1Select keywords/option option/option option value=1 Cool1 Cool/option option value=1 Heat1 Heat/option option value=3 Heat3 Heat/option option value=1 Heat/1 Cool1 Heat/1 Cool/option /select jsp: sj:select href=%{remoteurl_pattern02} id=selectWithReloadTopic_pattern02 formIds=formSelectReload reloadTopics=reloadsecondlist_pattern02 name=echo_pattern02 list=reloadList_pattern02 multiple=true selectable=true cssClass=multiselect dataType=json emptyOption=true headerKey=-1 headerValue=Select keywords resizableMinHeight=15 resizableMaxHeight=20 value=%{patternKeyword2} / I pass in an array to value. The array has [1 Cool, 1 Heat, 1 Heat/1 Cool]. The array's name is patternKeyword2. When I ran the code, I found that these three items [1 Cool, 1 Heat, 1 Heat/1 Cool] were not selected in the dropdown menu. Any ideas? Thanks so much. From: lukaszlen...@apache.org Date: Tue, 6 Aug 2013 08:29:21 +0200 Subject: Re: sj:select value problem To: user@struts.apache.org 2013/8/6 David Wang dwang...@hotmail.com: Hello, As a beginner in struts field, I send this question to see if I get any help. Here it is. I have a multiple dropdown menu. What I want to do is to pre-select related items based the value passed in. Specifically, I have html:select name=echo multiple=multiple id=pattern0 class=multiselect option value=-1Select keywords/option option/option option value=1 Cool1 Cool/option option value=1 Heat1 Heat/option option value=3 Heat3 Heat/option option value=1 Heat/1 Cool1 Heat/1 Cool/option/select jsp: sj:select href=%{remoteurl_pattern02} id=selectWithReloadTopic_pattern02 formIds=formSelectReload reloadTopics=reloadsecondlist_pattern02 name=echo_pattern02 list=reloadList_pattern02 multiple=true selectable=true cssClass=multiselect dataType=jsonemptyOption=true headerKey=-1headerValue=Select keywords resizableMinHeight=15resizableMaxHeight=20 value=%{patternKeyword2} / and I pass in an array to value. The array has [1 Cool, 1 Heat, 1 Heat/1 Cool]. The array's name is patternKeyword2. When I ran the code, I found that these three items [1 Cool, 1 Heat, 1 Heat/1 Cool] were not selected in the dropdown menu. Anybody knows how to fix this? Do you the Struts 2 jQuery plugin? And some better formatting please :-) Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org