听说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能显示出来就行了。 

解决方案 »

  1.   

    ext和java server face有什么关系?和jsp都没有关系。
    jsp存活与server上, server只要把jsp译成html输送到浏览器就完成工作了。
    然后你的html的叶面上的js才会起作用。
    你把最后生成的html代码仔细检查一下。
      

  2.   

    完全胡说,新出的 OPERAMARKS 就有EXT写的。
    <div id="editor-grid" style="height:xxxpx;"> </div>
    加个高度看看或DIV中另点文字。
      

  3.   

    库文件导入了吗?package里的文件导入没?