SteGr created MYFACES-4667:
------------------------------
Summary: UIData#invokeOnComponent does not find components
Key: MYFACES-4667
URL: https://issues.apache.org/jira/browse/MYFACES-4667
Project: MyFaces Core
Issue Type: Bug
Affects Versions: 2.3.10
Reporter: SteGr
While working an a bug in [mojarra implementation|#issuecomment-2115154280]] I
found an [old primefaces
issue|https://github.com/primefaces/primefaces/issues/9245#issuecomment-2122507698]
which was somehow related to my issue. Using the reproducer of that PF issue,
I was able to really find the root cause of the issue and that even myfaces is
affected - contrary to what was assumed at the time.
*What happens?*
A {{p:datatable}} with {{p:column*s*}} was updated by the backend using
{{{}PrimeFaces#Ajax#update{}}}. The implementation used
{{UIComponent#invokeOnComponent}} to find the component of the given clientId.
As {{p:dataTable}} relies on {{UIData}} of myfaces, {{p:columns}} won't be
handled. Nothing could be found and {{PrimeFaces#Ajax#update}} falls back to
just forwarding the given clientId.
*Why does it happen?*
Like mojarra, myfaces filters the children on processing using {{{}instanceof
UIColumn{}}}. But {{p:columns}} does not extend that class. Therefore
{{p:columns}} is not a candiate and is simply ignored.
*Possible fix* (not yet tested)
Remove the check.
*How to reproduce*
Use the [reproducer
|https://github.com/primefaces/primefaces/files/9664695/primefaces-test.zip]
and change the PROJECT_STAGE to Development. Run the project using the
myfaces23 profile. You should get a lot of logging entries like
{quote}Mai 21, 2024 2:53:41 PM org.primefaces.PrimeFaces$Ajax update
WARNUNG: PrimeFaces.current().ajax().update() called but component cant be
resolved! Expression will just be added to the renderIds: \{0}
{quote}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)