听说extjs不错,特别是grid,很好用,输入表格很好。下了一个试试。 做了一个hello world,发现还比较容易。 <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="x"%> <%@ page session="false" contentType="text/html;charset=utf-8" pageEncoding="utf-8"%> <html>
<head>
<title>Support Form</title>
<link rel="stylesheet" type="text/css" href="http://127.0.0.1/mycscw/ext3/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="http://127.0.0.1/mycscw/ext3/examples/grid/grid-examples.css" />
<script type="text/javascript" src="http://127.0.0.1/mycscw/ext3/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="http://127.0.0.1/mycscw/ext3/ext-all.js"></script>
<script type="text/javascript" src="http://127.0.0.1/mycscw/ext3/examples/grid/my.js"></script>
</head>
<body>
<f:view>
<b><h:messages styleClass="error" showSummary="true" showDetail="true" layout="table"/>
</b>
<h:form id="supportForm">
<center>
<br>----------------------------------<br><br><br><br>
HelloWorld. <h:inputText id="khmc" value="#{HelloBean.SayHello}" style="width: 178px"/><br>
<h:commandButton action="#{HelloBean.save}" id="submit" value="submit" />
<h:commandButton action="#{HelloBean.Close}" value="cancel" />
</center>
</h:form>
</f:view>
</body>
</html> my.js的内容如下:
Ext.onReady(function()
{
var win=new Ext.Window({title:"hello",width:300,height:200,html:'<h1>Hello,easyjf open source</h1>'});
win.show();
});
结果helloworld的窗口出来了
然后换上使用grid的js,
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="x"%> <%@ page session="false" contentType="text/html;charset=utf-8" pageEncoding="utf-8"%> <html>
<head>
<title>Support Form</title>
<link rel="stylesheet" type="text/css" href="http://127.0.0.1/mycscw/ext3/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="http://127.0.0.1/mycscw/ext3/examples/grid/grid-examples.css" />
<script type="text/javascript" src="http://127.0.0.1/mycscw/ext3/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="http://127.0.0.1/mycscw/ext3/ext-all.js"></script>
<script type="text/javascript" src="http://127.0.0.1/mycscw/ext3/examples/grid/edit-grid.js"></script>
</head>
<body>
<f:view>
<h:form id="supportForm">
<div id="editor-grid"></div> </h:form>
</f:view> </body>
</html>
这时候,grid就无论如何也出不来了。 在网络上一搜索,发现这方面的文章不多,有一个extfaces的项目,似乎是支持这2个的结合的。但是这个项目死掉了。其它就没有了。难道extjs就不支持jsf了?这也太可惜了。各位在jsf中使用过extjs了吗? 问题补充:
我觉得特别奇怪,非常的奇怪,jsf这2个技术,从原理说,井水不犯河水的。一个运行在server端,一个运行在client端。jsf执行后,extjs在客户端执行,为啥extjs就不起作用了呢? 我只要extjs的grid能显示出来就行了。
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="x"%> <%@ page session="false" contentType="text/html;charset=utf-8" pageEncoding="utf-8"%> <html>
<head>
<title>Support Form</title>
<link rel="stylesheet" type="text/css" href="http://127.0.0.1/mycscw/ext3/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="http://127.0.0.1/mycscw/ext3/examples/grid/grid-examples.css" />
<script type="text/javascript" src="http://127.0.0.1/mycscw/ext3/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="http://127.0.0.1/mycscw/ext3/ext-all.js"></script>
<script type="text/javascript" src="http://127.0.0.1/mycscw/ext3/examples/grid/my.js"></script>
</head>
<body>
<f:view>
<b><h:messages styleClass="error" showSummary="true" showDetail="true" layout="table"/>
</b>
<h:form id="supportForm">
<center>
<br>----------------------------------<br><br><br><br>
HelloWorld. <h:inputText id="khmc" value="#{HelloBean.SayHello}" style="width: 178px"/><br>
<h:commandButton action="#{HelloBean.save}" id="submit" value="submit" />
<h:commandButton action="#{HelloBean.Close}" value="cancel" />
</center>
</h:form>
</f:view>
</body>
</html> my.js的内容如下:
Ext.onReady(function()
{
var win=new Ext.Window({title:"hello",width:300,height:200,html:'<h1>Hello,easyjf open source</h1>'});
win.show();
});
结果helloworld的窗口出来了
然后换上使用grid的js,
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="x"%> <%@ page session="false" contentType="text/html;charset=utf-8" pageEncoding="utf-8"%> <html>
<head>
<title>Support Form</title>
<link rel="stylesheet" type="text/css" href="http://127.0.0.1/mycscw/ext3/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="http://127.0.0.1/mycscw/ext3/examples/grid/grid-examples.css" />
<script type="text/javascript" src="http://127.0.0.1/mycscw/ext3/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="http://127.0.0.1/mycscw/ext3/ext-all.js"></script>
<script type="text/javascript" src="http://127.0.0.1/mycscw/ext3/examples/grid/edit-grid.js"></script>
</head>
<body>
<f:view>
<h:form id="supportForm">
<div id="editor-grid"></div> </h:form>
</f:view> </body>
</html>
这时候,grid就无论如何也出不来了。 在网络上一搜索,发现这方面的文章不多,有一个extfaces的项目,似乎是支持这2个的结合的。但是这个项目死掉了。其它就没有了。难道extjs就不支持jsf了?这也太可惜了。各位在jsf中使用过extjs了吗? 问题补充:
我觉得特别奇怪,非常的奇怪,jsf这2个技术,从原理说,井水不犯河水的。一个运行在server端,一个运行在client端。jsf执行后,extjs在客户端执行,为啥extjs就不起作用了呢? 我只要extjs的grid能显示出来就行了。
解决方案 »
- <!doctype html>的问题
- js判断文本框中输入的内容是否包含\或/
- 初学javascript,菜鸟问一个菜鸟问题,关于window.find(string,true)
- 怎么用js把购物车数据保存在客户端内存中(或者其它简单高效办法)
- 在js中将字符串yyyy--MM--dd hh:mm:ss转成相同格式的日期时,怎么08/09会变成0????
- javascript引用框架问题
- 各位请进!!弹出窗口问题,如何不让active窗口弹出!!先谢谢了
- 求助
- 请 net_lover(孟子E章) 进来一下。
- 用javascript如何实现菜单隐藏?
- js读取数据库
- 修改一下倒计时的程序不成功,请帮忙看看,谢谢
jsp存活与server上, server只要把jsp译成html输送到浏览器就完成工作了。
然后你的html的叶面上的js才会起作用。
你把最后生成的html代码仔细检查一下。
<div id="editor-grid" style="height:xxxpx;"> </div>
加个高度看看或DIV中另点文字。