struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jipu Jiang" <>
Subject RE: HELP!!! DoubleSeclect tag with default values
Date Mon, 10 Nov 2008 17:33:00 GMT
Hi Felippe,

Thank you so much for the response. Sure, here is the code:


<s:form id="editRecordForm" action="updateRecord" theme="simple">
	<table class="query-page-table">
			<s:iterator value="sections" id="sec"
				<table class="section-table">
						<td colspan="3">
<s:property value="name" />

					<s:iterator value="parameters"
id="para" status="paras">
<s:property value="label" />
test="type == \"menu\"">
<s:set name="menuoptions" value="menu.menuoptions"></s:set>
<s:set name="tertiaryParamName" value="menu.tertiaryParamName"></s:set>
<s:if test="menu.tertiary == 1">
<s:doubleselect name="%{'identifier.' + paramName}"
headerKey="" headerValue="--- Please Select ---"
list="menu.menuoptions" listKey="value" listValue="value"
doubleId="%{'editRecordForm_identifier_' + menu.tertiaryParamName}"
doubleName="%{'identifier.' + menu.tertiaryParamName}"
doubleList="tertiaryoptions" doubleListKey="name"
doubleListValue="name" />
<s:select name="%{'identifier.' + paramName}"
listKey="value" label="%{para.label}" list="menu.menuoptions"
listValue="value" emptyOption="false" headerKey=""
headerValue="--- Please Select ---" theme="simple" />

			<td colspan="3" align="right">
				<br />
				<s:submit value="Update Record"
				<s:reset theme="simple"></s:reset>


Here is the updateRecordView Method in the 

	public String updateRecordView() throws Exception {
		try {
			this.sections =
			this.identifier =
			return SUCCESS;
		} catch (CannotCreateTransactionException e) {
Hibernate transaction exception!!! Timeout.");
			return EXPIRE;
		} catch (Exception e) {
			log.error("Exception caught in
			return ERROR;

User access goes to updateRecordView action first, and fetch data from
database. If successful, it goes to the jsp page to show the parameters
and associated values. But the doubleselect tag shows only the value of
fist select box, second box shows the first option in from the list, not
the one suppose to display. 

Any help would be much appreciated. 

Many thanks,

-----Original Message-----
From: Felippe Scheidt [] 
Sent: Monday, November 10, 2008 12:22 PM
To: Struts Users Mailing List
Subject: Re: HELP!!! DoubleSeclect tag with default values

Can you paste your code please?


On Mon, Nov 10, 2008 at 9:04 AM, Jipu Jiang <>

> Dear all,
> I was trying to display a JSP page with some parameters from the
> database. Everything shows up perfectly except the second dropdown
> of the doubleselect tag, which should display the value from java
> but it always shows the first value of the second list.
> For example, the first list contains countries and the second list
> contains cities. E.g. if I select UK from the first select box, the
> second should be London, Birmingham, Edinburgh etc.
> Now the default values of the select boxes depend on what's in the
> database. I can get the first select box to show UK, but the second
> always shows London, which is the first one in the second list.
> it should show other cities based on values in database.
> I guess it's because of javascript. Does anyone know how to deal with
> such problem?
> Also, when I assign values to the doubleHeaderKey and
> of doubleselect tag, the second select box shows no header at all. How
> can I make this work?
> Many thanks in advance,
> Jipu
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message