struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Example for optgroup doesn't work
Date Mon, 19 Sep 2011 16:45:25 GMT

The example given at the bottom, when translated in to Freemarker tag syntax, doesn't work.
 Here's my FM version:

 < label="My Selection" name="mySelection" 
   list={'SUPERMAN':'Superman', 'SPIDERMAN':'spiderman'} >
<@s.optgroup label="Adult"
    list={'SOUTH_PARK':'South Park'} />
<@s.optgroup label="Japanese"
    list={'POKEMON':'pokemon','DIGIMON':'digimon','SAILORMOON':'Sailormoon'} /> 

This causes the following exception:

freemarker.core.InvalidReferenceException: Expression optGroupInternalListUiBean.parameters.list
is undefined on line 36, column 8 in mx/themes/securelink/optgroup.ftl.
	at freemarker.core.TemplateObject.assertNonNull(
	at freemarker.core.IteratorBlock.accept(
	at freemarker.core.Environment.visit(
	at freemarker.core.MixedContent.accept(
	at freemarker.core.Environment.visit(

If I try and simplify it and use the OGNL syntax I get a different error:
 < label="My Selection" name="mySelection" value="%{'POPEYE'}"
   list="%{#{'SUPERMAN':'Superman', 'SPIDERMAN':'spiderman'}}" >

Caused by: freemarker.core.ParseException: Error on line 29, column 22 in */tests/select-list.ftl
Found string literal: 'SUPERMAN'
Expecting: number in */tests/select-list.ftl
	at freemarker.core.FMParser.notStringLiteral(
	at freemarker.core.FMParser.numberLiteralOnly(

Can anyone provide guidance here for using FM literals with select lists?

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

View raw message