(10)ExtJS之Ext.form.filed.TextArea文本区

来源:互联网 发布:手机五彩闪光灯软件 编辑:程序博客网 时间:2024/05/21 17:35

JS文件:

Ext.onReady(function(){Ext.QuickTips.init();var testForm=new Ext.form.Panel({title:'Ext.form.field.TextArea示例',bodyStyle:'padding:5',//表单边距frame:true,height:150,width:250,renderTo:'form',items:[{xtype:'textarea',fieldLabel:'备注',id:'memo',//字段组件idlabelSeparator:':',//分隔符labelWidth:60,//标签宽度width:200}],buttons:[{text:'确定',handler:showValue}]});function showValue(){var memo=testForm.getForm().findField('memo');//去的输入控件alert(memo.getValue());//取得控件值}});

jsp文件:

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%><%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html>  <head>    <base href="<%=basePath%>">        <title>My JSP 'JS1.jsp' starting page</title>    <meta http-equiv="pragma" content="no-cache"><meta http-equiv="cache-control" content="no-cache"><meta http-equiv="expires" content="0">    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"><meta http-equiv="description" content="This is my page"><!-- extjs的样式文件 --><link rel="stylesheet" type="text/css" href="js/extjs/resources/css/ext-all.css"><!-- extjs的核心文件 --><script type="text/javascript" charset="utf-8" src="js/extjs/ext-all-debug.js"></script><!-- 国际化文件 --><script type="text/javascript" charset="utf-8" src="js/extjs/ext-lang-zh_CN.js"></script><script type="text/javascript" charset="utf-8" src="base/009_text.js"></script>  </head>      <body style="margin:10px">  <div id="form"></div>   <!-- 错误信息展示元素 -->  <div id="errorMsg"></div>  </body></html>



0 0
原创粉丝点击