I've found the solution to the problem. Apparently there was a subtle change in component handling.

My html looked like this:

<form>
 <table>
<tr><th><span jwcid="@FieldLabel" field="component:measurement"/></ th></tr>
  <tr jwcid="measurementList">
    <td><input jwcid="measurement"/></td>
 </tr>
</table>
</form>

And the page specification looked like
    <component id="measurementList" type="For" >
        <binding name="source" value="odMeasurements"/>
        <binding name="value" value="odMeasurementItem"/>
        <binding name="index" value="odIndex"/>
    </component>

     <component id="measurement" type="ValidField">
        <binding name="displayName" value="literal:Measurement"/>
        <binding name="validator" value="beans.required"/>
        <binding name="value" value="odMeasurementItem.measurement"/>
    </component>

The problem was the reference to the measurement component to get its displayName. Under Tapestry 3, this simply retrieved the displayName. Now under Tapestry 4 the component wanted its value at the time the displayName was retrieved. Since the FieldLabel was outside the For component, the odMeasurementItem had not been initialized and was causing the null pointer reference.


On Apr 5, 2006, at 2:08 PM, Erik Husby wrote:

I am in the process of upgrading from Tapestry 3 to Tapestry 4 and am having problems with one of my pages.

The page in question uses a @ListEdit defined as so using the Tapestry 3 DTD:
    <component id="measurementList" type="ListEdit">
        <binding name="source" expression="listEditMap.keys"/>
        <binding name="value" expression="listEditMap.key"/>
<binding name="listener" expression="listeners.doSyncMeasurementItem"/>
    </component>

The listener is defined as so:
    public void doSyncMeasurementItem(IRequestCycle cycle) {...}

However at runtime the listener is never being called! And no error is being logged that it can't find one. This page works fine under Tapestry 3. The result is that when the page tries to reference a value that should have set by the listener, a null pointer is thrown.

The documentation for @ListEdit does state that @ListEdit is being depreciated but definitely implies that it is supported in 4.0. But it also does not state if the listener signature should be something else.

Any pointers on where to look for a solution would be appreciated.
---
Erik Husby
Senior Software Engineer
Broad Institute of MIT and Harvard
Rm. 2192, 320 Charles St, Cambridge, MA 02141-2023
mobile: 781.354.6669, office: 617.258.9227
email: [EMAIL PROTECTED] AIM: ErikAtBroad


---
Erik Husby
Senior Software Engineer
Broad Institute of MIT and Harvard
Rm. 2192, 320 Charles St, Cambridge, MA 02141-2023
mobile: 781.354.6669, office: 617.258.9227
email: [EMAIL PROTECTED] AIM: ErikAtBroad

Reply via email to