Results 1 to 11 of 11
- 08-12-2010, 06:00 PM #1
Member
- Join Date
- Jan 2010
- Posts
- 90
- Rep Power
- 0
ui development using jstl+jsp+javascript using spring framework.
hi guys,
i m stuck in a ui development using jstl+jsp+javascript using spring framework.
need solution very urgently...plz help.
i have a jsp page where i have two select box..
i have a hashmap<string, hashset> which comes from the server side.
my requirement is to populate the first select box with the keys of the hashmap and the second as the values(hashset) of the corresponding key.
i am able to display the first one;
now, the second select box should get populated with the hashset of the particular key from the map.
the second one should get populated once the user selects any of the options from the first select box; and onChange should display the corresponding values of the map that is a set.
here is my code
the code you see in bold gives me a syntax error.please suggest how can i solve that..any code will be helpful..i have tried calling a javascript function onChange of first one...but no luck :(Java Code:<td align="left"><strong>Environment Component Name:</strong></td> <td align="left"> <form:select path="envCompName" id="envCompName" [B]onchange="<c:set var="set" value="${map.value}" /> "[/B]> <form:option value="-" label="--Please Select Env Component--" /> <c:forEach items="${superPackage.superPackageMap}" var="map" > <form:option value="${map.key}" label="${map.key}" id="envCompNameOpt"/> <form:hidden path="house" id="hiddenSet" value="${map.value}" /> </c:forEach> </form:select> </td> <td align="right"><strong>Environment Name:</strong></td> <td align="right"><form:select path="envName" id="envName" > <form:option value="-" label="--Please Select Environment--" /> <c:forEach items="${set}" var="mySet" > <form:option value="${mySet}" label="${mySet}" id="envCompNameOpt"/> </c:forEach> </form:select></td>
- 08-12-2010, 06:09 PM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Cbani, please don't post unrelated questions in others threads. Start a new thread next time on the correct sub-forum. This time only I'll move this to the correct place.
- 08-12-2010, 06:17 PM #3
Member
- Join Date
- Jan 2010
- Posts
- 90
- Rep Power
- 0
hey sorry Eranga..i was searching for a related thread but when dint get; added here..next time i ll take care of the same... but please provide some solutions
- 08-13-2010, 05:52 AM #4
Member
- Join Date
- Jan 2010
- Posts
- 90
- Rep Power
- 0
any idea guys?
- 08-13-2010, 07:55 AM #5
Member
- Join Date
- Jan 2010
- Posts
- 90
- Rep Power
- 0
hi guys,
now i have modified my code to remove the syntax errors.
Java Code:<tr> <td align="left"><strong>Environment Component Name:</strong></td> <td align="left"> <c:set var="map" value=""/> <form:select path="envCompName" id="envCompName" onchange='" <c:set var='valueSet' value='${map.value}'/> "' > <form:option value="-" label="--Please Select Env Component--" /> <c:forEach items="${superPackage.superPackageMap}" var="map" > <form:option value="${map.key}" label="${map.key}" id="envCompNameOpt"/> </c:forEach> </form:select> </td> <td align="right"><strong>Environment Name:</strong></td> <td align="right"><form:select path="envName" id="envName" > <form:option value="-" label="--Please Select Environment--" /> <c:forEach items="${valueSet}" var="set" > <form:option value="${set}" label="${set}" id="envCompNameOpt"/> </c:forEach> </form:select></td> <td style="padding: 4px 18px 5px; white-space: nowrap;" width="10%"><input type="button" value="Deploy" class="darkBlueButton" onclick="" /></td> </tr>
but my jsp is throwing exception at run time. pls suggest
This attribute is not recognized. <form:select path="envCompName" id="envCompName" onchange='" <c:set var='valueSet' value='${map.value}'/> "' >
This attribute is not recognized. <form:select path="envCompName" id="envCompName" onchange='" <c:set var='valueSet' value='${map.value}'/> "' >
the one you see in bold is where its pointing out
i m really stuck up....pls helpLast edited by Cbani; 08-13-2010 at 07:58 AM.
- 08-15-2010, 04:27 AM #6
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Did you get the same error or a different one, can you post it here?
- 08-15-2010, 09:21 AM #7
Member
- Join Date
- Jan 2010
- Posts
- 90
- Rep Power
- 0
This attribute is not recognized. <form:select path="envCompName" id="envCompName" onchange='" <c:set var='valueSet' value='${map.value}'/> "' >
This attribute is not recognized. <form:select path="envCompName" id="envCompName" onchange='" <c:set var='valueSet' value='${map.value}'/> "' >
This is what i am getting in my jsp...
i found a bad workaround(not suggestable); writing java code inside my jsp.
by this workaround i am able to achieve the functionality i was looking for.
can you suggest any solution wherein there is no java code in jsp. i.e. by using only jsp jstl and javascript?
- 08-15-2010, 03:41 PM #8
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
How did you define the attribute c ?
- 08-15-2010, 07:25 PM #9
Member
- Join Date
- Jan 2010
- Posts
- 90
- Rep Power
- 0
thats a tablib uri prefix for jstl; the problem is not there.
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
the problem is in the below code where i try to embed a jstl tag inside a select tag
<form:select path="envCompName" id="envCompName" onchange='" <c:set var='valueSet' value='${map.value}'/> "' >
this form is a spring form tag as u see below
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>Last edited by Cbani; 08-16-2010 at 06:17 AM.
- 08-16-2010, 06:07 PM #10
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
No, why I ask that is sometime this cause the class-path.
- 08-16-2010, 06:17 PM #11
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Try to set a dummy value and check what's really happen. I'm not sure that your form recognized that onchange.
Similar Threads
-
What is RMI concept in Spring Framework
By Java Tip in forum Spring FrameworkReplies: 0Last Post: 04-02-2008, 10:36 AM -
How to run Queries in Spring framework
By Java Tip in forum Java TipReplies: 0Last Post: 04-01-2008, 10:42 AM -
What is RmiServiceExporter in Spring framework
By JavaBean in forum Java TipReplies: 0Last Post: 10-04-2007, 09:21 PM -
What is RMI concept in Spring Framework
By JavaBean in forum Java TipReplies: 0Last Post: 10-04-2007, 09:21 PM -
What is weaving in Spring Framework
By JavaBean in forum Java TipReplies: 0Last Post: 09-26-2007, 08:30 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks