Hi

I am using tapestry 4 and the latest release of tacos but I am having a few problems with the updateComponents binding in the AjaxDirectlink. I have created a component with two nested PartialFor loops and I want to update the inner PartialFor when the AjaxDirectLink is clicked. Here is the code and as it is it does work but i am being forced to updated the div containing the outer loop rather than hust updating the inner loop. Trying to update that fails.

A bit of background, the persistent layer is Cayenne (latest release) and all the objects are persistent.

.html

<div jwcid="structuralPublishItemsArea" id="structuralPublishItemsArea">
        <span jwcid="@If" condition="ognl:structuralNode">
<div style="padding-bottom:10px;font-size:10pt;font-weight:bold;"><span jwcid="@Insert" value="ognl:structuralNode.structuralPath" /></div>
                <span jwcid="foreachPublishItem">
                        <div jwcid="publishItemName" 
id="ognl:structuralPublishItem.name">
                                <span jwcid="publishItemLink">
                                        <span jwcid="@Insert" 
value="ognl:structuralPublishItem.name" />
                                </span>
                                <span jwcid="@If" 
condition="ognl:isPublishItemSelected">
                                        <span 
jwcid="foreachPublishItemKeyValue">
                                                <div jwcid="@Any" 
class="ognl:beans.evenOdd.next">
                                                        <span jwcid="@Insert" 
value="ognl:structuralPersistentKey" />&nbsp;
<span jwcid="@Insert" value="ognl:structuralPublishItem.mergedDictionary.get(structuralPersistentKey)" />
                                                </div>
                                        </span>
                                </span>
                        </div>
                </span>
        </span>
</div>


.jwc

   <parameter name="dataContext" required="yes">
<description>Provides the dataContext for refetching the persistent objects.</description>
        </parameter>

        <parameter name="structuralNode" required="yes">
       <description>
           Structural node for which to get the publishItems from.
       </description>
   </parameter>

   <property name="structuralPublishItem"/>

   <property name="structuralPersistentKey"/>

<property name="selectedPublishItems" persist="session" initial-value="ognl:new java.util.HashMap()"/>

<component id="structuralPublishItemsArea" type="Any" inherit-informal-parameters="yes">
       <binding name="element" value="literal:div"/>
   </component>

   <component id="foreachPublishItem" type="tacos:PartialFor">
       <binding name="source"
value="ognl:structuralNode ? structuralNode.structuralMergedPublishItems : null"/>
       <binding name="value" value="ognl:structuralPublishItem"/>
       <binding name="evenOdd" value="ognl:beans.evenOdd"/>
   </component>

   <component id="publishItemName" type="Any">
       <binding name="element" value="literal:div"/>
   </component>

   <component id="publishItemLink" type="tacos:AjaxDirectLink">
       <binding name="listener" value="listener:togglePublishItem"/>
       <binding name="parameters" value="structuralPublishItem"/>
<binding name="updateComponents" value="ognl:{'structuralPublishItemsArea'}"/> <binding name="keyProvider" value="structuralPublishItemKeyProvider"/> <binding name="effects" value="template:{highlight:{structuralPublishItemsArea:'[255,255,184], 0, 500'}}"/>
   </component>

   <component id="foreachPublishItemKeyValue" type="tacos:PartialFor">
       <binding name="source"
value="ognl:structuralPublishItem.mergedDictionary.isEmpty ? null : structuralPublishItemKeySetArray"/>
       <binding name="value" value="ognl:structuralPersistentKey"/>
       <binding name="evenOdd" value="ognl:beans.evenOdd"/>
   </component>

<inject property="listenerInvoker" object="infrastructure:listenerInvoker"/> <inject property="ajaxWebRequest" object="service:tacos.AjaxWebRequest"/>
   <bean name="evenOdd" class="org.apache.tapestry.bean.EvenOdd"/>


What is the difference between updateComponents and updateBlocks? What am I doing wrong here. Please let me know if you need more information or if any of this in unclear.

Regards

_________________________________________________________________
The new MSN Search Toolbar now includes Desktop search! http://join.msn.com/toolbar/overview


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to