methodexpression

How to evaluate MethodExpressions in JSF composite components

点点圈 提交于 2019-12-22 08:55:04
问题 I am not sure about the "correct" way to deal with method expressions in composite components. My composite uses a backing class with action methods. Theses perform some default actions or delegate to an action method passed by the composite user as an attribute: In using page: <my:component action="#{myBean.actionMethod}" /> Composite: <cc:interface componentType="mycomponentType"> <cc:attribute name="action" method-signature="java.lang.String action()" required="false" /> </cc:interface>

Evaluating if MethodExpression attribute is set (getting PropertyNotFoundException)

假装没事ソ 提交于 2019-12-19 07:23:20
问题 I have a UI component with a MethodExpression attribute changeListener : <composite:interface> <composite:attribute name="changeListener" required="false" method-signature="void actionListener(javax.faces.event.ActionEvent)" /> .. </composite:interface> <composite:implementation> <p:remoteCommand name="ajaxOnChange" update="#{cc.attrs.onChangeUpdate}" oncomplete="#{cc.attrs.onchange}" actionListener="#{cc.attrs.changeListener}" /> .. </composite:implementation> This changeListener attribute

p:commandButton action throws javax.el.PropertyNotFoundException

你离开我真会死。 提交于 2019-12-17 17:13:54
问题 The error is in: javax.el.PropertyNotFoundException: /index.xhtml: Property 'validar' not found on type fya.beanpages.IndexBean Its looks like it doesnt find the validar method. And it thinks it is an attribute. This is the xhtml: <!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:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java

p:commandButton action throws javax.el.PropertyNotFoundException

☆樱花仙子☆ 提交于 2019-12-13 07:39:23
问题 The error is in: javax.el.PropertyNotFoundException: /index.xhtml: Property 'validar' not found on type fya.beanpages.IndexBean Its looks like it doesnt find the validar method. And it thinks it is an attribute. This is the xhtml: <!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:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java

h:link/h:button outcome methods automatically called during page load without any clicks

隐身守侯 提交于 2019-12-12 07:27:52
问题 I have 3 pages with 3 links that I tried implementing with h:link or simply an <a> tag. But in both cases the methods connected to these links are getting called whenever I navigate to the page. Here's the <a> tag implementation: <a href="#{bean.gotoMySrchie()}"> <h:graphicImage library="images" name='vo2/FavPlus.png' /> </a> <a href="#{bean.gotoMySearches()}"> <h:graphicImage library="images" name='vo2/SearchesPlus.png' /> </a> <a href="#{bean.gotoMyBids()}"> <h:graphicImage library="images"

h:link/h:button outcome methods automatically called during page load without any clicks

删除回忆录丶 提交于 2019-12-02 02:02:56
I have 3 pages with 3 links that I tried implementing with h:link or simply an <a> tag. But in both cases the methods connected to these links are getting called whenever I navigate to the page. Here's the <a> tag implementation: <a href="#{bean.gotoMySrchie()}"> <h:graphicImage library="images" name='vo2/FavPlus.png' /> </a> <a href="#{bean.gotoMySearches()}"> <h:graphicImage library="images" name='vo2/SearchesPlus.png' /> </a> <a href="#{bean.gotoMyBids()}"> <h:graphicImage library="images" name='vo2/BidsPlus.png' /> </a> The h:link implementation looks like this: <h:link title="Searches" id

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

Why am I able to bind <f:actionListener> to an arbitrary method if it's not supported by JSF?

风格不统一 提交于 2019-12-01 06:35:10
I'm using Glassfish 3.1.2.2 and JSF Mojarra 2.1.6. I have the following Facelets page: <h:form> <h:commandLink value="link"> <f:actionListener binding="#{backingBean.someMethod(1)}"/> </h:commandLink> </h:form> And the following backing-bean: @RequestScoped @ManagedBean public class BackingBean { public void someMethod(int i) { System.out.println("It was called: " + i); } } When I click the link, "Info: It was called: 1" appears in the console. The documentation for binding reads: Library: http://xmlns.jcp.org/jsf/core , http://java.sun.com/jsf/core (Jsf Core) Tag: actionListener binding Value

EL conditional Method Expression

梦想与她 提交于 2019-12-01 05:47:47
问题 I would like to declare a conditional method expression in EL like below: <p:dataTable id="#{cc.attrs.datatableId}" var="overview" rowSelectListener="#{cc.attrs.detailsMode == 'single' ? cc.attrs.bean.onRowSelect : cc.attrs.bean.onRowUrlSelect}"> However, it throws an EL exception: javax.el.ELException: Not a Valid Method Expression: #{ cc.attrs.detailsMode == 'single' ? cc.attrs.bean.onRowSelect : cc.attrs.bean.onRowUrlSelect} How I can declare a conditional EL method expression? 回答1:

Why am I able to bind <f:actionListener> to an arbitrary method if it's not supported by JSF?

你离开我真会死。 提交于 2019-12-01 04:45:54
问题 I'm using Glassfish 3.1.2.2 and JSF Mojarra 2.1.6. I have the following Facelets page: <h:form> <h:commandLink value="link"> <f:actionListener binding="#{backingBean.someMethod(1)}"/> </h:commandLink> </h:form> And the following backing-bean: @RequestScoped @ManagedBean public class BackingBean { public void someMethod(int i) { System.out.println("It was called: " + i); } } When I click the link, "Info: It was called: 1" appears in the console. The documentation for binding reads: Library: