From: Ricardo J. P. (JIRA) <jir...@ob...> - 2009-03-10 18:47:37
|
AjaxUpdateLink's action is not called if placed inside an AjaxObserveField -------------------------------------------------------------------------- Key: WONDER-243 URL: http://issues.objectstyle.org/jira/browse/WONDER-243 Project: Project Wonder Issue Type: Bug Reporter: Ricardo J. Parada Assigned To: Anjo Krank I used an AjaxObserveField to observe multiple input elements. Well, actually in this example I only have one input element just to illustrate my point. <wo:form> <wo:AjaxUpdateContainer id="Foo"> <wo:AjaxObserveField elementName="span" updateContainerID="Foo"> <wo:textfield value="$value"/> <wo:AjaxUpdateLink action="$setA" string="A" updateContainerID="Foo"/> | <wo:AjaxUpdateLink action="$setB" string="B" updateContainerID="Foo"/> </wo:AjaxObserveField> </wo:AjaxUpdateContainer> </wo:form> then in my .java file I have this: public String value = "X"; public WOActionResults setA() { value = "A"; return null; } public WOActionResults setB() { value = "B"; return null; } Notice I'm using the observe field to wrap the input element so that I don't need to worry about specifying an observeFieldID. Now back to the problem. The A | B links are supposed to invoke the setA() and setB() and update the Foo update container. However, neither setA() or setB() is getting called. The update container is getting refreshed though. I believe this is a bug. The workaround is to place the AjaxUpdateLinks outside the AjaxObserveField. In other words, this works: <wo:form> <wo:AjaxUpdateContainer id="Foo"> <wo:AjaxObserveField elementName="span" updateContainerID="Foo"> <wo:textfield value="$value"/> </wo:AjaxObserveField> <wo:AjaxUpdateLink action="$setA" string="A" updateContainerID="Foo"/> | <wo:AjaxUpdateLink action="$setB" string="B" updateContainerID="Foo"/> </wo:AjaxUpdateContainer> </wo:form> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.objectstyle.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |