Path expression for custom generic object

Advertisement
I am creating a user defined generic object so that I can use path expression to edit them from the form. Below is the code snippet. However the path expression is coming as null. Please let me know if I am missing anything
<block>
<set name='newGen'>
<new class='com.waveset.object.GenericObject'/>
</set>
<invoke name='put'>
<ref>newGen</ref>
<s>attribute1</s>
<s>attributevalue1</s>
</invoke>
<invoke name='put'>
<ref>newGen</ref>
<s>attribute2</s>
<s>attributevalue2</s>
</invoke>
<set name='newGen1'>
<new class='com.waveset.object.GenericObject'/>
</set>
<invoke name='put'>
<ref>newGen1</ref>
<s>attribute1</s>
<s>attributevalue1</s>
</invoke>
<invoke name='put'>
<ref>newGen1</ref>
<s>attribute2</s>
<s>attributevalue2</s>
</invoke>
<set name='testList'>
<list>
<ref>newGen</ref>
<ref>newGen1</ref>
</list>
</set>
<set name='newGenObj'>
<new class='com.waveset.object.GenericObject'/>
</set>
<invoke name='put'>
<ref>newGenObj</ref>
<s>masterAttribute</s>
<ref>testList</ref>
</invoke>
*{color:#ff0000} <ref>newObj.masterAttribute[0].attribute1</ref> coming as null*
*</block>{color}*
Advertisement

Replay

Yes you are missing some things......
First af all you create a GenericObject newGenObj which contains an attribute (masterAttribute) which contains a list of generic objects.
The right code snippet to access for example the value of attribute1 of the generic object newGen is as follows
<invoke name='get'>
<invoke name='get'>
<ref>newGenObj.masterAttribute</ref>
<i>0</i>
</invoke>
<s>attribute1</s>
</invoke>