This content has been marked as final.
Show 6 replies
-
1. Re: How to make a shared yes/no or ok/cancel page
pmuir Oct 3, 2006 12:41 PM (in response to pplaninsky)If you are using facelets I suggest using source-composition components - they work a treat for that sort of task
<my:yesNoButtons yesBean="#{user}" yesAction="deleteUser" noBean="..." noAction="..." />
You have to pass in the bean and the action string seperately in current facelets version, but I think that is to be fixed soon (so you can pass a methodbinding as a tag attribute) -
2. Re: How to make a shared yes/no or ok/cancel page
pplaninsky Oct 3, 2006 1:02 PM (in response to pplaninsky)Hi Peter,
thanks for the quick response.
However, I am just a beginner in Facelets.
Could you please, point out some detailed example/tutorial on the topic?
Thanks,
Filip -
3. Re: How to make a shared yes/no or ok/cancel page
pmuir Oct 3, 2006 1:19 PM (in response to pplaninsky)The faceelets reference manual gives the bare bones,
https://facelets.dev.java.net/nonav/docs/dev/docbook.html#taglib-create-source
and unfortunately the facelets example have nothing on this.
So
yesNoButtons.xhtmlhtml xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html"> <ui:composition> <h:commandButton value="Yes" action="#{yesBean[yesAction]}"/> <h:commandButton value="No" action="#{noBean[noAction]}"/> </ui:composition> </html>
examplePage.xhtml... xmlns:my="http://my.com/jsf/my" ... my:yesNoButtons yesBean="#{user}" yesAction="deleteUser" noBean="#{city}" noAction="deleteCity" /> ...
Wiring
my.taglib.xml<!DOCTYPE facelet-taglib PUBLIC "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN" "http://java.sun.com/dtd/faces-taglib_1_0.dtd"> <facelet-taglib> <namespace>http://my.com/jsf/my</namespace> <tag> <tag-name>yesNoButtons</tag-name> <source>yesNoButtons.xhtml</source> </tag> </facelet-taglib>
web.xml... <context-param> <param-name>facelets.LIBRARIES</param-name> <param-value>/WEB-INF/my.taglib.xml</param-value> </context-param> ...
Pub my.taglib.xml and yesNoButtons.xhtml in WEB-INF -
4. Re: How to make a shared yes/no or ok/cancel page
pmuir Oct 3, 2006 1:35 PM (in response to pplaninsky)I wrote this up for the wiki:
http://wiki.jboss.org/wiki/Wiki.jsp?page=FaceletsSourceTags -
5. Re: How to make a shared yes/no or ok/cancel page
pplaninsky Oct 3, 2006 2:11 PM (in response to pplaninsky)Hi Peter,
that's great!
Thanks for the help - I appreciate it very much.
Thanks,
Filip -
6. Re: How to make a shared yes/no or ok/cancel page
gavin.king Oct 3, 2006 5:39 PM (in response to pplaninsky)Thanks for your contribution to the Wiki :)