Anissa Lam wrote:
> Hi Ken,
>
> I have some question regarding porting the xml file from JATO
> framework to jsftemplating.
>
> The following is very common in the view descriptor xml files using
> the jato framework.
>
> <function name="doSomething"
>
> className="com.sun.enterprise.tools.admingui.handlers.AMXHandler"
> methodName="doSomething">
> <inputDef name="param1" type="String" />
> <inputDef name="param2" type="[Ljava.lang.String;" />
> <outputDef name="retValue1" type="String" />
> <outputDef name="retValue2" type="[Ljava.lang.String;" />
> </function>
>
> <parameter name="obj" value="com.sun.xyz" />
> <parameter name="displayNames">
> <values value="name" /> <values
> value="weight" /> <values value="configRef" />
> </parameter>
> <call name="doSomething">
> <input name="param1" value="$parameter(obj)" />
> <input name="param2" value="$parameter(displayNames)">
> <output name="retValue1" key="config" />
> <output name="retValue2" key="names" />
> </call>
>
>
> - can we specify a parameter and use it throughout the jsf file ? if
> so, whats the syntax ?
I didn't have support for this in the custom EL (and JSF's EL can't even
almost handle this!). I just now added support. In the JSFTemplating
project, values set on LayoutComponents are called "options"... so I
made the syntax: $option{key}.
> - can the parameter be an array ? just like the displayNames above ?
The XML syntax does have a way to define a List:
<option name="key">
<list value="value1" />
<list value="value2" />
...
</option>
The template format currently does *not* have support for defining a
List object. This is primarily b/c I haven't decided on a syntax for
defining a list. Do you have a suggestion?
One work-a-round for this would be to use a handler to populate the
value you want. Another work-a-round would be to define the value in a
backing bean and use a JSF EL binding to it (i.e. #{bean.value}). This
could even be put in the application scope if it is shared and
initialized at startup if you want to avoid writing a separate bean class.
> - If we cannot use parameter, can we at least pass an array as the
> input to a handler ? I am not sure about the syntax.
> If you can show how the above code will look like in jsftemplating,
> that will be great.
I am willing to add support for this (it's not hard)... but I need to
decide on a syntax. :) I'd like your feedback (or anyone else that has
an opinion) on how it should look.
Thanks!
Ken