jsf-2

JSF2 composite component throws PropertyNotFoundException for action method

▼魔方 西西 提交于 2019-12-18 08:53:54
问题 I have a composite component: <composite:interface> <composite:attribute name="actionMethod" method-signature="java.lang.String action()" required="true" /> </composite:interface> <composite:implementation> <h:form> <h:commandButton id="captureButton" value="#{msgs.capture}" action="#{cc.attrs.actionMethod}" /> </h:form> </composite:implementation> and a page which is calling that composite component: <ezcomp:captureTitle actionMethod="#{saveDecisionsBean.captureTitle}" /> and a bean which

How do I get selectManyCheckBox to return something other than List<String>?

流过昼夜 提交于 2019-12-18 08:49:32
问题 This is a pattern that I would use over and over again if I get it to work. I have an enum name Log.LogKey that I want to user to pick out instances of. So the facelet has this: <h:form id="testForm" > <h:selectManyCheckbox value="#{test.selectedKeys}" > <f:selectItems value="#{test.allKeys}" var="lk" itemLabel="#{lk.display}" itemValue="#{lk}" /> </h:selectManyCheckbox> <h:commandButton value="Do It" action="#{test.doNothng}" /> </h:form> The enum has a getter called getDisplay() . The

ExternalContext.dispatch() not working

≯℡__Kan透↙ 提交于 2019-12-18 08:49:23
问题 On p:ajax call,listener invokes method which contains FacesContext.getCurrentInstance().getExternalContext().dispatch("/uri.jsf"); doesn't work. Ive set a break point on the line and it remains at the same point on execution.It doesn't move forward, I ve got to restart server to run the application again. FacesContext.getCurrentInstance().getExternalContext().redirect("/uri.jsf"); redirection works perfectly fine. But i want page forward which is dispatch to navigate to another page. 回答1: The

ExternalContext.dispatch() not working

十年热恋 提交于 2019-12-18 08:49:09
问题 On p:ajax call,listener invokes method which contains FacesContext.getCurrentInstance().getExternalContext().dispatch("/uri.jsf"); doesn't work. Ive set a break point on the line and it remains at the same point on execution.It doesn't move forward, I ve got to restart server to run the application again. FacesContext.getCurrentInstance().getExternalContext().redirect("/uri.jsf"); redirection works perfectly fine. But i want page forward which is dispatch to navigate to another page. 回答1: The

How to pass backing bean value to JavaScript?

做~自己de王妃 提交于 2019-12-18 07:14:41
问题 I would like to read the backing bean value in JSF and then pass over to JavaScript, may I know how this can be done? Backing bean sample code: @ManagedBean(name="enquiry") @SessionScoped public class Enquiry { public boolean noQuery; /** getter and setter **/ } In XHTML sample code, I would like pass the backing bean value and then pass into showNoQueryPrompt() like this: <h:commandLink onClick="showNoQueryPrompt(#{enquiry.noQuery})"> </h:commandLink> And then in JavaScript code, I can read

How to check (replace) the MyFaces version used by Websphere 8.5

烂漫一生 提交于 2019-12-18 07:13:05
问题 After upgrading to WebSphere 8.5 I've experienced some incompatibilites in my JSF application. It is possible that they were caused by uncanonical use of JSF components, but I wanted to simply check what version is used According to that document: http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/index.jsp?topic=%2Fcom.ibm.websphere.nd.doc%2Fae%2Frovr_specs.html WebSphere 8.5 uses Apache MyFaces 2.0.x (without specifying the version). I was searching for myfaces*.jar withing WebSphere

JSF composite component - weird behavior when trying to save state

◇◆丶佛笑我妖孽 提交于 2019-12-18 07:05:25
问题 I'm using Glassfish 3.2.2 and JSF 2.1.11 I'm trying to create a composite component that will take as parameters a string and a max number of characters and then will show only the max amount of characters, but it will have a "more" link next to it, that when clicked will expand the text to the full length and will then have a "less" link next to it to take it back to the max number of characters. I'm seeing some weird behavior, so I'm wondering if I'm doing something wrong. Here is my

Why doesn't h:dataTable inside ui:repeat get correct ID?

∥☆過路亽.° 提交于 2019-12-18 07:03:05
问题 Code: <ui:repeat var="obj" value="#{demo2Bean.someList}"> <h:panelGroup id="foo" /> <h:dataTable id="bar" /> </ui:repeat> Result: <span id="j_idt55:0:foo"></span> <table id="j_idt55:0:bar"><tbody><tr><td></td></tr></tbody></table> <span id="j_idt55:1:foo"></span> <table id="j_idt55:0:bar"><tbody><tr><td></td></tr></tbody></table> As you can see, the id for datatables is the same 'j_idt55:0:bar' but for panelGroups it grows (as should): 'j_idt55:0:foo', 'j_idt55:1:foo'. Why is it so? 回答1:

JS function not triggered with PrimeFaces.monitorDownload

百般思念 提交于 2019-12-18 06:48:45
问题 I'm working in file downloading with Primefaces 4.0 . I just want to trigger a JS function when download completes, but seems not to work (tried in Firefox and Google Chrome). My test case looks similar to what's done in the PF docs: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui"> <h:head /> <h:body> <script type="text

Color the rows of datatable based a condition in JSF 2

谁都会走 提交于 2019-12-18 06:11:31
问题 I'd like to change the background color of rows based on a condition. <t:dataTable id="data" styleClass="history-table" headerClass="history-table-header" rowClasses="history-table-row-default" border="2" cellpadding="5" cellspacing="2" var="entry" value="#{historyBean.logEntryList}" preserveDataModel="false" rows="#{historyBean.history.rowCount}" sortable="true"> <h:column> <f:facet name="header"> <h:outputText value="Debug Status" /> </f:facet> <h:outputText value="#{entry.action}" /> </h