struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "bphillips@ku.edu" <bphill...@ku.edu>
Subject Freemarker Template Issue For Select Tag When Multiple is True
Date Wed, 31 Jul 2013 14:22:56 GMT
Please see:  https://issues.apache.org/jira/browse/WW-4153 which I'm working
on.

I thought about modifying template/simple/select.ftl to:

<#assign i = 1 >
<#if parameters.multiple?default(false)>
  <#if (parameters.id?? && parameters.name??)>
    <input type="hidden" id="__multiselect_${parameters.id?html}"
name="__multiselect_${parameters.name?html}" value=""<#rt/>
  </#if>
  <#if (parameters.id?? && !parameters.name??)>
    <input type="hidden" id="__multiselect_${parameters.id?html}"
name="__multiselect_${parameters.id?html}" value=""<#rt/>
  </#if>
  <#if ( !parameters.id?? && parameters.name??)>
    <input type="hidden" id="__multiselect_${parameters.id?html}"
name="__multiselect_${parameters.id?html}" value=""<#rt/>
  </#if>
  <#if ( !parameters.id?? && !parameters.name??)>
    <input type="hidden" id="__multiselect_${i}" name="__multiselect_${i}"
value=""<#rt/>
    <#assign i = i + 1>
  </#if>
<#if parameters.disabled?default(false)>
 disabled="disabled"<#rt/>
</#if>
 />
</#if>

But I think my solution will not work if the user has 2 or more select
inputs with multiple="true" and no name and no id attribute specified. I
think both would get a name value of __multiselect_1

Any suggestions would be appreciated for how to create a unique id and name
value for the hidden input type  when the user uses a select input type with
multiple="true" and no name and no id attribute is specified.

Bruce




--
View this message in context: http://struts.1045723.n5.nabble.com/Freemarker-Template-Issue-For-Select-Tag-When-Multiple-is-True-tp5713372.html
Sent from the Struts - Dev mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Mime
View raw message