double select tag
I am trying to get a double select tag to work for the 1st time and am having some problems. The JSP involved comprises a list in the top half of the page where an iterator fetches data from the database which is displayed in the list like so: The bottom half of the screen comprises a form where you can add and edit an item before pressing save which updates the database and re-displays the page with the new or updated item now appearing in the list. The add/edit area looks like so when the page originally loads: Adding an item works OK. I use the following tags in the add/edit area for the 2 fields that are populated via the double select (I have removed some of the options for brevity in this email): s:set name=itemList value=#{'Antiques': {'Antiques'}, 'Bathroom': {'Cosmetics', 'Hamper', 'Lines', 'Medical items', 'Other', 'Scales', 'Shower curtains', 'Sundries'}, 'Garage': {'Hand tools', 'Other', 'Power tools', 'Tool chests', 'Work bench'}}/ s:doubleselect label=Select room and item name=claimContent.itemRoom id=itemRoom emptyOption=true requiredLabel=true list=#itemList.keySet() doubleName=claimContent.itemCategory doubleId=itemCategory doubleEmptyOption=true doubleList=#itemList[top] tooltip=%{getText('claimContent.itemRoom.tooltip')}/ So that all seems OK. But if I want to edit an existing item, then immediately after clicking the Edit link beside some item in the list, the screen looks like so. As you can see the 2nd field in the double-select has not been set correctly and is is showing as nothing with no options to select from. I have to change the 1st field to some other value to get options to appear in the 2nd field. The javascript I use to when the Edit link is clicked looks like: function editPropertyContent(itemRoom, itemCategory, itemDescription, itemReplacement, itemReplacementUrl, itemReplacementValue, itemValidationStatus, itemFulfillmentStatus) { document.getElementById(itemRoom).value = itemRoom; document.getElementById(itemCategory).value = itemCategory; document.getElementById(itemDescription).value = itemDescription; document.getElementById(itemReplacement).value = itemReplacement; document.getElementById(itemReplacementUrl).value = itemReplacementUrl; document.getElementById(itemReplacementValue).value = itemReplacementValue; document.getElementById(itemValidationStatus).value = itemValidationStatus; document.getElementById(itemFulfillmentStatus).value = itemFulfillmentStatus; } That is all a bit long winded - anyway hoping someone can point me in the right direction. Regards - Patrick -- Patrick Kelly PatrickKelly PrincipalConsultant *River**Dynamics* E: patrick.ke...@riverdynamics.com mailto:patrick.ke...@riverdynamics.com W: www.riverdynamics.com http://www.riverdynamics.com/
RE: problem in xml validation
Date: Tue, 17 Feb 2015 21:07:03 +0530 Subject: Re: problem in xml validation From: yaragallamur...@gmail.com To: user@struts.apache.org No dave. It is because in the same Action class i have a validate method. So in this method if validation fails it is showing inpu jsp with the errors. *Thanks and Regards,* Muralidhar Yaragalla. MGwhere is the action java class that dave asked for? MGif you have any backing beans..display those as well? MGwhere is web.xml? MGwhere is struts.xml? MGwhere is the jsp you expect to display? *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/* On Tue, Feb 17, 2015 at 9:03 PM, Dave Newton davelnew...@gmail.com wrote: ... If you want any help, you need to provide actionable information. My first guesses are that you're either missing an `input` definition, or its JSP page isn't where you think it is. On Tue, Feb 17, 2015 at 10:05 AM, Yaragalla Muralidhar yaragallamur...@gmail.com wrote: Hi, I have written AddTestAction.class and placed AddTestAction-validation.xml file in the same package. but the field validations are not happening. i have written int validators. Instead showing validation errors the browser is displaying page not found. if i remove validation xml file everthing is working fine. what could be the problem? do i need to paste the code? *Thanks and Regards,* Muralidhar Yaragalla. *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/* -- 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
problem in xml validation
Hi, I have written AddTestAction.class and placed AddTestAction-validation.xml file in the same package. but the field validations are not happening. i have written int validators. Instead showing validation errors the browser is displaying page not found. if i remove validation xml file everthing is working fine. what could be the problem? do i need to paste the code? *Thanks and Regards,* Muralidhar Yaragalla. *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
Re: problem in xml validation
... If you want any help, you need to provide actionable information. My first guesses are that you're either missing an `input` definition, or its JSP page isn't where you think it is. On Tue, Feb 17, 2015 at 10:05 AM, Yaragalla Muralidhar yaragallamur...@gmail.com wrote: Hi, I have written AddTestAction.class and placed AddTestAction-validation.xml file in the same package. but the field validations are not happening. i have written int validators. Instead showing validation errors the browser is displaying page not found. if i remove validation xml file everthing is working fine. what could be the problem? do i need to paste the code? *Thanks and Regards,* Muralidhar Yaragalla. *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/* -- 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: problem in xml validation
No dave. It is because in the same Action class i have a validate method. So in this method if validation fails it is showing inpu jsp with the errors. *Thanks and Regards,* Muralidhar Yaragalla. *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/* On Tue, Feb 17, 2015 at 9:03 PM, Dave Newton davelnew...@gmail.com wrote: ... If you want any help, you need to provide actionable information. My first guesses are that you're either missing an `input` definition, or its JSP page isn't where you think it is. On Tue, Feb 17, 2015 at 10:05 AM, Yaragalla Muralidhar yaragallamur...@gmail.com wrote: Hi, I have written AddTestAction.class and placed AddTestAction-validation.xml file in the same package. but the field validations are not happening. i have written int validators. Instead showing validation errors the browser is displaying page not found. if i remove validation xml file everthing is working fine. what could be the problem? do i need to paste the code? *Thanks and Regards,* Muralidhar Yaragalla. *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/* -- 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