起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 9419|回复: 17

[处理中5] 手机UI中checkbox

[复制链接]

67

主题

279

帖子

434

积分

中级会员

Rank: 3Rank: 3

积分
434
QQ
发表于 2014-9-2 09:26:45 | 显示全部楼层 |阅读模式
版本: 小版本号:
数据库: 服务器操作系统: 应用服务器:
客户端操作系统: 浏览器:
在PC端UI开发中,使用了checkbox:
     <xforms:select id="reason" class="horizontal" ref="data('dataMain')/fReason">
        <xforms:item id="item1">
          <xforms:label id="default1">员工离职</xforms:label>  
          <xforms:value id="default2">员工离职</xforms:value>
        </xforms:item>  
        <xforms:item id="item2">
          <xforms:label id="default3">新增员工</xforms:label>  
          <xforms:value id="default4">新增员工</xforms:value>
        </xforms:item>
      </xforms:select>

现在需要开发APP端的UI,为保持统一,需要同样设置checkbox:
<xhtml:li class="xui-li-m" id="li1">
          <xhtml:h3 id="h31">招聘原因</xhtml:h3>  
          <xui:place control="checkbox1" id="controlPlace1">
                 
          </xui:place>
        </xhtml:li>


<xhtml:div component="/mobileUI/system/components/mobile/select.xbl.xml#checkbox"
      id="checkbox1" itemset="main" itemset-value="fReason">
      </xhtml:div>


如何绑定静态的lable和value呢?


310

主题

4938

帖子

4767

积分

论坛元老

Rank: 8Rank: 8

积分
4767
QQ
发表于 2014-9-2 09:41:40 | 显示全部楼层
在checkbox上右击,选择编辑选项,就可以设置了

评分

参与人数 1 +4 收起 理由
jishuang + 4 赞一个!

查看全部评分

QQ:179785966
回复 支持 反对

使用道具 举报

67

主题

279

帖子

434

积分

中级会员

Rank: 3Rank: 3

积分
434
QQ
 楼主| 发表于 2014-9-2 10:04:10 | 显示全部楼层
yinlun 发表于 2014-9-2 09:41
在checkbox上右击,选择编辑选项,就可以设置了

编辑选项,添加了俩个静态值,但是设计器中不显示这俩个值,需要设置属性么?
回复 支持 反对

使用道具 举报

310

主题

4938

帖子

4767

积分

论坛元老

Rank: 8Rank: 8

积分
4767
QQ
发表于 2014-9-2 10:11:46 | 显示全部楼层
zsj5237 发表于 2014-9-2 10:04
编辑选项,添加了俩个静态值,但是设计器中不显示这俩个值,需要设置属性么? ...

不能设置,但是不会影响运行使用
QQ:179785966
回复 支持 反对

使用道具 举报

67

主题

279

帖子

434

积分

中级会员

Rank: 3Rank: 3

积分
434
QQ
 楼主| 发表于 2014-9-2 11:14:54 | 显示全部楼层
yinlun 发表于 2014-9-2 10:11
不能设置,但是不会影响运行使用

运行之后,发现后面会多一个checkbox,如图。
checkbox.jpg
回复 支持 反对

使用道具 举报

310

主题

4938

帖子

4767

积分

论坛元老

Rank: 8Rank: 8

积分
4767
QQ
发表于 2014-9-2 11:32:50 | 显示全部楼层
zsj5237 发表于 2014-9-2 11:14
运行之后,发现后面会多一个checkbox,如图。

切换到源码,看看是否多了一个<xhtml:option></xhtml:option>,如果有,把这个删除掉试试
QQ:179785966
回复 支持 反对

使用道具 举报

67

主题

279

帖子

434

积分

中级会员

Rank: 3Rank: 3

积分
434
QQ
 楼主| 发表于 2014-9-2 11:48:13 | 显示全部楼层
yinlun 发表于 2014-9-2 11:32
切换到源码,看看是否多了一个,如果有,把这个删除掉试试

没有,就俩个option
回复 支持 反对

使用道具 举报

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
35920
发表于 2014-9-2 11:53:04 | 显示全部楼层
checkbox的源码发一下看看,平台案例中是正确的
checkbox.png
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



如按照该方法解决,请及时跟帖,便于版主结贴
回复 支持 反对

使用道具 举报

67

主题

279

帖子

434

积分

中级会员

Rank: 3Rank: 3

积分
434
QQ
 楼主| 发表于 2014-9-2 11:59:57 | 显示全部楼层
jishuang 发表于 2014-9-2 11:53
checkbox的源码发一下看看,平台案例中是正确的

<?xml version="1.0" encoding="utf-8"?>

