我正在尝试将我的 orbeon 升级为使用新的orbeon 4.2。switch case
但是我在源代码中使用的那个有问题。尝试切换外壳时遇到问题。
<xforms:action ev:event="xxforms-invalid" ev:observer="main">
<xforms:toggle case="invalid-form-case" if="instance('main')/current_session/student_module_regn_status = 'Close'"/>
</xforms:action>
<xforms:action ev:event="xxforms-valid" ev:observer="main">
<xforms:toggle case="valid-form-case" if="instance('main')/current_session/student_module_regn_status = 'Open'"/>
</xforms:action>
以下是开关盒的代码:
<xforms:switch>
<xforms:case id="invalid-form-case">
Closed
</xforms:case>
<xforms:case id="valid-form-case">
Open
</xforms:case>
谢谢
这是一个可以重现该问题的示例:
<html xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
xmlns:widget="http://orbeon.org/oxf/xml/widget"
xmlns:xdt="http://www.w3.org/2005/02/xpath-datatypes"
xmlns:f="http://orbeon.org/oxf/xml/formatting"
xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>test</title>
<xhtml:link rel="stylesheet" href="/apps/uis-common/css/app-form.css" type="text/css"/>
<xforms:model>
<xforms:instance id="main">
<mains>
<test1>Open</test1>
</mains>
</xforms:instance>
<xforms:action ev:event="xxforms-invalid" ev:observer="main">
<xforms:toggle case="invalid-form-case" if="instance('main')/test1 = 'Close'"/>
</xforms:action>
<xforms:action ev:event="xxforms-valid" ev:observer="main">
<xforms:toggle case="valid-form-case" if="instance('main')/test1 = 'Open'"/>
</xforms:action>
</xforms:model>
</head>
<body dir="ltr">
<div>
<table width="100%" id="wrapper" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<xforms:switch>
<xforms:case id="invalid-form-case">
CLOSE
</xforms:case>
<xforms:case id="valid-form-case">
OPEN
</xforms:case>
</xforms:switch>
</td>
</tr>
</table>
</div>
</body>
</html>
它假设显示“打开”,因为“test1”是打开的,但无论“test1”是什么,它只显示“关闭”