网站首页 新闻首页 网页设计图形动画软件编程网站开发办公软件操作系统数据库网络技术认证考试范文资料黑客攻防 书籍教程 进入论坛

EasyJWeb-1.1版发布

http://www.diybl.com/ 2008-2-22  网络 点击:  [ 评论 ]
文章搜索:    【点击打包该文章】


  我们非常高兴的宣布,EasyJWeb-1.1今日正式对外发布,这个版本主要对EasyJWeb的Ajax支持作较大的改进。主要包括下面的内容:
   1、在EasyJWeb Tools中增加了一套Rich Component组件,可以与其它客户端Ajax框架比如ExtJS等集成开发RIA应用。
   2、修改了远程脚本调用引擎,使得性能比上一版本前提升了近2倍,详见http://www.easyjf.com/blog/html/20080103/1015816.html
   3、多国语言功能增加了对 xml格式属性文件的支持,http://jira.easyjf.com/browse/EASYJWEB-33
   4、增加从服务器输入JSon数据对象的快捷支持。
   5、提供了更多的EastJWeb实例应用,详见http://easyjweb.demo.easyjf.com/
   6、修正了这两个月来大家提出的Bug及调整了一些功能,详细见jira.easyjf.com。
   7、完善了入门文档,详见wiki.easyjf.com。

   源码下载ftp://ftp1.easyjf.com/easyjweb/easyjweb-1.1/easyjweb-1.1.zip
   在线示例http://easyjweb.demo.easyjf.com
   在线文档http://wiki.easyjf.com/display/wiki/EasyJWeb

  这里对Rich Component及Ajax改进作简单介绍。

一、EasyJWeb Rich Component

   EasyJWeb 1.1版提供了一套富客户端组件,也就是Rich Componet,可以用来与ExtJS等配合快速开发出基于Ajax的RIA应用。不再需要写烦琐的javascript,直接用java就能写出漂亮的基于ExtJS等客户端框架的Ajax应用,详见示例http://wlr2.easyjf.com/
  比如只需要下面的Action代码:

public class SimpleAction extends RichComponentAction {	public Page doGrid() {		ViewPort view = new ViewPort();		GridPanel grid = new GridPanel("grid", "数据表格",500,100);		grid.setColumns(new String[]{"id","姓名","出生日期","email"});				view.add(grid);				this.addComponent(view);		return  componentPage;	}}

  访问simple.ejf?cmd=grid将会得到一个非常漂亮的表格:

 

public Page doTree() {		ViewPort view = new ViewPort();		TreePanel tree=new TreePanel("tree","简单的树",200);		TreeNode root=new TreeNode("root","根");		root.add(new TreeNode("c1","孩子1"));		root.add(new TreeNode("c2","孩子2"));		root.getChildNodes().get(1).add(new TreeNode("c3","孙子"));		tree.setRoot(root);		view.add(tree);		this.addComponent(view);		return componentPage;	}

  访问simple.ejf?cmd=tree将会得到一个还不错的树:

 

  如何实现一个添删改查、分页呢?看下面的代码:

public Page doCrud() {		ViewPort view = new ViewPort("fit");		CrudPanel crud = new SimpleCrud();				view.add(crud);				this.addComponents(view);		return componentPage;	}	public class SimpleCrud extends CrudPanel {		public SimpleCrud() {			super("test", "简单测试", "link.ejf");			this.setColumns(new String[][] { { "title", "名称" },{ "url", "网址" },					{ "rss", "RSS" } });			this.getPagingToolbar().setDisplayInfo(true);			this.getGrid().load();		}		@Override		public Function getCreateWin() {			return new Function("return this.initWin(438,300,''连接管理'');");		}		@Override		public Form getForm() {			Form f = new Form();			f.add(new TextField("title", "主题"));			f.setLazy(false);			return f;		}	}

  访问simple.ejf?cmd=crud将会得到一个添删改查及分页的界面,点击“添加”、“修改”、“删除”、“刷新”等按钮可以执行相应的操作,如下图所示:

 

  二、其它Ajax支持的改进及完善

  1、在以前EasyJWeb的Ajax支持引擎基础上,对远程脚本调用引擎中的脚本engine.js作了调整,使得回调函数可以选择作用域scope。
服务器业务组件:

public class PersonServiceImpl { /**  * 得到服务器当前时间  * @return  */ public Date getTime() {  return new Date(); } }

  Bean配置文件:

文章整理:DIY部落 http://www.diybl.com (本站)   【点击打包该文章】
[1] [2]
如果图片或页面不能正常显示请点击这里 站内搜索:   

文章评论

请您留言

 

最新新闻