`

使用extremecomponents之妙

    博客分类:
  • java
 
阅读更多

 

<ec:table items="notes" var="note" method="POST" styleClass="clip" border="1" cellpadding="2" cellspacing="0"

action="?" filterable="true" sortable="true" showStatusBar="true" showExports="true" retrieveRowsCallback="limit"

sortRowsCallback="limit" filterRowsCallback="limit" showPagination="true" showTitle="true" showTooltips="true">

 

<ec:table onInvokeAction="ecTableForm.validate();">

onInvokeAction="ecTableForm.validate()"对表单列表页面增加自定义校验。

为加改属性生成默认表单提交代码:

<td><input type="text"  name="ec_f_bargainCode"  onkeypress="if (event.keyCode == 13) {javascript:document.forms.ec.ec_f_a.value='fa';document.forms.ec.ec_p.value='1';document.forms.ec.setAttribute('action','?');document.forms.ec.setAttribute('method','POST');document.forms.ec.submit()}" /></td>

<td><input type="text"  name="ec_f_buyerName"  onkeypress="if (event.keyCode == 13) {javascript:document.forms.ec.ec_f_a.value='fa';document.forms.ec.ec_p.value='1';document.forms.ec.setAttribute('action','?');document.forms.ec.setAttribute('method','POST');document.forms.ec.submit()}" /></td>

<td><input type="text"  name="ec_f_signDate"  onkeypress="if (event.keyCode == 13) {javascript:document.forms.ec.ec_f_a.value='fa';document.forms.ec.ec_p.value='1';document.forms.ec.setAttribute('action','?');document.forms.ec.setAttribute('method','POST');document.forms.ec.submit()}" /></td>

<td><input type="text"  name="ec_f_amount"  onkeypress="if (event.keyCode == 13) {javascript:document.forms.ec.ec_f_a.value='fa';document.forms.ec.ec_p.value='1';document.forms.ec.setAttribute('action','?');document.forms.ec.setAttribute('method','POST');document.forms.ec.submit()}" /></td>

<td><input type="text"  name="ec_f_typeMean"  onkeypress="if (event.keyCode == 13) {javascript:document.forms.ec.ec_f_a.value='fa';document.forms.ec.ec_p.value='1';document.forms.ec.setAttribute('action','?');document.forms.ec.setAttribute('method','POST');document.forms.ec.submit()}" /></td>

 

加了之后生成代码:

 

<td></td>

<td><input type="text"  name="ec_f_bargainCode"  onkeypress="if (event.keyCode == 13) {javascript:document.forms.ec.ec_f_a.value='fa';document.forms.ec.ec_p.value='1';javascript:alter('hello world');}" /></td>

<td><input type="text"  name="ec_f_buyerName"  onkeypress="if (event.keyCode == 13) {javascript:document.forms.ec.ec_f_a.value='fa';document.forms.ec.ec_p.value='1';javascript:alter('hello world');}" /></td>

<td><input type="text"  name="ec_f_signDate"  onkeypress="if (event.keyCode == 13) {javascript:document.forms.ec.ec_f_a.value='fa';document.forms.ec.ec_p.value='1';javascript:alter('hello world');}" /></td>

<td><input type="text"  name="ec_f_amount"  onkeypress="if (event.keyCode == 13) {javascript:document.forms.ec.ec_f_a.value='fa';document.forms.ec.ec_p.value='1';javascript:alter('hello world');}" /></td>

<td><input type="text"  name="ec_f_typeMean"  onkeypress="if (event.keyCode == 13) {javascript:document.forms.ec.ec_f_a.value='fa';document.forms.ec.ec_p.value='1';javascript:alter('hello world');}" /></td>

<td></td>

 

 

 

<SCRIPT type="text/javascript" defer="defer">

     var ecTableForm = {

               validate:function(){

                      //校验数据

                      var amountEle = $("ec_f_amount");

                      var amount = amountEle.value.unFormatCurrency();

                      if(!!amount){

                               if(isNaN(amount)){

                                      alert("请输入有效的金额值!"); 

                                      return; 

                               }else{

                              amountEle.value = amount; 

                               }

                          }

                   document.forms.ec.setAttribute('action','?');

                   document.forms.ec.setAttribute('method','POST');

                   document.forms.ec.submit();

                    }

        };

</SCRIPT>

 

 

分享到:
评论

相关推荐

    extremecomponents

    在Java环境中,我们通常会使用JavaServer Faces (JSF) 或 JavaFX 这样的技术来配合extremecomponents。JSF是一种用于构建MVC(模型-视图-控制器)架构的Java Web框架,而JavaFX则提供了丰富的图形用户界面组件,两者...

    eXtremeComponents

    eXtremeComponents控件指南

    eXtremeComponents组件

    这些包可能包含了必要的函数、类和接口,使得开发者可以轻松地在项目中集成和使用eXtremeComponents。此外,“eXtremeComponents的事例”则意味着压缩包中可能包含了一些示例代码或应用程序,展示如何有效地利用这些...

    eXtremeComponents详解

    为了更好地理解和使用eXtremeComponents,你可以参考以下资源: - **eXtremeComponents中文指南1.doc**: 这份文档深入介绍了EC的基本概念和使用方法,是初学者入门的必备资料。 - **eXtremeComponents中文指南2.doc...

    eXtremeComponents-1.0.1+中文API___分页工具

    **eXtremeComponents-1.0.1+中文API 分页工具详解** 在软件开发中,尤其是在处理大量数据时,分页功能是必不可少的。它使得用户可以更有效地浏览和管理信息,避免一次性加载过多内容导致的性能问题。本文将深入探讨...

    extremecomponents 包

    extremecomponents 包

    eXtremeComponents-1.0.4.zip

    本文将深入探讨eXtremeComponents的核心特性和使用方法。 首先,eXtremeComponents是一个开源的Java库,专注于提供高质量的JSP标签库。它主要设计用于处理复杂的数据展示,特别是表格形式的数据。在版本1.0.4中,这...

    eXtremeComponents详尽文档包

    **eXtremeComponents详尽文档包** eXtremeComponents(简称EC)是一个功能强大的组件库,专门针对Java Swing应用程序设计。这个详尽的文档包是为初学者准备的,旨在帮助他们快速掌握EC组件的使用和开发技巧。通过一...

    eXtremeComponents介绍

    此外,EC还支持国际化,适应多语言环境,同时提供了良好的文档和示例代码,方便开发者学习和使用。 **ecside** ecside是eXtremeComponents的一个重要组成部分,是一个基于Java的轻量级Web框架。它的设计目标是简化...

    eXtremeComponents 源代码

    总的来说,eXtremeComponents源代码和.jar包为Java开发者提供了一套强大的组件工具箱,通过学习和使用这些组件,开发者可以更高效地开发出功能丰富、用户体验优秀的Java应用程序。同时,开源的特性也鼓励了社区的...

    eXtremeComponents-1.0.3

    【eXtremeComponents-1.0.3】是一个软件组件包,它的出现是为了提供一套高效、易用的开发工具,以帮助程序员在构建应用程序时提高生产力和代码质量。这个版本1.0.3是该组件集合的一个稳定版本,用户反馈良好,表明它...

    extremeComponents源代码

    "ExtremeComponents"是一个开源项目,其源代码包含了用于构建Web应用程序的组件库。这个库主要设计用于提高开发效率,提供了一系列高效、可定制且功能丰富的Web UI组件。这些组件通常包括表格、表单、菜单、按钮等...

    extremeComponents中文文档

    这个库专门设计来提升开发者的生产力,提供了一系列丰富的UI组件和工具,适用于前端开发者在创建复杂的Web界面时使用。在"extremeComponents中文文档"中,您将找到关于如何配置和有效利用这些组件的详细指南。 1. *...

    eXtremeComponents控件分页导出数据Demo.rar

    《eXtremeComponents控件分页导出数据Demo详解》 在软件开发过程中,高效的数据展示和管理是至关重要的。eXtremeComponents控件系列以其强大的功能和灵活的定制性,在.NET平台上赢得了广大开发者的一致好评。尤其是...

    eXtremeComponents1.0.1.jar

    eXtremeComponents1.0.1.jar

    extremeComponents

    eXtremeComponents 的Tag 之一 eXtremeComponents 的Tag 之一

    分页组件extremeComponents的使用

    本篇将详细介绍如何使用XC的分页组件。 首先,要使用XC的分页组件,我们需要准备最小的Jar包。根据描述中的博文链接(https://wl-ldy.iteye.com/blog/1040160),开发者可以找到这些必要的依赖文件。确保项目中包含...

    eXtremeComponents jar+doc+example

    总的来说,"eXtremeComponents jar+doc+example" 提供了一套完整的解决方案,涵盖了开发、理解和使用`ECTable`所需的全部资源。无论你是初次接触这个组件还是寻求增强已有项目的数据展示功能,这个资源包都能为你...

Global site tag (gtag.js) - Google Analytics