2013/7/31 [email protected] <[email protected]>:
> 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.

Maybe do it simple - if there is neither "id" nor "name" just use
default("") as it doesn't make sense to generate hidden fields for
tags that wont be send back to server. Or even add global <#if> to
remove the whole section.


Regards
-- 
Ɓukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to