jsf-2.2

Conditional rendering of f:param in JSF

送分小仙女□ 提交于 2019-11-29 18:37:12
问题 I'm using an <h:outputLink> as follows. <c:set var="cid" value="1"/> <c:set var="sid" value="2"/> <h:outputLink value="Test.jsf"> <h:outputText value="Link"/> <f:param name="cid" value="#{cid}"/> <f:param name="sid" value="#{sid}"/> </h:outputLink> This is just an example. Both of the query-string parameters are dynamic. So, <c:set> used here is just for the sake of demonstration. At any time, either one, both or none of the parameters may be present. In case, if only one or none of them is

Does Facelets rebuild the whole page if Ajax is trigger from a form and updates another?

馋奶兔 提交于 2019-11-29 18:05:22
Setup: I have 2 forms A & B I have a commandLink in form A: <h:commandLink actionListener="#{homeView.selectDiv('homeUpdates')}">#{msg.homeUpdates} <f:ajax render=":B" execute="@this" /> </h:commandLink> ...which updates form B. The problem is that when I click the ajax link, it rebuilds form A as well and gets an exception from a ui:repeat I have. Is this correct behaviour? Should it rebuild form A as well? I am using JSF 2.2 and form A contains a ui:fragment=>ui:include=>ui:repeat =====Added SSCCE======= The following code does not run after pressing Update B! twice. It gives an exception of

web.xml setup for facelets template and client

喜夏-厌秋 提交于 2019-11-29 17:36:17
I've looked at a few resources for JSF and facelets, but don't understand a few configuration points. What's the distinction between: <url-pattern>/faces/*</url-pattern> and: <url-pattern>*.jsf</url-pattern> While I understand it's possible to have several url-pattern elements, unless .jsf pages are explicitly being used, there's no actual need for this mapping, correct? If only faces templates and clients are being used, then it's extraneous? Furthermore, if the facelet template and client are inside WEB-INF , how are they accessed? With the latest releases for JSF and Facelets, there seems

JSF Ajax render lose CSS with Jquery Mobile

 ̄綄美尐妖づ 提交于 2019-11-29 15:32:08
I'm using ajax to programming with Jquery Mobile, and it was good, ultil I try use ajax to render something :( I'm trying to do a h:selectOneMenu refresh the items when I select another h:selectOneMenu, and I put it inside a h:panelGroup to work. However, when the ajax is executed, and the panelGroup is updated, the selectOneMenu lose the JM css and become ugly. I'm using jsf 2.2 and Jquery Mobile 1.4 Beta Before: After: This is my page. I guess the bean doesn't metter, because the ajax is working and the selectonemenu is correct render the items. The problem is just the css: <?xml version='1

Custom FaceletFactory in JSF 2.2 / Alternatives for virtual host facelets

扶醉桌前 提交于 2019-11-29 15:20:41
Since Mojarra/JSF 2.2. it is not possible anymore to provide a custom FaceletFactory using a web.xml context parameter: <context-param> <param-name>com.sun.faces.faceletFactory</param-name> <param-value>my.faces.overrides.MyFaceletFactory</param-value> </context-param> My application provides some CMS features, including virtual host support to serve different pages (facelets) based on the currently requested domain. So http://www.domain1.com/index.xhtml returns different content than http://www.otherdomain.com/index.xhtml . The mechanics behind that are not that big of a deal using a custom

java.lang.IllegalStateException: java.lang.InstantiationException while implementing a custom tag handler in JSF

两盒软妹~` 提交于 2019-11-29 10:21:46
Given the following tag handler class. public final class ViewParamValidationFailed extends TagHandler implements ComponentSystemEventListener { private final String redirect; public ViewParamValidationFailed(TagConfig config) { super(config); redirect = getRequiredAttribute("redirect").getValue(); } @Override public void apply(FaceletContext context, UIComponent parent) throws IOException { if (parent instanceof UIViewRoot && !context.getFacesContext().isPostback()) { ((UIViewRoot) parent).subscribeToEvent(PostValidateEvent.class, this); } } @Override public void processEvent

Write file into disk using JSF 2.2 inputFile

不想你离开。 提交于 2019-11-29 08:54:17
I'm trying to upload an image file using h:inputFile tag and write it to disk. My JSF code: <h:form id="fileUploadForm" enctype='multipart/form-data' prependId="false"> <h:inputFile value="#{solicitacaoManagedBean.imagemCarregada}" /> <br /> <h:commandButton styleClass="btn btn-primary " value="Enviar" action="#{solicitacaoManagedBean.enviarImagem}" /> </h:form> My ManagedBean: @Named(value = "solicitacaoManagedBean") @SessionScoped @MultipartConfig(location = "/home/rogerio/tmp/") public class SolicitacaoManagedBean implements Serializable { private Part imagemCarregada; (...) public void

Display footer in PrimeFaces template, when fullPage of p:layout is set to false

大憨熊 提交于 2019-11-29 08:21:48
Footer is not displayed (actually, it is incorrectly displayed on top of the page), when fullPage is set to false in PrimeFaces template . <p:layout fullPage="false"> <p:layoutUnit position="north" size="135"> <!--Put north content here, if any--> </p:layoutUnit> <p:layoutUnit position="west" size="225" header="Menu Item" collapsible="true"> <!--Put west content here, if any--> </p:layoutUnit> <p:layoutUnit position="center" size="2500" maxSize="2500"> <!--Put center content here, if any--> </p:layoutUnit> <p:layoutUnit position="east" size="175"> <!--Put east content here, if any--> </p

Illegal Syntax for Set Operation: How to tell JSF I don't “want” a setter

时光总嘲笑我的痴心妄想 提交于 2019-11-29 06:46:16
This question may be more of the type "conceptual" or "I don't understand JSF". My scenario: I have a JSF Page ( index.xhtml ) where I use a p:accordionPanel (but I don't think it matters what component it is). What I want to do is to set the activeIndexes of it. <p:accordionPanel multiple="true" activeIndex="#{myController.getActiveIndexesForSections('whatever')}"> // bla bla... </p:accordionPanel> And the (simplified) method in the backing bean: public String getActiveIndexesForSections(String holderName){ String activeSections = ""; for(Section s : sectionMap.get(holderName)){ if (s

How can I upload multiple files with JSF 2.2

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-29 03:48:24
I am trying to add a multiple file upload using h:inputFile . I had a quick look through the source code and it appears that it does not have the option to render multiple="multiple" . Is there a way around this without writing a custom component? If not, is there a suggested custom JSF2.2 component available that can handle multiple Ajax file uploads? Update: I have passed the multiple="multiple" using passthrough tag, but when I debugged the FileRenderer the relevant piece of code overwrites the first file with the second: for (Part cur : parts) { if (clientId.equals(cur.getName())) {