Problem with inputNumber and EL #{p:component('element_id')}

Community Driven Extensions Project
Post Reply
fischer1983
Posts: 20
Joined: 19 Nov 2015, 17:33
Location: Porto Alegre, Brasil

19 Apr 2016, 13:35

Hi ,

We are using the inputNumber component PF extensions. It serves us perfectly. But we are going through the following situation:
We created a composite component, and within it we have a inputNumber. To reference it by id in XHTML are using the EL # {p:component ( '<element_id>')}.

Code: Select all


 <teiLabel:Label for="#{p:component(cc.attrs.idInputNumberLabelled)}"/>

 ...more code

 <p:inputNumber id="#{cc.attrs.idInputNumberLabelled}" value="0.0"/>

To do this way, the following exception is raised below:

Code: Select all

08: 19: 03.631 ERROR [io.undertow.request] (default task 126) UT005023: Exception handling request to /tei-ambiente/pages/usuario/usuario.xhtml: javax.servlet.ServletException: / WEB-INF / classes /META-INF/resources/componentes/form/label/labelComum.xhtml @ 32.49 test = "# {empty cc.attrs.for!}" javax.el.ELException: / WEB-INF / classes / META-INF /resources/componentes/form/input/number/inputNumberLabelled.xhtml @ 207.69 labelFor = "# {p: component (cc.attrs.idInputNumberLabelled)}": Problems calling function 'p: component'
We found that inputNumber renders a span with two inputs within (one hidden), their ids are assigned '_input' and '_hinput'. We do not know if this is related to the exception.

If a friend to help we would be grateful.

Thanks for listening
Last edited by fischer1983 on 19 Apr 2016, 15:12, edited 1 time in total.
fischer1983 - Luciano Fischer Lumertz

Primefaces 5.3
WildFly 8.1.0 Final

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

19 Apr 2016, 13:43

not sure what teiLabel:labelFor is, but if you use p:outputLabel, the following should work:

<p:outputLabel for="#{cc.attrs.idInputNumberLabelled}"/>


i would not use p:component for compoent references, as it starts the search from the root and not the "current component" where it's used.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

fischer1983
Posts: 20
Joined: 19 Nov 2015, 17:33
Location: Porto Alegre, Brasil

19 Apr 2016, 19:48

Hello Thomas , grateful for the attention.

When I pasted the code here just not checking what was wrong the code <teiLabel:Label for="# {p:component(cc.attrs.idInputNumberLabelled)}"/> . Already corrected in the post above . If this tag is a composite component that has within it an <h:outputText> .

I conducted the following test . Inserted a p:outputLabel and p:inputText , as follows:

Code: Select all

  <p:outputLabel for="text_input" value="text_input"/>                   
  <p:inputText id="text_input"/>
This works perfectly. With the attribute "for" filled with the id of the related input by clicking on the label the input receives focus.

Below I do another test with the inputNumber element PF Extensions , as follows:

Code: Select all

  <p:outputLabel for="number_input" value="number_input"/>
  <pe:inputNumber id="number_input"/>

But when I render the inputNumber , occurs the following exception:

Code: Select all

10:02:44,659 ERROR [io.undertow.request] (default task-1) UT005023: Exception handling request to /tei-ambiente/login.xhtml: javax.servlet.ServletException: org.primefaces.extensions.component.inputnumber.InputNumber.setLabelledBy(Ljava/lang/String;)V
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:659) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
	at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
	at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
	at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
	at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
	at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
	at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
	at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
	at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:177) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:727) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_11]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_11]
	at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_11]
Caused by: java.lang.AbstractMethodError: org.primefaces.extensions.component.inputnumber.InputNumber.setLabelledBy(Ljava/lang/String;)V
	at org.primefaces.component.outputlabel.OutputLabelRenderer.encodeEnd(OutputLabelRenderer.java:64) [primefaces-5.3.jar:5.3]
	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
	at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:312) [jsf-impl-2.2.6-jbossorg-4.jar:]
	at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:115) [jsf-impl-2.2.6-jbossorg-4.jar:]
	at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
	at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304) [jsf-impl-2.2.6-jbossorg-4.jar:]
	at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:115) [jsf-impl-2.2.6-jbossorg-4.jar:]
	at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
	at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304) [jsf-impl-2.2.6-jbossorg-4.jar:]
	at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:115) [jsf-impl-2.2.6-jbossorg-4.jar:]
	at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
	at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304) [jsf-impl-2.2.6-jbossorg-4.jar:]
	at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:115) [jsf-impl-2.2.6-jbossorg-4.jar:]
	at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
	at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304) [jsf-impl-2.2.6-jbossorg-4.jar:]
	at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:115) [jsf-impl-2.2.6-jbossorg-4.jar:]
	at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1857) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1860) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1860) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
	at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:461) [jsf-impl-2.2.6-jbossorg-4.jar:]
	at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133) [jsf-impl-2.2.6-jbossorg-4.jar:]
	at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
	at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
	at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
	at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
	at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120) [jsf-impl-2.2.6-jbossorg-4.jar:]
	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.2.6-jbossorg-4.jar:]
	at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219) [jsf-impl-2.2.6-jbossorg-4.jar:]
	at org.apache.myfaces.extensions.cdi.jsf2.impl.listener.phase.CodiLifecycleWrapper.render(CodiLifecycleWrapper.java:126) [myfaces-extcdi-jsf20-module-impl-1.0.6.jar:1.0.6]
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
	... 26 more
If I use a h:outputText not the exception occurs , but when you click the label the input that is stated in their "for" attribute does not get the focus.

Thanks for attention.
fischer1983 - Luciano Fischer Lumertz

Primefaces 5.3
WildFly 8.1.0 Final

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

19 Apr 2016, 20:56

make you sure you use the newest PFExtensions version. Otherwhise to try to build PF 6.0 from source, inputNumber was moved to PF directly.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

fischer1983
Posts: 20
Joined: 19 Nov 2015, 17:33
Location: Porto Alegre, Brasil

20 Apr 2016, 16:40

I really had not verified that there was a new version been released, was with 3.2.0 . Even in version 4.0.0 has another improvement that I was waiting for this component.

Danke! :)
fischer1983 - Luciano Fischer Lumertz

Primefaces 5.3
WildFly 8.1.0 Final

Hankfreid
Posts: 2
Joined: 19 May 2016, 15:02

19 May 2016, 15:10

It is a fact that Citrix 200-310 testinside Implementing Citrix NetScaler 10.5 for App and Desktop Solutions, exam test is the most important exam.

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 9 guests