jsf-2

how to add a component to the page from a managed bean in jsf / primefaces [duplicate]

空扰寡人 提交于 2019-12-13 04:37:18
问题 This question already has answers here : How to dynamically add JSF components (3 answers) Closed 3 years ago . A click on a commandButton should trigger an action in a ManagedBean: to add a new "outputText" component to the current page. The overall idea is to have the page changed dynamically with user action, with server side action because new elements added to the page need data from a db to be laid out. -> How do I add a component to the page from a managed bean in jsf / primefaces? Let

Passed argument to method inside composite component does not work on MyFaces

霸气de小男生 提交于 2019-12-13 04:36:40
问题 I have successfully able to pass in argument to method inside composite component using this technique from BalusC (Pass Argument to a composite-component action attribute), however this seems to work on Mojarra, but not on MyFaces 2.0.4-2.0.5 (packaged inside Websphere 8.5 + OpenWebBeans) . I post my code below This is my cc <cc:interface> <cc:attribute name="value" /> <cc:attribute name="bean" /> <cc:attribute name="myAction" /> <cc:attribute name="property" /> </cc:interface> <cc

Controlling primefaces dialog from javascript

佐手、 提交于 2019-12-13 04:32:21
问题 I try to control primefaces display show and hide from java script on bean validation failure, but its not working. As suggested in forums have tried with widgetVar name of the component in javascript and even tried with id of the component but failed. XHTML <p:dialog header="Modal Dialog" id="mglasspaneid" showHeader="false" closable="true" resizable="false" draggable="false" widgetVar="mglasspane" style="height: 50px !important;" modal="true"> <span id="loading" draggable="false" style=

jsf 2.1 cant import <h:inputfile

独自空忆成欢 提交于 2019-12-13 04:25:56
问题 I am trying to add to my site the tag I have completed my site under java EE 7 jsf 2.2 and primefaces 4.0 and was working under glassfish 4 but my production envireoment will have jboss and i noticed that there is not available the java EE 7 on this application Server, so i downgrade my site to java EE and this lead me use jsf 2.1 The problem i am facing now is that i have problems with the rendering items. specially with forms that have input file tags as i get the error <h:inputFile> Tag

How to call bean method on every page request

北城以北 提交于 2019-12-13 04:23:19
问题 In my work we develop an JSF 2 application. And I need to create a listener bean with one method which have to be executed on every page request. How to accomplish this task? 回答1: The answer of your question can be found here. This method is crucial: public void beforePhase(PhaseEvent event) { if (event.getPhaseId() == PhaseId.RENDER_RESPONSE) { // Do here your job which should run right before the RENDER_RESPONSE. } } Here you can react on every lifecycle phase and call your apropriate

Tomahawk inputFileUpload in subform: required fields are validated

假如想象 提交于 2019-12-13 04:23:02
问题 I have integrated the inputFileUpload of Tomahawk in my webapplication. I have tried to use it with subform from tomahawk but with no luck. My form looks like this: <h:form enctype="multipart/form-data"> <!-- some <h:inputText required="true" /> tags --> <t:subform id="testSubForm"> <t:inputFileUpload value="#{fileBean.uploadedFile}" /> <t:commandButton action="#{fileBean.submit()}" value="Submit subForm"/> </t:subform> </h:form The problem is that the submit of the subform tries to validate

integration of jsf2.0 and spring 3.1 and hibernate 4.1

故事扮演 提交于 2019-12-13 04:19:59
问题 i want to integrate jsf2.0 and spring 3.1 and hibernate 4.1. but tomcat has error 404:description The requested resource (/jsfspringhiber/page/default.jsf) is not available. what is wrong? following is my web.xml: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml

p:tabMenu without form

孤者浪人 提交于 2019-12-13 04:13:07
问题 I have this p:tabMenu : <p:tabMenu id="tabs" activeIndex="0" > <p:menuitem value="General" url="/DCProfileTabGeneral.jsf"/> <p:menuitem value="Zones" url="/DCProfileTabZones.jsf"/> <p:menuitem value="UPS" url="/DCProfileTabUPS.jsf"/> <p:menuitem value="Storages" url="/DCProfileTabStorages.xhtml"/> <p:menuitem value="Servers" url="/DCProfileTabServers.xhtml"/> <p:menuitem value="Racks" url="/DCProfileTabRacks.xhtml"/> <p:menuitem value="Networks" url="/DCProfileTabNetworks.xhtml"/> <p:menuitem

Spring Security 4.X taglib tags are not functioning in jsf 2.X project using XML configuration

扶醉桌前 提交于 2019-12-13 04:10:18
问题 I have configured Spring security 4.2.3 in jsf 2.0.1 successfully in a Mavennised project. I also, added Spring security taglib as a dependency but <sec:authorize access="hasRole('ROLE_ADMIN')"> is not functioning as expected. security.xml: <beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans" xsi:schemaLocation="http://www.springframework.org/schema/security http:/

Jsf2 ajax render id not found

你离开我真会死。 提交于 2019-12-13 03:59:29
问题 Why i get " contains an unknown id ':commentTextArea' - cannot locate it in the context of the component commentLink" error? majorra 2.1.7 How i can render commentTextArea. <ui:repeat var="parentComment" value="#{commentTree.parentCommentsWrapper}"> .... <h:form> <h:commandLink id="commentLink" value="comment" style="height:20px;width:20px;padding: 0; margin: 0;" action="#{parentComment.changeEditable}"> **<f:ajax render=":commentTextArea"></f:ajax>** </h:commandLink> </h:form> <h:panelGroup