javascript - Sencha 触摸 : How to implement xForms with Sencha Touch?

标签 javascript extjs sencha-touch sencha-touch-2 xforms

我们的 WEB 应用程序使用 xForms 来验证和显示不同国家/地区的不同模板。我必须使用 Sencha Touch 来实现同样的事情。我在各个论坛上进行了搜索,但找不到任何明确的答案。

WEB/ios/Android 应用程序使用的 xForms 如下所示。

<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:xf="http://www.w3.org/2002/xforms" 
      xmlns:xs="http://www.w3.org/2001/XMLSchema" 
      xmlns:xrsi="http://www.westernunion.com/schema/xrsi" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"> 
  <head> 
    <title>Bank Account details</title> 
    <xf:model>
      <xf:instance xmlns=""> 
        <bank_account> 
          <bank_name/>
          <swift_code/> 
          <account_number/> 
        </bank_account> 
      </xf:instance> 
      <xf:bind nodeset="bank_name" 
           type="xs:string" 
           required="true()" 
           constraint="string-length(.) &lt; 31"/> 
      <xf:bind nodeset="bank_code" 
           type="xrsi:alphanum" 
           required="true()" 
           constraint="string-length(.) &lt; 12"/> 
      <xf:bind nodeset="account_number" 
           type="xrsi:alphanum" 
           required="true()" 
           constraint="string-length(.) &lt; 25"/>
    </xf:model> 
  </head>
  <body> 
    <section> 
      <dl>
    <dt>Bank Name*:</dt> 
    <dd> 
      <xf:input ref="bank_name" 
                incremental="true" 
                xxforms:maxlength="30"> 
        <xf:alert>Bank Name is required</xf:alert>
        <xf:hint>Bank Name</xf:hint> 
      </xf:input> 
    </dd> 
    <dd> 
      <xf:input ref="bank_code" 
                incremental="true" 
                xxforms:maxlength="11"> 
        <xf:alert>AlphaNumeric</xf:alert> 
        <xf:hint>BIC</xf:hint> 
      </xf:input>
    </dd>

    <dd> 
      <xf:input ref="account_number" 
                incremental="true" 
                xxforms:maxlength="24">
        <xf:alert>IBAN is AlphaNumeric</xf:alert>
        <xf:hint>IBAN</xf:hint>
      </xf:input> 
    </dd> 
      </dl> 
    </section>
  </body>
</html>

我想在我的 sencha touch 应用程序中实现类似的功能。有什么好的方法来实现这一点吗?任何指示都会有很大帮助。

以下是 2 个有用的链接。

Is anyone using XForms in their web applications? http://www.sencha.com/forum/archive/index.php/t-26497.html

谢谢 正达夫

最佳答案

我觉得你应该能够使用XSLTFORMS wich 是 xforms 的客户端实现,并将其集成到您的 sencha 触摸应用程序中。

我自己没有尝试过,但不久前我做了一些研究,XSLTFORMS 似乎工作得很好。

关于javascript - Sencha 触摸 : How to implement xForms with Sencha Touch?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15142514/

相关文章:

javascript - 如何在 Protractor 中单击没有文本的按钮?

javascript - 从文件 ://scheme 运行的应用程序的 CORS 错误

forms - 当 trackResetOnLoad 为真时,Ext.form.Basic 如何重置字段?

checkbox - 如何在 sencha touch 2 中左对齐复选框字段?

javascript - 在初始化函数中定义对象的项

android - PhoneGap + 安卓模拟器 + Sencha Touch

javascript - 使用 knockout 逐步加载视频元数据数组

javascript - 动态下拉列表,JQuery,不提交带有值的表单

ExtJS CheckboxGroup 标签换行

extjs - 如何在 Ext.grid.panel 中定义 View