facelets

JSF Language switcher and ajax update

心已入冬 提交于 2019-12-01 20:16:37
This question is a follow - up of the older Language switcher implementation in JSF 2 . The substance of the question is still valid, although PrimeFaces has released some newer builds, and my JSF knowledge is a bit better than before. To summarize, I have a single xhtml page, fully ajaxified. The language switcher is this: <h:form id="selectLanguage" > <p:commandLink action="#{languageSwitcher.setLanguage('it')}" rendered="#{languageSwitcher.language!='it'}" > <h:graphicImage library ="images" name="it.gif" title="it" /> </p:commandLink> <p:commandLink action="#{languageSwitcher.setLanguage(

p:selectOneMenu preselects previous item when noSelectionOption item is present

杀马特。学长 韩版系。学妹 提交于 2019-12-01 18:13:17
问题 There is a problem with p:selectOneMenu selection when adding a f:selectItem . View: <p:selectOneMenu value="#{selectionTest.selectedName}"> <f:selectItem itemLabel="Select" noSelectionOption="true" /> <f:selectItems value="#{selectionTest.allNames}" var="varName" itemLabel="#{varName}" itemValue="#{varName}" /> </p:selectOneMenu> Model: private List<String> allNames; private String selectedName; public MenuSelectionTestBean(){ allNames = new ArrayList<String>(); allNames.add("Ahmed");

Navigation with Facelets template not working

跟風遠走 提交于 2019-12-01 17:41:33
I'm having some trouble with navigation when using Facelets. I have my master template in /WEB-INF : <h:body> <div id="container"> <div id="header"> <ui:insert name="header">Header</ui:insert> </div> <div id="navigation"> <a href="ram.xhtml">RAM</a> <a href="mobo.xhtml">Motherboard</a> <a href="video.xhtml">Video Card</a> </div> <div id="content"> <ui:insert name ="content"></ui:insert> </div> </div> </h:body> and then 2 template clients that look exactly the same, index.xhtml and ram.xhtml : <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0

Navigation with Facelets template not working

痞子三分冷 提交于 2019-12-01 17:27:48
问题 I'm having some trouble with navigation when using Facelets. I have my master template in /WEB-INF : <h:body> <div id="container"> <div id="header"> <ui:insert name="header">Header</ui:insert> </div> <div id="navigation"> <a href="ram.xhtml">RAM</a> <a href="mobo.xhtml">Motherboard</a> <a href="video.xhtml">Video Card</a> </div> <div id="content"> <ui:insert name ="content"></ui:insert> </div> </div> </h:body> and then 2 template clients that look exactly the same, index.xhtml and ram.xhtml :

Acessing the name attribute of a <ui:insert>

二次信任 提交于 2019-12-01 16:47:20
I have a JSF template with the a title and a subtitle : <h3><ui:insert name="title"/></h3> <hr/> <h5><ui:insert name="subtitle"/></h5> All the pages using this template have title, but not always a subtitle : <ui:define name="title">My Title with no subtitle</ui:define> When there is no subtitle I don't want to have a <hr/> tag. So what I really want to do is check if subtitle is empty, if yes, ignore the block of code. Something like that : <h3><ui:insert name="title"/></h3> <c:if test="#{not empty subtitle}"> <hr/> <h5><ui:insert name="subtitle"/></h5> <c:if> But of course <c:if test="#{not

Acessing the name attribute of a <ui:insert>

一曲冷凌霜 提交于 2019-12-01 16:02:13
问题 I have a JSF template with the a title and a subtitle : <h3><ui:insert name="title"/></h3> <hr/> <h5><ui:insert name="subtitle"/></h5> All the pages using this template have title, but not always a subtitle : <ui:define name="title">My Title with no subtitle</ui:define> When there is no subtitle I don't want to have a <hr/> tag. So what I really want to do is check if subtitle is empty, if yes, ignore the block of code. Something like that : <h3><ui:insert name="title"/></h3> <c:if test="#

JSF selectCheckBoxMenu not working properly in IE

喜你入骨 提交于 2019-12-01 14:31:26
I am facing an issue with my jsf application while running it on IE. The selectcheckboxmenu on jsf behaves faulty and has the checkboxes of the menu items shifted below the items, The checkboxes are still there. Below is the screenshot of what i am facing : [IMG] http://i43.tinypic.com/8yb976.jpg[/IMG] the code for the selectcheckboxmenu is given below : <p:selectCheckboxMenu value="#{formBean.selectedMovies}" label="Movies" filter="true" filterText="Filter" filterMatchMode="startsWith" panelStyle="width:220px"> <f:selectItems value="#{formBean.movies}" /> </p:selectCheckboxMenu> Please kindly

JSF: Serving Resources From a Jar

ぐ巨炮叔叔 提交于 2019-12-01 14:18:34
I´m in the process to create a couple of jars packed with facelets templates for usage through the organisation. Stuck in JSF 1.2 this functionality does not come out of the box. Stack: Jboss EAP 5.1 Seam 2.2 Richfaces 3.3.3 It seems to me that I primarily need two resources: Resource resolver that finds Faclets resources A thing that serve css and js resources from a jar Resource resolver seems to be the easy part: http://ocpsoft.org/opensource/create-common-facelets-jar/ The thing that streams css / js is slightly more complicated: JSF: Serving Resources From a Jar http://cagataycivici

JSF - <h:outputText> (escape special chars)

限于喜欢 提交于 2019-12-01 14:12:40
I am trying set 1 ® 2 in outputText: <h:outputText value="1&lt;sup&gt;&#174;&lt;sup/&gt;2" escape="false"/> What is incorrect? I get 2 in uppercase. You can choose one of the following In your original proposal you had a misplace the / it should be before the sup <h:outputText value="1&lt;sup&gt;&#174;&lt;/sup&gt;2" escape="false"/> You can also remove the sup completely (but than your (R) wont be small) <h:outputText value="1&#174;2" escape="false"/> Finally you can use it directly without escaping <h:outputText value="1®2"/> 来源: https://stackoverflow.com/questions/14374758/jsf-houtputtext-escape-special-chars

How to use jQuery with in xhtml?

三世轮回 提交于 2019-12-01 14:04:16
i am using facelets,richfaces,and ajax, in XHTML i am facing error while creating datepicker! What is the solution for my problem? the code is: <?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="https://ajax4jsf.dev.java.net/ajax" xmlns:rich="http://richfaces.ajax4jsf.org/rich"> <head> <a4j:loadScript src=