You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Chris Howe <cj...@yahoo.com> on 2007/04/02 23:41:08 UTC

screen widget set

sorry if this got sent twice...i think the list filters messages with
<> in the subject line so I'm resending...anyway

Is it possible to accomplish something like the following (obviously by
a different means, because this way doesn't work), in a screen widget
definition

<set field="placement" value="4" type="Integer"/>
<set field="liveGrids[${placement}]" from-field="lg"/>

If not, would it be difficult/advisable to add such functionality to
the screen widget?

Re: screen widget set

Posted by Shi Jinghai <sh...@langhua.cn>.
I think this fuction is already there.

In MethodContext.java:
    /** Gets the named value from the environment. Supports the
"." (dot) syntax to access Map members and the
     * "[]" (bracket) syntax to access List entries. This value is
expanded, supporting the insertion of other 
     * environment values using the "${}" notation.
     * 
     * @param key The name of the environment value to get. Can contain
"." and "[]" syntax elements as described above.
     * @return The environment value if found, otherwise null. 
     */
    public Object getEnv(String key) {
        String ekey = this.expandString(key);
        FlexibleMapAccessor fma = new FlexibleMapAccessor(ekey);
        return this.getEnv(fma);
    }
    public Object getEnv(FlexibleMapAccessor fma) {
        return fma.get(this.env);
    }

Regards,

Shi Jinghai/Beijing Langhua Ltd.

在 2007-04-02一的 14:41 -0700,Chris Howe写道:
> sorry if this got sent twice...i think the list filters messages with
> <> in the subject line so I'm resending...anyway
> 
> Is it possible to accomplish something like the following (obviously by
> a different means, because this way doesn't work), in a screen widget
> definition
> 
> <set field="placement" value="4" type="Integer"/>
> <set field="liveGrids[${placement}]" from-field="lg"/>
> 
> If not, would it be difficult/advisable to add such functionality to
> the screen widget?