我正在设计一个XForm搜索表单。这是我的密码
<?xml version="1.0" encoding="ASCII"?>
<xhtml:html xmlns:xhtml="http://www.w3.org/2002/06/xhtml2" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsi="http://www.w3.org/2001/XMLSchema" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:fn="http://www.w3.org/2005/xpath-functions">
<xforms:model id="auctionItems">
<xforms:instance id="auctions">
<foo>
<request>
<criterias relation="AND">
<criteria name="CritCallCustomerLastName" operator="Equal" model="CustomerLastName" gui_display="Customer LastName"><value></value><value></value></criteria>
</criterias>
</request>
<dataStore>
<store name="CritCallCustomerLastName1"/>
<store name="CritCallCustomerLastName2"/>
</dataStore>
</foo>
</xforms:instance>
<xforms:bind id="bindCallCustomerLastName1" required="false()" type="xforms:string" nodeset="/foo/dataStore/store[@name='CritCallCustomerLastName1']"/>
<xforms:bind id="bindCallCustomerLastName2" required="false()" type="xforms:string" nodeset="/foo/dataStore/store[@name='CritCallCustomerLastName2']"/>
<xforms:submission id="search" ref="/foo" replace="none"/>
<xforms:submission id="order" ref="/foo" replace="none"/>
</xforms:model>
<xhtml:body>
<xhtml:div class="form-horizontal">
<xhtml:div style="margin-left: 10px">
<xhtml:fieldset>
<xhtml:legend>Phone Calls</xhtml:legend>
<xhtml:div class="control-group">
<xhtml:label class="control-label">Customer Last Name</xhtml:label>
<xhtml:div class="controls">
<xforms:input bind="bindCallCustomerLastName1" id="input_call_customer_last_name" class="input-large">
<xforms:hint>Customer Last Name 1</xforms:hint>
</xforms:input>
<xforms:input bind="bindCallCustomerLastName2" id="input_call_customer_last_name" class="input-large">
<xforms:hint>Customer Last Name 2</xforms:hint>
</xforms:input>
</xhtml:div>
</xhtml:div>
</xhtml:fieldset>
</xhtml:div>
<xforms:repeat nodeset="request/criterias/criteria" id="repeatAuctionItems">
<xhtml:div class="form-actions">
<xhtml:span class="pull-right">
<xforms:trigger>
<xforms:label>Search</xforms:label>
<xforms:action ev:event="DOMActivate">
<xforms:send submission="search"/>
<xforms:setvalue ref="/value[1]" value="../../../dataStore/store[@name='CritCallCustomerLastName1']" />
<xforms:setvalue ref="/value[2]" value="../../../dataStore/store[@name='CritCallCustomerLastName2']" />
</xforms:action>
</xforms:trigger>
<xforms:submit submission="search">
<xforms:label>Submit</xforms:label>
</xforms:submit>
</xhtml:span>
</xhtml:div>
</xforms:repeat>
</xhtml:div>
</xhtml:body>
</xhtml:html>这份表格主要是按照它写的做的。我们将输入输入到两个输入中,然后通过绑定设置dataStore中的两个存储节点。
然后,我单击search按钮,但是似乎从未调用setvalue,也没有设置请求/准则/条件中的值节点。
知道我做错什么了吗?
发布于 2014-07-31 07:44:32
因此,问题如下:
原始设定值:
<xforms:setvalue ref="/value[1]" value="../../../dataStore/store[@name='CritCallCustomerLastName1']" />
<xforms:setvalue ref="/value[2]" value="../../../dataStore/store[@name='CritCallCustomerLastName2']" /> 解决办法是:
<xforms:setvalue ref="value[1]" value="../../../../dataStore/store[@name='CritCallCustomerLastName1']" />
<xforms:setvalue ref="value[2]" value="../../../../dataStore/store[@name='CritCallCustomerLastName2']" />实例是标准节点,因此ref应该是" value *“,并且该值指向值节点,因此我们必须增加一个额外的级别。
https://stackoverflow.com/questions/25043466
复制相似问题