0

我有一个表单,其中包含从数据库预先填充的值,用户可以在其中更改和保存值。

1)我有一个从数据库中预填充的地址文本,并且有一个选项可以修改 uk 按钮,然后单击此处按钮进入下一页,地址将被填充,如果用户想要更改,他可以更改并保存或否则他可以取消它......但如果地址为空白并取消它,即使它正在使用空白值进行更新。

 <view-state id="selectUKAddress" model="address" view="../updateDetails/selectUKAddress.jsp">
    <transition on="populate" to="ukAddressSelectionAction" />
    <transition on="continue" to="updateDetails">
        <set name="viewScope.addressPayload" value="new onlinereg.action.payload.AddressActionPayload(address, studentData, addressType)" />
        <evaluate expression="addressAction.execute(addressPayload)" />
    </transition>
    <transition on="cancel" to="updateDetails" validate="false" >
    </transition>
</view-state>

 <view-state id="updateDetails" model="studentData" view="../updateDetails/updateDetails.jsp">
    <on-entry>
        <evaluate expression="navigationVO.personalDetails=true" />
        <evaluate expression="navigationVO.activeTab='personalDetails'" />
        <set name="viewScope.disabilityCodes" value="registrationService.getDisabilityCodes()" />
        <set name="viewScope.legacyDisabilityCodes" value="registrationService.getLegacyDisabilityCodes()" />
        <set name="viewScope.ethnicityCodes" value="registrationService.getEthnicityList()" />
        <set name="viewScope.countries" value="registrationService.getCountries()" />
        <set name="viewScope.nationality" value="registrationService.getNationality()" />
        <set name="viewScope.qualification" value="registrationService.getQualification()" />
        <set name="viewScope.university" value="registrationService.getUniversity()" />
    </on-entry>
    <transition on="updateUKHomeAddress" to="selectUKAddress" validate="false">
        <evaluate expression="studentData.homeAddress = addressService.generateUKAddress(studentData.homeAddress)" />
        <set name="flowScope.address" value="studentData.homeAddress" />
        <set name="flowScope.addressType" value="@uk.ac.city.onlinereg.action.AddressAction@HOME_ADDRESS" />
    </transition>
    <transition on="updateNonUKHomeAddress" to="selectNonUKAddress" validate="false">
        <evaluate expression="studentData.homeAddress = addressService.generateNonUKAddress(studentData.homeAddress)" />
        <set name="flowScope.address" value="studentData.homeAddress" />
        <set name="flowScope.addressType" value="@uk.ac.city.onlinereg.action.AddressAction@HOME_ADDRESS" />
    </transition>
    <transition on="updateUKTermAddress" to="selectUKAddress" validate="false">
        <evaluate expression="studentData.termAddress = addressService.generateUKAddress(studentData.termAddress)" />
        <set name="flowScope.address" value="studentData.termAddress" />
        <set name="flowScope.addressType" value="@uk.ac.city.onlinereg.action.AddressAction@TERM_ADDRESS" />
    </transition>
    <transition on="updateHallsTermAddress" to="selectHallsAddress" validate="false">
        <evaluate expression="studentData.termAddress = addressService.generateHallsAddress(studentData.termAddress)" />
        <set name="flowScope.address" value="studentData.termAddress" />
        <set name="flowScope.addressType" value="@uk.ac.city.onlinereg.action.AddressAction@TERM_ADDRESS" />
    </transition>
    <transition on="updateNonUKTermAddress"  to="selectNonUKAddress" validate="false">
        <evaluate expression="studentData.termAddress = addressService.generateNonUKAddress(studentData.termAddress)" />
        <set name="flowScope.address" value="studentData.termAddress" />
        <set name="flowScope.addressType" value="@uk.ac.city.onlinereg.action.AddressAction@TERM_ADDRESS" />
    </transition>
    <transition on="continue" to="finish" />
</view-state>
4

1 回答 1

0

添加bind="false"到您的cancel过渡中。

http://static.springsource.org/spring-webflow/docs/2.3.x/reference/htmlsingle/spring-webflow-reference.html#view-bind

于 2012-07-13T13:22:04.517 回答