tagfile

Proper using of Facelet templates & Composite Components

久未见 提交于 2019-12-12 08:47:05
问题 I'm still not sure about proper using of JSF Templates & Composite Components. I need create an enterprise web applications, which will have a lot of pages. Every page will have the same header, menu, footer and of course different content (= JSF template). The content on every pages will consist of reusable "boxes" (= JSF composite components). The boxes consist of some fileds, buttons etc. Is my solution proper? Or should I use other technology like , Custom Components, decorate ...? layout

Conditional render in tagfile depending on whether the attribute is specified or not

丶灬走出姿态 提交于 2019-12-11 04:17:03
问题 I have a Facelet tagfile and need to render different components depending on whether the attribute is specified or not. I tried it as below, <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui" xmlns:pe="http://primefaces.org/ui/extensions" xmlns:c="http://java.sun.com/jsp/jstl/core"> <h:panelGrid columns="1"> <p:outputLabel value="test1

Passing valueChangeListener method expression into tag file

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 03:48:36
问题 I have a <h:inputText> with an event listener like following: <h:inputText valueChangeListener="#{myBean.handle}"/> I would like to put it in a tag file which is to be used as follows: <my:itext changeListener="#{myBean.handle}" /> With inside the tag file: <h:inputText valueChangeListener="#{changeListener}" /> However it's evaluating it as a property instead of as a listener method. How can I pass the listener method into a tag file? 回答1: You can by design not pass method expressions as a

How do I include a body into a tagfile

人盡茶涼 提交于 2019-12-09 03:03:28
I have a tagfile I intend to use as an input template: <ui:composition xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"> <div class="qr"> <label>#{question}</label> <div class="helpButton"></div> <!-- body here --> <!-- errors output eventually to go here --> </div> </ui:composition> It is stored in my /WEB-INF/tags folder with a .taglib.xml and necessary web.xml context-param. I understand it could be used as follows: <g:question question="What is your name?" id="firstname"> <h

Multiple JSF components inside a PanelGrid

爷,独闯天下 提交于 2019-12-08 07:02:25
问题 I am trying to get the reusable group of jsf 1.2 components inside a panelgrid using Facelet tag file with @Balusc's previous answer at How to make a grid of JSF composite component? as a reference. I have copied /WEB-INF/tags/input.xhtml and example.taglib.xml and the main application xhtml. However, I am running into some issues. 1. If I don't pass the id and simply do <my:input id="cat" type="text" label="FirstName" bean="#{bean}" property="fName" required="true" /> <my:input id="dog" type

Eclipse Ganymede not validating tag files properly

房东的猫 提交于 2019-12-08 06:30:02
问题 When editing foo.tag with a line like: <h1>Header</h1> it says on the <h1>: "Unknown tag (h1)" it says on the </h1>: "Error" This only happens in tag files, not JSPs. Ayudame? 回答1: What version of WTP are you using? This seems to have been noticed in the webtool mailing list, referring to the bug 204990. This has been fixed in WTP3.1 (jst.jsp3.1.1) a month ago. 来源: https://stackoverflow.com/questions/1208424/eclipse-ganymede-not-validating-tag-files-properly

How do I include a body into a tagfile

一曲冷凌霜 提交于 2019-12-08 04:16:33
问题 I have a tagfile I intend to use as an input template: <ui:composition xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"> <div class="qr"> <label>#{question}</label> <div class="helpButton"></div> <!-- body here --> <!-- errors output eventually to go here --> </div> </ui:composition> It is stored in my /WEB-INF/tags folder with a .taglib.xml and necessary web.xml context-param.

FileNotFoundException when using Facelets tagfile

南楼画角 提交于 2019-12-02 06:53:39
问题 I'm trying to run the example ch05 from the "Core JavaServer Faces" Book (http://horstmann.com/corejsf/) After logging in I get the following message: /sections/planetarium/sidebarLeft.xhtml @12,72 <corejsf:planet> null planet is a composition, residing under WEB-INF/tags/corejsf/planet.xhtml The corejsf.taglib.xml is: <?xml version="1.0"?> <!DOCTYPE facelet-taglib PUBLIC "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN" "http://java.sun.com/dtd/facelet-taglib_1_0.dtd"> <facelet-taglib>

FileNotFoundException when using Facelets tagfile

白昼怎懂夜的黑 提交于 2019-12-02 06:06:17
I'm trying to run the example ch05 from the "Core JavaServer Faces" Book ( http://horstmann.com/corejsf/ ) After logging in I get the following message: /sections/planetarium/sidebarLeft.xhtml @12,72 <corejsf:planet> null planet is a composition, residing under WEB-INF/tags/corejsf/planet.xhtml The corejsf.taglib.xml is: <?xml version="1.0"?> <!DOCTYPE facelet-taglib PUBLIC "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN" "http://java.sun.com/dtd/facelet-taglib_1_0.dtd"> <facelet-taglib> <namespace>http://corejsf.com/facelets</namespace> <tag> <tag-name>planet</tag-name> <source>tags

Passing EL method expression as attribute of custom Facelets tagfile

不想你离开。 提交于 2019-12-01 10:47:06
I created a custom JSF tag: <ui:composition> <h:panelGroup> <rich:dataScroller id="#{id}" for="#{table}" execute="#{table}" page="#{scrollerPage}" render="#{table}-sc1" maxPages="5" fastControls="hide" oncomplete="#{onCompl}" scrollListener="#{scrollListenerBean[scrollListenerMethod]}" /> <h:inputText value="#{scrollerPage}" id="#{table}-sc1" size="2"> <f:convertNumber integerOnly="true" /> </h:inputText> <h:outputText styleClass="outputText" value=" of #{scrollPagesCount} " /> <h:commandButton value="GO! " /> </h:panelGroup> </ui:composition> To pass the listener method, I used the solution