Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

loop component only reads 'value" once, renders same object each time?

$
0
0
This used to work, and now it doesn't and I'm at a loss.

What I see happening is that setCurrentObject is called the correct number
of times (4), with the correct value each time.

However, getCurrentObject is only called once.

The list is rendered the correct number of times (4x), but it renders the
same object each time.

I stepped through the Tapestry source for the Loop component (v5.3.7), and
at line 386 the loop appears to get the correct JSON 4 times at the top
level of the render loop (which surprises me since it only calls
getCurrentObject once), but when it renders the object, somehow it only
"sees" the first JSONObject.

This is such a simple use case, it's driving me nuts that it doesn't work.
It used to work, and I am unable to identify any differences from when it
worked until now.

tml:

<div class="examples" id="allFieldsView">

<ul>

<li t:type="Loop" t:source="FIList" t:value="currentObject">

<div t:type="StsValueSource" data="prop:currentObject" view=
"allfields" />

</li>

</ul>

</div>

java:

public List<JSONObject>getFIList() throws IOException {

// reads JSON from a file and returns ArrayList<JSONObject> of size 4

// created getters/setters to set breakpoints

private JSONObject currentObject;

public JSONObject getCurrentObject() {

return currentObject;

public void setCurrentObject(JSONObject o) {

this.currentObject=o;

Viewing all articles
Browse latest Browse all 5648

Trending Articles