Hi,
I'm trying to adapt the Effects/Refresh example do dynamically expand
a div. Here's the code from the .html:
<div id="countries">
<div>
<a jwcid="linkToggle" class="toggle">
<span jwcid="@Insert" value="ognl:showForm ? 'Hide' : 'Details'" />
</a>
<span jwcid="@Insert" class="ognl:showForm ? 'detailHeading'
: 'heading'" />
</div>
<span jwcid="@If" condition="ognl:showForm">
<div>
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
In consequat lectus a eros. Vestibulum tortor. Cras sapien.
Morbi sed ipsum. Class aptent taciti sociosqu ad litora
torquent per conubia nostra, per inceptos hymenaeos. Fusce
aliquam auctor tortor.
</p>
</div>
</span>
</div>
here's the code from the .page
<inject property="ajaxRequest" object="service:tacos.AjaxWebRequest" />
<property name="showForm" />
<component id="linkToggle" type="tacos:AjaxDirectLink">
<binding name="listener" value="listener:toggleItem"/>
<binding name="updateComponents" value="ognl:{'countries'}"/>
<binding name="effects"
value="template:{highlight:{countries:'[255,255,184], 500, 500'}}"/>
<binding name="statusElement" value="literal:status" />
</component>
and here's the .java code
/**
* Toggles an item being selected
*
* @param cycle
*/
public void toggleItem(IRequestCycle cycle) {
if (showForm == true) {
showForm = false;
}
else {
showForm = true;
}
AjaxWebRequest ajax = (AjaxWebRequest) cycle
.getAttribute(AjaxWebRequest.AJAX_REQUEST);
if (ajax != null)
ajax.addStatusResponse(" selected..");
}
/**
* If current item is selected
*
* @return
*/
public boolean isShowForm() {
return showForm;
}
---------------------
The status is being correctly updated so as the showForm variable. But
I need to explicitily refresh the page to hide/show details while on
the example that is made automatically through the AJAX request.
What could I possibily be doing wrong?
Thanks in advance.
Kind regards,
Mário Lopes
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Tacos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tacos-devel