datatable , with celledit update - has null value instead of the input

UI Components for JSF
Post Reply
meirdev
Posts: 2
Joined: 16 Jul 2013, 12:50

11 Oct 2017, 15:13

Hi, with mojarra-2.2.13, as it's in the wildfly(10.1.0.Final), the event handler, with the following method [exactly the method as in the primefaces demo] -

Code: Select all

 public void onCellEdit(CellEditEvent event) {
      Object newValue = event.getNewValue();
 }
the newValue does not contains the input of the user, but contains null..

After some days of investigation, i got to what cause the problem:

while the execution of APPLY_REQUEST_VALUE it does the following actions:
1. Get the submitted value and insert correctly to the input component.
2. Override this value later while saving descendant state.

So, what hapened - now the input contains null instead of the input from the user.

And in source source level::

1. The decode of HtmlBasicInputRenderer, fill correctly the submitted value of the UIInput component, with the input.
2. the method saveDescendantState, the state does not exist in the
getStateHelper().get(PropertyKeys.saved)
, it becomes to be null.

so what happened, in the following piece of correct code,

Code: Select all

            state.setValue(input.getLocalValue());
            state.setValid(input.isValid());
            state.setSubmittedValue(input.getSubmittedValue());
            state.setLocalValueSet(input.isLocalValueSet());
it reset the value of the submitted value, so it comes to be null later, when the value is required.

i will clear, that my xhtml seems exactly as in the demo.
The only difference thay i see is the mojarra version.

Please advise, what should be done to solve the issue.

*Sorry if english is not nice, it's not my first language.

My system:

mojarra-2.2.13
primefaces 6.2-SNAPSHOT
wildfly-10.1.0.Final

lprimak
Posts: 1
Joined: 23 Feb 2015, 22:59

26 Sep 2022, 18:49

I have exactly the same problem on latest everything.
PrimeFaces 12.0.0.RC3 and Payara 2022.3 (Mojarra 2.3.14)

Can anyone help? This seems to be a common issue

NOTiFY
Posts: 393
Joined: 25 May 2016, 22:57

27 Sep 2022, 12:39

I also have had issues with 'events' with PF 11.08 (EE & Jakarta) & Mojarra 3.0.0.SP04 on WildFly 26.x.

Always 'resolved to null":

Code: Select all

public void onTabChange(TabChangeEvent event) {
   LOGGER.info(">>>>> TabChangeEvent event = {}", event);
}

Code: Select all

SEVERE [jakarta.enterprise.resource.webcontainer.jsf.context] (default task-1) jakarta.el.PropertyNotFoundException: /index.xhtml @43,133 listener="#{tabsChangesController.onTabChange}": Target Unreachable, identifier 'tabsChangesController' resolved to null
	at com.sun.jsf-impl@3.0.0.SP04//com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:72)
Still errors with:

PF 11.08-Jakarta & Mojarra 4.0.0.SP01 on wildfly-preview-27.0.0.Alpha5:

Code: Select all

SEVERE [jakarta.enterprise.resource.webcontainer.faces.application] (default task-4) Error Rendering View[/index.xhtml]: jakarta.el.ELException: java.lang.NullPointerException
	at jakarta.el.api@4.0.0.CR1//jakarta.el.ELUtil.invokeMethod(ELUtil.java:253)
	at jakarta.el.api@4.0.0.CR1//jakarta.el.BeanELResolver.invoke(BeanELResolver.java:339)
	at jakarta.el.api@4.0.0.CR1//jakarta.el.CompositeELResolver.invoke(CompositeELResolver.java:198)
	at org.glassfish.expressly@5.0.0-M2//org.glassfish.expressly.parser.AstValue.getValue(AstValue.java:298)
	at org.glassfish.expressly@5.0.0-M2//org.glassfish.expressly.parser.AstValue.getValue(AstValue.java:144)
	at org.glassfish.expressly@5.0.0-M2//org.glassfish.expressly.ValueExpressionImpl.getValue(ValueExpressionImpl.java:138)
	at org.jboss.weld.core@5.0.1.Final//org.jboss.weld.module.web.el.WeldValueExpression.getValue(WeldValueExpression.java:50)
	at com.sun.jsf-impl@4.0.0.SP01//com.sun.faces.facelets.el.ELText$ELTextVariable.toString(ELText.java:203)
	at com.sun.jsf-impl@4.0.0.SP01//com.sun.faces.facelets.el.ELText$ELTextComposite.toString(ELText.java:132)
	at com.sun.jsf-impl@4.0.0.SP01//com.sun.faces.facelets.compiler.CommentInstruction.write(CommentInstruction.java:37)
	at com.sun.jsf-impl@4.0.0.SP01//com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:42)
	at com.sun.jsf-impl@4.0.0.SP01//com.sun.faces.facelets.compiler.UILeaf.encodeAll(UILeaf.java:159)
	at jakarta.faces.api//jakarta.faces.component.UIComponent.encodeAll(UIComponent.java:1438)
	at deployment.NOTiFYmoto.ear.NOTiFYmotoWAR.war//org.primefaces.component.tabview.TabViewRenderer.encodeTabContent(TabViewRenderer.java:300)
	at deployment.NOTiFYmoto.ear.NOTiFYmotoWAR.war//org.primefaces.component.tabview.TabViewRenderer.lambda$encodeContents$1(TabViewRenderer.java:271)
	at deployment.NOTiFYmoto.ear.NOTiFYmotoWAR.war//org.primefaces.component.tabview.TabView.forEachTab(TabView.java:180)
	at deployment.NOTiFYmoto.ear.NOTiFYmotoWAR.war//org.primefaces.component.tabview.TabViewRenderer.encodeContents(TabViewRenderer.java:269)
	at deployment.NOTiFYmoto.ear.NOTiFYmotoWAR.war//org.primefaces.component.tabview.TabViewRenderer.encodeMarkup(TabViewRenderer.java:146)
	at deployment.NOTiFYmoto.ear.NOTiFYmotoWAR.war//org.primefaces.component.tabview.TabViewRenderer.encodeEnd(TabViewRenderer.java:84)
PF 13.0.0--Jakarta. Jakarta Faces 4.0.1/Kotlin Multiplatform 1.9.10
Mojarra 4.0.2, OmniFaces 4.2
WildFly 29.0.1.Final 'preview' Jakarta EE 10.0.0
JDK 20.0.2, Kotlin 1.9.10, Gradle 8.3 Groovy DSL, MongoDB 7.0.0
IntelliJ IDEA 2023.2.1, macOS Ventura 13.5.1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 23 guests