Otto, Frank wrote:
hi,

how can I build a ognl variable dynamic? Example:

I have an iteration with different url-definitions, because I need always 
another parameter (index):

<s:iterator value="myList" id="list" status="stat">

...
        <s:url id="myMethod%{#stat.index}" action="test_myMethod.action">
            <s:param name="myParam" value="%{#stat.index}"/>
        </s:url>

        <s:autocompleter ...
                href="%{myMethod%{#stat.index}}"/>  <--- I need here: 
%{myMethod0}, %{myMethod1}, ..., but it wasn't evaluated


</s:iterator>

Has someone an idea?

Firstly, it's not valid to nest OGNL expression (%{...%{...}}) but you can get the result you want something like this (untested):

  href="%{'myMethod'+#stat.index}"

This may also work:

  href="myMethod%{#stat.index}"

However, based on the code you posted, I suspect this isn't what you want; aren't you trying to set the autocompleter's href to the URL you built with s:url above? In that case, just simplify:

  <s:iterator ...>
    <s:url id="url" ...>
    <s:autocompleter href="%{#url}" ...

You don't need the identifier to be dynamic.

HTH,

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to