I think what you need is something like this:
in .page:
<property name="aLink" type="java.lang.String"/>
<component id="foreach" type="Foreach">
<binding name="source" expression="allLink"/>
<binding name="value" expression="aLink"/>
</component>
in .html:
<span jwcid="foreach">
<span jwcid="@Insert" value="ognl:aLink"/>
</span>
in .java:
public abstract String getALink();
public abstract void setALink(String aLink);
This may not be spot on but I think the problem is that you need a value in
the foreach to set each iteration to, you then use this to display what you
want.
Paul
Eng Lark Eric Tan <[EMAIL PROTECTED]> wrote:
Dear all,
I have prepare "allLink" in 3 parts. Why it still have
error? Looking forward for your comment.
Eric Tan
Unable to resolve expression 'allLink' for
[EMAIL PROTECTED]
binding: ExpressionBinding[Main allLink]
location: context:/WEB-INF/Main.page, line 44, column
54
ognl.NoSuchPropertyException
allLink
Main.page
...
<component id="foreach" type="Foreach">
<binding name="source" expression="allLink"/>
</component>
<component id="link" type="PageLink">
<static-binding name="page" value="UsrMain"/>
</component>
...
Main.html
<span jwcid="foreach">
<span jwcid="link"/>
</span>
Main.java
public List getAllLink() {
allLink = new ArrayList();
allLink.add("Page1");
allLink.add("Page2");
allLink.add("Page3");
return allLink;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]