editable : false与 readonly 的区别

本文介绍了HTML中editable:false与readonly属性的区别,前者禁止输入,后者只允许查看,不能进行编辑操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

editable : false 不能输入

readonly:不可操作,只能看

转载于:https://www.cnblogs.com/haiqin/p/7877914.html

<p:outputPanel id="ConfResPanel"> <p:dataTable id="resultsTable" widgetVar="resTableVar" var="result" value="#{drugInfoList_MgBean.drugInfoDms}" paginator="true" rows="20" reflow="true" paginatorPosition="bottom" currentPageReportTemplate="(Total: {totalRecords}, Page: {currentPage}/{totalPages}) " paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="10,20,50" resizableColumns="true" style="margin-bottom:20px;width:auto;" rowHover="true" rowIndexVar="rowvar" lazy="true"> <f:facet name="header"> <p:toolbar id="toolBtn"> <f:facet name="right"> <p:commandLink id="toggler" value="选择列"/> <p:columnToggler datasource="resultsTable" trigger="toggler"/> </f:facet> </p:toolbar> </f:facet> <p:column headerText="药物编号" width="30" style="text-align: left;" readonly="true"> #{result.drugCode} </p:column> <p:column headerText="药物名称" width="50" style="text-align: left;" readonly="true" editable="true"> #{result.drugName} </p:column> <p:column headerText="规格" width="30" style="text-align: center;" readonly="true"> #{result.spec} </p:column> <p:column headerText="生产厂家" width="50" style="text-align: left;" readonly="true"> #{result.manufacturer} </p:column> <p:column headerText="单价" width="30" style="text-align: left;" readonly="true"> #{result.unitPrice} </p:column> <p:column headerText="适应症" width="100" style="text-align: center;" readonly="true"> #{result.contraindications} </p:column> <p:column headerText="有效期" width="50" style="text-align: center;" readonly="true"> <h:outputText value="#{result.expiryDate}"> <f:convertDateTime pattern="yyyy-MM-dd" timeZone="GMT+8"/> </h:outputText> </p:column> <p:column headerText="创建时间" width="50" style="text-align: center;" readonly="true" visible="false"> <h:outputText value="#{result.createDate}"> <f:convertDateTime pattern="yyyy-MM-dd" timeZone="GMT+8"/> </h:outputText> </p:column> <p:column headerText="更新时间" width="50" style="text-align: center;" readonly="true"> <h:outputText value="#{result.updateDate}"> <f:convertDateTime pattern="yyyy-MM-dd" timeZone="GMT+8"/> </h:outputText> </p:column> <p:column width="80" headerText="操作" style="text-align:center;"> <h:commandLink update="resultsTable" onmousedown="if (confirm('确定要取消该记录吗?')) return this.onclick()" action="#{drugInfoList_MgBean.onRemove(result.drugCode)}"> <h:outputText value="删除"/> </h:commandLink> <p:spacer width="10" height="0"/> <h:commandLink ajax="true" action="#{drugInfoList_MgBean.prepareEdit(result)}" oncomplete="PF('drugDialog').show()" update="drugDialog"> <h:outputText value="编辑"/> </h:commandLink> <p:spacer width="10" height="0"/> </p:column> </p:dataTable> <p:dialog header="编辑药物信息" id="drugDialog" widgetVar="drugDialog" modal="true" height="auto" width="500px"> <h:form id="drugForm"> <p:panelGrid columns="2"> <span class="ui-inputgroup-addon" style="font-weight: bold;width: auto;">药物编号</span> <p:inputText id="editDrugCode" style="width: 200px;height: 35px;" value="#{drugInfoList_MgBean.drugInfoDm.drugCode}" readonly="#{drugInfoList_MgBean.editMode}"/> <span class="ui-inputgroup-addon" style="font-weight: bold;width: auto;">药物名称</span> <p:inputText id="editDrugName" style="width: 200px;height: 35px;" value="#{drugInfoList_MgBean.drugInfoDm.drugName}"/> <span class="ui-inputgroup-addon" style="font-weight: bold;width: auto;">药物规格</span> <p:inputText id="editSpec" style="width: 200px;height: 35px;" value="#{drugInfoList_MgBean.drugInfoDm.spec}"/> <span class="ui-inputgroup-addon" style="font-weight: bold;width: auto;">生产厂家</span> <p:inputText id="editManufacturer" style="width: 200px;height: 35px;" value="#{drugInfoList_MgBean.drugInfoDm.manufacturer}"/> <span class="ui-inputgroup-addon" style="font-weight: bold;width: auto;">单价</span> <p:inputText id="editUnitPrice" style="width: 200px;height: 35px;" value="#{drugInfoList_MgBean.drugInfoDm.unitPrice}"/> <span class="ui-inputgroup-addon" style="font-weight: bold;width: auto;">适应症</span> <p:inputText id="editContraindications" style="width: 200px;height: 35px;" value="#{drugInfoList_MgBean.drugInfoDm.contraindications}"/> <span class="ui-inputgroup-addon" style="font-weight: bold;width:70px;">有效期至</span> <p:calendar class="ui-datepicker-buttonpane" id="editExpiryDate" navigator="true" pattern="yyyy-MM-dd" inputStyle="width:200px;height: 35px;" value="#{drugInfoList_MgBean.drugInfoDm.expiryDate}"></p:calendar> </p:panelGrid> <!-- 按钮容器 --> <p:commandButton value="保存" style="width:100px;margin-right:150px" ajax="true" action="#{drugInfoList_MgBean.saveDrug}" update="resultsTable" process="@form"/> </h:form> </p:dialog> </p:outputPanel>
05-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值