- 浏览: 147993 次
- 性别:
- 来自: 苏州
文章分类
- 全部博客 (87)
- seam/jsf (22)
- java (24)
- spring (6)
- hibernate (2)
- Mysql (4)
- web (1)
- JMS (0)
- 计算机(computer) (1)
- linux (3)
- eclipse (4)
- Javascript (1)
- xstream (3)
- JPA (2)
- 汇编 (1)
- HttpClient (1)
- quartz (1)
- J2EE (2)
- EJB (1)
- restful web (1)
- maven (1)
- TTServer (3)
- restlet (0)
- jquery (0)
- Firebug (0)
- jquery Masonry+Infinite-Scroll (0)
- JACOB (0)
- elasticsearch (0)
最新评论
-
tuspark:
关于ApplicationContextAware的详细介绍, ...
ApplicationContextAware -
hc_face:
应该是 环境被初始化的时候,bean 也一并被初始化吧。先后顺 ...
ApplicationContextAware -
奇林醉:
有点明白了
Collections.unmodifiableList() -
tcking:
HashSet不关心迭代的次序,也就是说下一次的迭代次序可能就 ...
HashSet LinkedHashSet TreeSet -
yzhw:
我要去试试
seam前端提速
1. <rich:dropDownMenu>
1) <rich:dropDownMenu> 生成下拉菜单。
2) 每一个 menu item 都可以设定 action 或 actionListener 以供 Ajax 调用。 reRender 属性定义需要被刷新的控件。
3) <rich:toolBar> 是装载下拉菜单的容器。
4) <rich:dropDownMenu> 不提供其自己的 form ,所以必须置于 form 里才能使用。
5) 可以使用 <rich:dropDownMenu> 的 value 属性或者 <f:facet name=”label”> 来指定菜单的名称。
6) submitMode 属性控制提交模式,三种选择:
l Server (默认):使用常规的表单提交 Request ;
l Ajax :使用 Ajax 提交;
l None : action 和 actionListener 都被忽略掉, menu item 不触发任何提交,所有行为都取决于嵌于 item 内部的控件。
如果在 <rich:dropDownMenu> 设置该属性,则其内部的所有 menuItem 也将继承其属性值。
7) <rich:menuItem> 也提供了 onXXXX 属性,例如 onselect 、 onclick 、 oncomplete 等,用于调用自定义 JavaScript 代码(如显示 modalPanel 等)。
2. <rich:contextMenu>
1) event 属性用于设定引起 contextMenu 弹出的事件,比如 oncontextmenu 、 onclick 等,主要还是要看 <rich:contextMenu> 所服务的控件支持哪些 onXXXX 事件。
2) submitMode 属性控制提交模式,三种选择:
l Server (默认):使用常规的表单提交 Request ;
l Ajax :使用 Ajax 提交;
l None : action 和 actionListener 都被忽略掉, menu item 不触发任何提交,所有行为都取决于嵌于 item 内部的控件。
如果在 <rich:contextMenu> 设置该属性,则其内部的所有 menuItem 也将继承其属性值。
3) attachTo 属性用于指定将 contextMenu 指定给哪个控件。
4) 或是将 <rich:contextMenu> 直接置于某个控件体内,并将 attached 属性设为 true ,也可以实现以上效果。比如在表格中使用时,可以将 <rich:contextMenu> 直接放在 <rich:column> 中。
但应注意,根据用户指南提示, <rich:contextMenu> 应该放在 <h:outputText> 外面,或者为 <h:outputText> 设置 ID ,已实现正常使用。
5) disableDefaultMenu 属性可以彻底禁用页面的默认右键菜单。
6) 可以在 menuItem 体内,使用 <f:setPropertyActionListener> 或 <a4j:actionparam> ,传递参数。
3. <rich:contextMenu> 与 <rich:componentControl>
1) 可以用 <rich:componentControl> 来调用显示 contextMenu ,并传递参数,例如:
<rich:componentControl event="onRowClick" for="menu" operation="show">
<f:param value="#{air.name}" name="airlineName" />
</rich:componentControl>
2) 这时 <rich:contextMenu> 的 attached 属性应该设为 false 。
3) 通过 <f:param> 传递的参数,可以在 contextMenu 中使用,比如:
<rich:menuItem value="Select {airlineName} " actionListener="#{airlinesBean.select}">
</rich:menuItem>
注意,这里用的是 {paramName} ,而 #{paramName} ,没有“ # ”。
4. <rich:contextMenu> 与 <a4j:support>
1) 当需要动态的向 <rich:contextMenu> 传递参数的时候,尤其是在 dataTable 中的时候,有两种方法:
l 将 <rich:contextMenu> 放在 dataTable 体内,则 <rich:contextMenu> 可以直接使用 dataTable 的 var 属性;但局限性就是,必须置于 dataTable 体内;
l 另方法就是使用 <a4j:support> 。
2) 具体方法就是通过设定 <a4j:support> 的 event 属性,指定父控件的什么样的事件会弹出 contextMenu 。例如:
<a4j:form>
<rich:dataTable id="dtTable" value="#{dataTableTestBean.xcvrList}" var="xcvr" rows="15">
<rich:column>
<f:facet name="header">
<h:outputText value="Item Code"></h:outputText>
</f:facet>
<h:outputText value="#{xcvr.itemCode}"></h:outputText>
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Market Name"></h:outputText>
</f:facet>
<h:outputText value="#{xcvr.marketName}"></h:outputText>
</rich:column>
<a4j:support event="onRowContextMenu" reRender="ctxMenu" oncomplete=" #{rich:component('ctxMenu')}.doShow(event,{}) " >
<f:setPropertyActionListener value="#{xcvr}" target="#{dataTableTestBean.selectedXcvr}"/>
</a4j:support>
</rich:dataTable>
<rich:contextMenu id="ctxMenu" submitMode="ajax" attached="false" disableDefaultMenu="true">
<rich:menuItem value="View #{dataTableTestBean.selectedXcvr.itemCode}" reRender="detailPanel" ajaxSingle="true" actionListener="#{dataTableTestBean.menuClicked}" oncomplete="#{rich:component('detailPanel')}.show()">
</rich:menuItem>
</rich:contextMenu>
</a4j:form>
5. 尚存疑问
1) 在使用 contextMenu 时,我曾想通过点击 menuItem 来弹出 modalPanel ,也确实成功了。但是问题是,只是隔次成功,换句话说,就是第一次成功、第二次失败、第三次成功、第四次失败……但奇怪的是,如果只是弹出菜单,而没有点击,则再次右键弹出时,就又成功了。
2) 失败的时候,连 actionListener 都不会执行, modalPanel 更是没有弹出。我换了好几种方法, dataTable 内外都试过了,均是如此。但如果去除要弹出modalPanel的代码,则一切恢复正常,actionListener每次也能正常运行。
3) 我在 JavaRanch 的论坛上,发了帖子,还在等待解答。
http://www.coderanch.com/t/449548/JSF/java/Trouble-with-ContextMenu-ModalPanel-RichFaces
Hi all,
I met some trouble when I used the RichFaces contextMenu and modalPanel together.
I hope to show the modalPanel by clicking the context menu item.
For the first time I clicked the menu item, the modal was showed. However, the second time, the menu item even didn't execute. Then the third time, everything went well again. And then 4th time failed, 5th time succeeded, 6th time failed..., alternately.
Thus, 50% succeeded and 50% failed. It's too weird.
1. <f:view>
2. <a4j:form>
3. <h:panelGroup id="panelGroup" >
4. <h:outputText value="Right Click Me!" ></h:outputText>
5. </h:panelGroup>
6.
7. <rich:contextMenu attachTo="panelGroup" event="oncontextmenu"
8. submitMode="ajax" disableDefaultMenu="true" >
9. <rich:menuItem value="try"
10. oncomplete="#{rich:component('modalPanel')}.show()"
11. actionListener="#{contextMenuTestBean.menuClicked}" ></rich:menuItem>
12. </rich:contextMenu>
13. </a4j:form>
14.
15. <rich:modalPanel id="modalPanel" >
16. <f:facet name="header" >
17. <h:outputText value="Modal Panel" />
18. </f:facet>
19. <h:outputText value="Hello!" />
20. <a4j:commandLink value="Close"
21. onclick="#{rich:component('modalPanel')}.hide()" ></a4j:commandLink>
22. </rich:modalPanel>
23. </f:view>
When I remove the code on line 10.
oncomplete="#{rich:component('modalPanel')}.show()"
The actionListener of menuItem can be executed successfully every time.
Can anybody help to advise the reason?
Thanks in advance!
from:http://blog.csdn.net/gengv/archive/2009/06/14/4269014.aspx
1) <rich:dropDownMenu> 生成下拉菜单。
2) 每一个 menu item 都可以设定 action 或 actionListener 以供 Ajax 调用。 reRender 属性定义需要被刷新的控件。
3) <rich:toolBar> 是装载下拉菜单的容器。
4) <rich:dropDownMenu> 不提供其自己的 form ,所以必须置于 form 里才能使用。
5) 可以使用 <rich:dropDownMenu> 的 value 属性或者 <f:facet name=”label”> 来指定菜单的名称。
6) submitMode 属性控制提交模式,三种选择:
l Server (默认):使用常规的表单提交 Request ;
l Ajax :使用 Ajax 提交;
l None : action 和 actionListener 都被忽略掉, menu item 不触发任何提交,所有行为都取决于嵌于 item 内部的控件。
如果在 <rich:dropDownMenu> 设置该属性,则其内部的所有 menuItem 也将继承其属性值。
7) <rich:menuItem> 也提供了 onXXXX 属性,例如 onselect 、 onclick 、 oncomplete 等,用于调用自定义 JavaScript 代码(如显示 modalPanel 等)。
2. <rich:contextMenu>
1) event 属性用于设定引起 contextMenu 弹出的事件,比如 oncontextmenu 、 onclick 等,主要还是要看 <rich:contextMenu> 所服务的控件支持哪些 onXXXX 事件。
2) submitMode 属性控制提交模式,三种选择:
l Server (默认):使用常规的表单提交 Request ;
l Ajax :使用 Ajax 提交;
l None : action 和 actionListener 都被忽略掉, menu item 不触发任何提交,所有行为都取决于嵌于 item 内部的控件。
如果在 <rich:contextMenu> 设置该属性,则其内部的所有 menuItem 也将继承其属性值。
3) attachTo 属性用于指定将 contextMenu 指定给哪个控件。
4) 或是将 <rich:contextMenu> 直接置于某个控件体内,并将 attached 属性设为 true ,也可以实现以上效果。比如在表格中使用时,可以将 <rich:contextMenu> 直接放在 <rich:column> 中。
但应注意,根据用户指南提示, <rich:contextMenu> 应该放在 <h:outputText> 外面,或者为 <h:outputText> 设置 ID ,已实现正常使用。
5) disableDefaultMenu 属性可以彻底禁用页面的默认右键菜单。
6) 可以在 menuItem 体内,使用 <f:setPropertyActionListener> 或 <a4j:actionparam> ,传递参数。
3. <rich:contextMenu> 与 <rich:componentControl>
1) 可以用 <rich:componentControl> 来调用显示 contextMenu ,并传递参数,例如:
<rich:componentControl event="onRowClick" for="menu" operation="show">
<f:param value="#{air.name}" name="airlineName" />
</rich:componentControl>
2) 这时 <rich:contextMenu> 的 attached 属性应该设为 false 。
3) 通过 <f:param> 传递的参数,可以在 contextMenu 中使用,比如:
<rich:menuItem value="Select {airlineName} " actionListener="#{airlinesBean.select}">
</rich:menuItem>
注意,这里用的是 {paramName} ,而 #{paramName} ,没有“ # ”。
4. <rich:contextMenu> 与 <a4j:support>
1) 当需要动态的向 <rich:contextMenu> 传递参数的时候,尤其是在 dataTable 中的时候,有两种方法:
l 将 <rich:contextMenu> 放在 dataTable 体内,则 <rich:contextMenu> 可以直接使用 dataTable 的 var 属性;但局限性就是,必须置于 dataTable 体内;
l 另方法就是使用 <a4j:support> 。
2) 具体方法就是通过设定 <a4j:support> 的 event 属性,指定父控件的什么样的事件会弹出 contextMenu 。例如:
<a4j:form>
<rich:dataTable id="dtTable" value="#{dataTableTestBean.xcvrList}" var="xcvr" rows="15">
<rich:column>
<f:facet name="header">
<h:outputText value="Item Code"></h:outputText>
</f:facet>
<h:outputText value="#{xcvr.itemCode}"></h:outputText>
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Market Name"></h:outputText>
</f:facet>
<h:outputText value="#{xcvr.marketName}"></h:outputText>
</rich:column>
<a4j:support event="onRowContextMenu" reRender="ctxMenu" oncomplete=" #{rich:component('ctxMenu')}.doShow(event,{}) " >
<f:setPropertyActionListener value="#{xcvr}" target="#{dataTableTestBean.selectedXcvr}"/>
</a4j:support>
</rich:dataTable>
<rich:contextMenu id="ctxMenu" submitMode="ajax" attached="false" disableDefaultMenu="true">
<rich:menuItem value="View #{dataTableTestBean.selectedXcvr.itemCode}" reRender="detailPanel" ajaxSingle="true" actionListener="#{dataTableTestBean.menuClicked}" oncomplete="#{rich:component('detailPanel')}.show()">
</rich:menuItem>
</rich:contextMenu>
</a4j:form>
5. 尚存疑问
1) 在使用 contextMenu 时,我曾想通过点击 menuItem 来弹出 modalPanel ,也确实成功了。但是问题是,只是隔次成功,换句话说,就是第一次成功、第二次失败、第三次成功、第四次失败……但奇怪的是,如果只是弹出菜单,而没有点击,则再次右键弹出时,就又成功了。
2) 失败的时候,连 actionListener 都不会执行, modalPanel 更是没有弹出。我换了好几种方法, dataTable 内外都试过了,均是如此。但如果去除要弹出modalPanel的代码,则一切恢复正常,actionListener每次也能正常运行。
3) 我在 JavaRanch 的论坛上,发了帖子,还在等待解答。
http://www.coderanch.com/t/449548/JSF/java/Trouble-with-ContextMenu-ModalPanel-RichFaces
Hi all,
I met some trouble when I used the RichFaces contextMenu and modalPanel together.
I hope to show the modalPanel by clicking the context menu item.
For the first time I clicked the menu item, the modal was showed. However, the second time, the menu item even didn't execute. Then the third time, everything went well again. And then 4th time failed, 5th time succeeded, 6th time failed..., alternately.
Thus, 50% succeeded and 50% failed. It's too weird.
1. <f:view>
2. <a4j:form>
3. <h:panelGroup id="panelGroup" >
4. <h:outputText value="Right Click Me!" ></h:outputText>
5. </h:panelGroup>
6.
7. <rich:contextMenu attachTo="panelGroup" event="oncontextmenu"
8. submitMode="ajax" disableDefaultMenu="true" >
9. <rich:menuItem value="try"
10. oncomplete="#{rich:component('modalPanel')}.show()"
11. actionListener="#{contextMenuTestBean.menuClicked}" ></rich:menuItem>
12. </rich:contextMenu>
13. </a4j:form>
14.
15. <rich:modalPanel id="modalPanel" >
16. <f:facet name="header" >
17. <h:outputText value="Modal Panel" />
18. </f:facet>
19. <h:outputText value="Hello!" />
20. <a4j:commandLink value="Close"
21. onclick="#{rich:component('modalPanel')}.hide()" ></a4j:commandLink>
22. </rich:modalPanel>
23. </f:view>
When I remove the code on line 10.
oncomplete="#{rich:component('modalPanel')}.show()"
The actionListener of menuItem can be executed successfully every time.
Can anybody help to advise the reason?
Thanks in advance!
from:http://blog.csdn.net/gengv/archive/2009/06/14/4269014.aspx
发表评论
-
seam前端提速
2010-09-08 13:11 1349Seam使用了richfaces做为jsf ... -
seam topic
2010-08-25 16:58 2181Forum: Seam Users Forum ListTop ... -
maven 中使用jetty 改端口号
2010-08-04 13:52 1370jetty 使用时,如果出现 address already ... -
seam空格
2010-07-23 09:59 684seam空格:&nbps;没用 ,要使用 ... -
null value seam
2010-07-23 09:33 511因为给model添加一个double类型的字段(数据库已有一些 ... -
Seam el 中使用 map
2010-06-29 15:23 1257一直以为在el里不能用map,今天发现原来可以... @na ... -
seam pdf The document has no pages
2010-06-28 13:31 1738用seam 中的pdf功能时 出现The document h ... -
JSF多对多增加
2010-06-25 17:04 891多对多关系时 person (n-n) work (perso ... -
JSF Chapter04
2010-06-24 13:18 1496. 用队列控制 Event Traffic ... -
JSF Chapter11
2010-06-24 13:14 8331. 使用内建的 Skins 1) 基 ... -
JSF Chapter10
2010-06-24 13:13 1158. <rich:scrollableDataT ... -
JSF Chapter08
2010-06-24 11:34 12811. <rich:pickList> ... -
JSF Chapter07
2010-06-24 11:34 15641. 常用的 dataTable 类的控件有: l ... -
JSF Chapter06
2010-06-24 11:20 1712. <rich:panel> 1) ... -
JSF Chapter05
2010-06-24 11:18 16481. a4j: 提供了页面级的 Ajax 支持,也 ... -
JSF Chapter03
2010-06-24 11:14 1463本章主要包括三方面内 ... -
JSF Chapter02
2010-06-24 11:13 9311. 配置 RichFaces 1) ... -
JSF Chapter01
2010-06-24 11:12 9021. JSF’s View = UICompone ... -
JSF Chapter04(频繁调用控件)
2010-06-24 11:06 13271. <!-- [end ... -
Property '****' is not writable on type
2010-04-28 22:20 1079再用seam+jsf开发的时候冒出:***Edit.xhtml ...
相关推荐
资源名称:精通JSF—基于EJBHibernateSpring开发实践视频教程资源目录:【】chapter13_code【】Jsf第七章【】JSF第二章【】Jsf第五章【】Jsf第八章【】Jsf第六章【】Jsf第十三章【】Jsf第十五章【】Jsf第十六章【】...
Topics in This Chapter • “Why JavaServer Faces?” on page 3 • “A Simple Example” on page 4 • “Development Environments for JSF” on page 13 • “An Analysis of the Sample Application” on page ...
The state-of-the-art concepts such as SOAP, Applet, Servlet, JSP, JDBC, Hibernate, JMS, J2EE, JNDI, CORBA, JSF etc. have been discussed in the last part. The content is enhanced with numerous ...
Chapter 3: JSF Component Libraries Chapter 4: Interacting with Databases through the Java Persistence API Chapter 5: Implementing the Business Tier with Session Beans Chapter 6: Contexts and ...
Discover how to use EJB 3.x, JSF 2.x, Ajax, JAX-RS, JAX-WS, and Spring with WildFly 8.1 A practical guide filled with easy-to-understand programming examples to help you gain hands-on experience with ...
Discover how to use EJB 3.x, JSF 2.x, Ajax, JAX-RS, JAX-WS, and Spring with WildFly 8.1 A practical guide filled with easy-to-understand programming examples to help you gain hands-on experience with ...
Use JSP, Servlet, JSF, and EJBs to create a user interface and write business logic Create JEE database applications using JDBC and JPA Handle asynchronous messages using MDBs for better scalability ...
Chapter 1. Seam 入门.................................................................................................................................................................14 1.1. 试试看........
■ Chapter 18: Spring Web Flow and JSF.............................................................663 ■ Chapter 19: Spring Testing ......................................................................
6 More Examples on JSF and Visual Web Development Part VI -- Case Studies 1 Complete Sudoku Solution (Chapter 7) Sudoku Solution Animation ...
本书涵盖了所有主要的Java EE 8 API,包括JSF 2.3,Enterprise JavaBeans(EJB)3.2,上下文和依赖关系。注入(CDI)2.0,WebSocket的Java API,JAX-RS 2.1,Servlet 4.0等。 说明和导航 所有代码都组织在文件夹中。...