edillmann / zkspring

Automatically exported from code.google.com/p/zkspring
0 stars 0 forks source link

Unable to update variable defined in spring web flow #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Repost from old ZK Spring SF project tracker 
https://sourceforge.net/tracker/?func=detail&aid=2612811&group_id=152762&atid=78
5191

Hello, the "save-when" feature of data binding appears weird if the variable is 
from spring web flow.
The zul page is defined as the following:
[code]
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit"?>
<?variable-resolver class="org.zkoss.spring.DelegatingVariableResolver"?>

<zk:zk xmlns="http://www.zkoss.org/2005/zk/native"
xmlns:zul="http://www.zkoss.org/2005/zul"
xmlns:zk="http://www.zkoss.org/2005/zk">
<zul:window title="Enter Query Param" border="normal" width="800px">
<zul:label value="Enter Query Param"/><br/>
<zul:label value="no_bank:"></zul:label><zul:textbox width="20" id="no_bank" 
value="@{queryParam1.no_bank, save-when='self.onChange'}"/><br/>
<zul:label value="name_bank:"></zul:label><zul:textbox width="20" 
id="name_bank" value="@{queryParam1.name_bank, 
save-when='self.onChange'}"/><br/>
<zul:button href="@{flowBean1.eventURLMap.mainWindow}" 
label="Restart"/><zul:button href="@{flowBean1.eventURLMap.showQueryParam}" 
label="ShowQueryParam"/>
</zul:window>
</zk:zk>

[/code]

the variable 'queryParam1' is defined in a web flow configuration file

[code]<flow xmlns="http://www.springframework.org/schema/webflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/webflow
http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd">

<var name="flowBean1" class="test.flow.FlowBean1"/>
<var name="queryParam1" class="test.flow.test1.QueryParam1"/>

<view-state id="mainWindow" view="/test1/firstPage">
<on-render>
<evaluate expression="flowBean1.setEventURLMap(flowExecutionUrl, 
'enterQueryParam', 'secondPage', 'showQueryResult')"/>
</on-render>

<transition on="enterQueryParam" to="enterQueryParam">
</transition>

<transition on="secondPage" to="secondPage">
<evaluate expression="flowBean1.setValue('value2')"/>
</transition>

<transition on="showQueryResult" to="showQueryResult">
<evaluate expression="flowBean1.executeQuery()"/>
</transition>
</view-state>

<view-state id="enterQueryParam" view="/test1/enterQueryParam">
<on-render>
<evaluate expression="flowBean1.setEventURLMap(flowExecutionUrl, 'mainWindow', 
'showQueryParam')"/>
</on-render>
<transition on="mainWindow" to="mainWindow">
<evaluate expression="flowBean1.setValue('value1')"/>
</transition>
<transition on="showQueryParam" to="showQueryParam">
</transition>
</view-state>

<view-state id="showQueryParam" view="/test1/showQueryParam">
<on-render>
<evaluate expression="flowBean1.setEventURLMap(flowExecutionUrl, 'mainWindow', 
'showQueryResult')"/>
</on-render>
<transition on="mainWindow" to="mainWindow">
<evaluate expression="flowBean1.setValue('value1')"/>
</transition>
<transition on="showQueryResult" to="showQueryResult">
<evaluate expression="flowBean1.executeQuery()"/>
</transition>
</view-state>

<view-state id="showQueryResult" view="/test1/showQueryResult">
<on-render>
<evaluate expression="flowBean1.setEventURLMap(flowExecutionUrl, 'restart', 
'finish')"/>
</on-render>
<transition on="restart" to="firstPage">
<evaluate expression="flowBean1.setValue('value1')"/>
</transition>
<transition on="finish" to="finish"/>
</view-state>

<view-state id="secondPage" view="/test1/secondPage">
<on-render>
<evaluate expression="flowBean1.setEventURLMap(flowExecutionUrl, 'restart', 
'finish')"/>
</on-render>
<transition on="restart" to="firstPage">
<evaluate expression="flowBean1.setValue('value1')"/>
</transition>
<transition on="finish" to="finish"/>
</view-state>

<end-state id="finish" />

</flow>
[/code]

However, it seems like that although value="@{queryParam1.no_bank, 
save-when='self.onChange'}" is defined, 
queryParam1 is never updated when onChange event occurs.
Is there anything wrong in my configuration?

looking forward to any suggestion, thanks!

Original issue reported on code.google.com by ashish.dasnurkar on 1 Feb 2011 at 5:11

Attachments:

GoogleCodeExporter commented 9 years ago
Can not reproduce as of 5/12/2011

Original comment by ashish.dasnurkar on 12 May 2011 at 3:06