You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "F. Da Costa Gomez" <dc...@fixed.com> on 2003/09/26 15:02:02 UTC
Re: [Foreach] What am I missing here? (done)
Yep, that did the trick,
Thx
Howard M. Lewis Ship wrote:
>You have two conflicting properties, both named branch. One is boolean (from isBranch()), the other
>is type Segment.
>
>You need to rename them in some way so that OGNL (and the JavaBeans framework) can distinguish them.
>
>--
>Howard M. Lewis Ship
>Creator, Tapestry: Java Web Components
>http://jakarta.apache.org/tapestry
>http://jakarta.apache.org/commons/sandbox/hivemind/
>http://javatapestry.blogspot.com
>
>
>
>>-----Original Message-----
>>From: F. Da Costa Gomez [mailto:dcg@fixed.com]
>>Sent: Thursday, September 25, 2003 12:15 PM
>>To: Tapestry users
>>Subject: [Foreach] What am I missing here?
>>
>>
>>Hi all,
>>
>>I've been staring myself silly on a very elementary Foreach
>>but I'm just
>>not getting it.
>>The error suggests to me that there is something not ok with
>>the setter
>>(which I don't get because it looks good)
>>
>>Any suggestions?
>>
>>TIA
>>Fermin DCG
>>
>>Unable to update expression 'branch' for
>>org.dcg.tests.treetable.TreeTableTest$Enhance_13@1f6321[TreeTa
>>bleTest]
>>to desc Cat1.
>>binding: ExpressionBinding[TreeTableTest branch]
>>location:
>>classpath:/org/dcg/tests/treetable/TreeTableTest.page, line
>>22, column 45
>>
>>ognl.NoSuchPropertyException
>>branch
>>target:
>>org.dcg.tests.treetable.TreeTableTest$Enhance_13@1f6321[TreeTableTest]
>>Stack Trace:
>>
>> *
>>ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor
>>.java:133)
>>
>> * ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1235)
>> * ognl.ASTProperty.setValueBody(ASTProperty.java:117)
>> * ognl.SimpleNode.setValue(SimpleNode.java:153)
>> * ognl.Ognl.setValue(Ognl.java:478)
>>
>>
>>*.html:*
>> <span jwcid="defName">Segmentation DefinitionName</span>
>> <hr />
>> <table>
>> <!-- tr jwcid="rootNodes@Foreach" source="ognl:branchNodes"
>>value="ognl:branch" element="tr" bgcolor="lightblue"-->
>> <tr jwcid="branchNodes" bgcolor="lightblue">
>> <span jwcid="@Conditional" condition="ognl:branch">
>> <td><span jwcid="@Insert" value="ognl:branch.level">TD
>>B1</span></td>
>> <td><span jwcid="@Insert" value="ognl:branch.id">TD
>>B2</span></td>
>> <td><span>TD B3</span></td>
>> <td><span jwcid="@Insert"
>>value="ognl:branch.segmentDescription">TD B4</span></td>
>> </span>
>>
>> <span jwcid="@Conditional" condition="ognl:leaf">
>> <td><span jwcid="@Insert" value="ognl:branch.level">TD
>>L1</span></td>
>> <td><span jwcid="@Insert" value="ognl:branch.id">TD
>>L2</span></td>
>> <td><span>TD L3</span></td>
>> <td><span jwcid="@Insert"
>>value="ognl:branch.segmentDescription">TD L4</span></td>
>> </span>
>> </tr>
>> </table>
>>
>>*.page:*
>> <component id="defName" type="Insert">
>> <binding name="value" expression="definitionName"></binding>
>> </component>
>>
>> <component id="branchNodes" type="Foreach">
>> <binding name="source" expression="branches"></binding>
>> <binding name="value" expression="branch"></binding>
>> <!--binding name="index" expression=""></binding-->
>> <binding name="element" expression="'tr'"></binding>
>> </component>
>>
>>*.java:*
>> public abstract String getTreeDefinition();
>>
>> public String getDefinitionName() {
>> if (_segDef == null) {
>> _segDef = (SegmentationDefinition)
>>Global.retrieveObject(SegmentationDefinition.class,
>>getTreeDefinition());
>> }
>> return _segDef.getDescription();
>> }
>>
>> // ==== RootNodes ====
>> public Object[] getRoots() { // GOES OK
>> return (Object[]) _segDef.getBranches();
>> }
>>
>> // ==== BranchNodes ====
>> public boolean isBranch() {
>> return (_branch.getBranches().length>0);
>> }
>>
>> public Object[] getBranches() { GOES OK
>> if (_branch==null) return getRoots();
>> else return (Object[]) _branch.getBranches();
>> }
>>
>> public void setBranch(Segment value) { // DOESN'T EVEN ENTER
>> _branch = value;
>> }
>>
>> public Segment getBranch() {
>> return _branch;
>> }
>>
>>
>>
>>
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
>
>__________ NOD32 1.518 (20030925) Information __________
>
>This message was checked by NOD32 Antivirus System.
>http://www.nod32.com
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org