<xui:window xmlns:xui="http://www.justep.com/xui" xmlns="http://www.justep.com/xui"
  xmlns:xhtml="http://www.w3.org/1999/xhtml" component="/mobileUI/system/components/mobile/window.xbl.xml#window" id="window">  
  <xui:model component="/mobileUI/system/components/mobile/model.xbl.xml#model" id="model1"
    style="width:198px;height:134px;top:409px;left:541px;">
    <xhtml:div auto-new="true" component="/mobileUI/system/components/mobile/data.xbl.xml#bizData"
      concept="OA_FC_Recruitment" id="main" limit="1" offset="0">
      <reader action="/xusteelOA/workTime/logic/action/queryOAFCRecruitmentAction"/>  
      <writer action="/xusteelOA/workTime/logic/action/saveOAFCRecruitmentAction"/>  
      <creator action="/xusteelOA/workTime/logic/action/createOAFCRecruitmentAction"/>
    </xhtml:div>
  </xui:model>  
  <xui:view id="rootView">
    <xui:layout id="layout" style="height:100%;width:100%">
      <xhtml:div auto-close="true" auto-filter="true" auto-save="true" auto-start="true"
        component="/mobileUI/system/components/mobile/process.xbl.xml#process" data="main"
        id="flow"/>  
      <xhtml:div component="/mobileUI/system/components/mobile/titlebar.xbl.xml#titlebar"
        id="htitlebar">
        <item class="xui-backButton-m" command="close" commands="commands1"
          name="back" operation="close" operation-owner="window"/>  
        <item class="leftButton" command="save" commands="datacommands1" name="save"
          operation="save" operation-owner="main" text="保存"/>  
        <item command="advance" commands="processCommands-mobile1" id="titlebarItem2"
          operation="advance" operation-owner="flow" text="item"/>
      </xhtml:div>  
      <xhtml:ul class="xui-ul-m" id="listContainer">
        <xhtml:li class="xui-li-m" id="li1">
          <xhtml:h3 id="h31"><![CDATA[单 据 号]]></xhtml:h3>  
          <xhtml:div class="xui-input-m" component="/mobileUI/system/components/mobile/input.xbl.xml#input"
            data="main" id="input1" ref="fNO"/>
        </xhtml:li>  
        <xhtml:li class="xui-li-m" id="li2">
          <xhtml:h3 id="h32">申请部门</xhtml:h3>  
          <xhtml:div class="xui-output-m" component="/mobileUI/system/components/mobile/output.xbl.xml#output"
            data="main" id="input2" ref="fRecruitmentDeptName"/>
        </xhtml:li>  
        <xhtml:li class="xui-li-m" id="li3">
          <xhtml:h3 id="h33">申请人员</xhtml:h3>  
          <xhtml:div class="xui-output-m" component="/mobileUI/system/components/mobile/output.xbl.xml#output"
            data="main" id="input3" ref="fRecruitmentPsnName"/>
        </xhtml:li>  
        <xhtml:li class="xui-li-m" id="li1">
          <xhtml:h3 id="h31">申请日期</xhtml:h3>  
          <xhtml:div class="xui-input-m" component="/mobileUI/system/components/mobile/input.xbl.xml#input"
            data="main" id="input1" ref="fApplyDate"/>
        </xhtml:li>  
        <xhtml:li class="xui-li-m" id="li1">
          <xhtml:h3 id="h31">申请人数</xhtml:h3>  
          <xhtml:div class="xui-input-m" component="/mobileUI/system/components/mobile/input.xbl.xml#input"
            data="main" id="input1" ref="fPersonNum"/>
        </xhtml:li>  
        <xhtml:li class="xui-li-m" id="li1">
          <xhtml:h3 id="h31">招聘原因</xhtml:h3>  
          <xui:place control="radio1" id="controlPlace3"/>
        </xhtml:li>
      </xhtml:ul>
    </xui:layout>  
    <xhtml:div component="/mobileUI/system/components/mobile/select.xbl.xml#radio"
      id="radio1" itemset="main" itemset-value="fReason" itemset-label="fReason">
      <xhtml:option value="员工离职" id="default7">员工离职</xhtml:option>  
      <xhtml:option value="新增员工" id="default8">新增员工</xhtml:option>
    </xhtml:div>
  </xui:view>  
  <xui:resource id="resource">
    <xhtml:script type="text/javascript"/>  
    <xhtml:script src="startActivity.js"/>
  </xui:resource>
</xui:window>

我刚适用了radio,也是一样多一个按钮
回复 支持 反对

使用道具 举报

310

主题

4938

帖子

4767

积分

论坛元老

Rank: 8Rank: 8

积分
4767
QQ
发表于 2014-9-2 12:39:26 | 显示全部楼层

清下缓存,再把服务重启一遍试试
QQ:179785966
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2024-5-3 22:56 , Processed in 0.105099 second(s), 29 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表