Unable to resolve expression 'model.label' for
[EMAIL 
PROTECTED]/$WidgetStack.ShopViewBlock.ShopView.$CatalogTreeView.$TreeView.$TreeItemView].
binding:        
ExpressionBinding[Home/$WidgetStack.ShopViewBlock.ShopView.$CatalogTreeView.$TreeView.$TreeItemView
model.label]
Hi Ron 

Here is the TreeItemView component that is render in the Foreach loop

component template

<span jwcid="$content$">
        <div class="Label">
        Label is
        <div jwcid="@Insert" value="ognl:model.label"/>
    </div>
    <div class="Childs">
       <!--<div jwcid="@Foreach" source="ognl:model.iterator" value="ognl:item">
           <div jwcid="@TreeItemView" model="ognl:model.getObject(item)"/>
       </div>-->
    </div>
</span>

component specification

<component-specification class="oz.webs.TreeItemView" allow-body="yes"
allow-informal-parameters="yes">
    <parameter name="model" type="oz.webs.TreeItem" direction="auto"
required="yes"/>
    <property-specification name="item" type="java.util.Iterator"/>
</component-specification>

here are the methos of model that  i use in the Foreach component

public Iterator getIterator()
{
              Set itemsSet=items.keySet();
              Iterator iter=itemsSet.iterator();
              return iter;
}

public TreeItem  getObject(Iterator iter)
{
             return (TreeItem)items.get(iter);
}

note Items is a HasMap that i initialice when TreeModel is instaciated 

and here is the exception that is raise when TreeItemVie try to access
model.label

if i coment the Insert component the String "Is a Label" is correct
render four times one for each category in my TreeModel

location:       context:/WEB-INF/TreeItemView.html, line 6
 
ognl.OgnlException
source is null for getProperty(null, "label")
Stack Trace:

    * ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1611)
    * ognl.ASTProperty.getValueBody(ASTProperty.java:96)
    * ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
    * ognl.SimpleNode.getValue(SimpleNode.java:210)
    * ognl.ASTChain.getValueBody(ASTChain.java:109)
    * ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
    * ognl.SimpleNode.getValue(SimpleNode.java:210)
    * ognl.Ognl.getValue(Ognl.java:333)
    * ognl.Ognl.getValue(Ognl.java:310)

Thanks in advantage

On 5/23/05, Ron Piterman <[EMAIL PROTECTED]> wrote:
> Can you send the exception?
> 
> 
> ציטוט pepone pepone:
> > Hello list
> >
> > i trying to pass the foreach att value to a model.getObject method of
> > my component
> > but i unable to get this working
> >
> > <div jwcid="@Foreach" source="ognl:model.iterator" value="ognl:item">
> >            <div jwcid="@TreeItemView" model="ognl:model.getObject(item)"/>
> > </div>
> >
> > can any body sayme if posible and the correct way to doit
> >
> > thanks
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

Reply via email to