[JAVASERVERFACES_SPEC_PUBLIC-1238] Enhance component referencing / findComponent Created: 15/Nov/13  Updated: 18/Jan/17

Status: Open
Project: javaserverfaces-spec-public
Component/s: Ajax/JavaScript, Components/Renderers
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major
Reporter: tandraschko Assignee: Ed Burns
Resolution: Unresolved Votes: 6
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File 20170113-1208-2_3_x-wls-12_2_1-development-fss-client.txt     File 20170116-0432Z-JAVASERVERFACES_SPEC_PUBLIC-1238.diff     Java Source File AjaxBehaviorRenderer.java     Text File changebundle.txt     Text File changebundle.txt     File jsf-systest.war     File spec-1238-20170114.diff     File spec-1238.diff    


Currently component referencing with the JSF API is very limited.
Keywords can currently only be used with f:ajax and not for e.g. outputLabel "for" attribute.
Also keywords cant be combined and we dont even have many keywords.

For PrimeFaces, i created a small modular API to enhance the search alogorithm as you can read here:

Noteable features are:

  • keywords can be used for all components
  • combinable keywords like @composite:@parent or @form:myId
  • currently a (limited) pluggable framework to allow new keywords for endusers

For the JSF API, a new artifact for resolving expression for findComponent (like ViewHandler etc.) would be great and can easily be enhanced by component libraries.
Maybe something like "ComponentExpressionResolver".

If its somehow possible, i would like to help to create and finalyze the API.

Sorry for Issue 1237 - please close it.

Comment by Ed Burns [ 01/Aug/14 ]

Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.

Comment by Ed Burns [ 13/Aug/14 ]

This area is very sensitive to performance problems.

Comment by tandraschko [ 26/Sep/15 ]

The performance won't be affected for existing applications as the new search expression logic is only used if the whole expression string contains a "@".
Some expressions are faster, some are slower but the overall performance is very good and i did a lot of optimization for it.

Would great to see it in the next API release. BootsFaces implemented a similiar API.
As i said, i would take care of it and would contribute my ideas to the JSF API.

Comment by stephanrauh [ 26/Sep/15 ]

I agree with Thomas. I consider the advanced search expressions very useful. So useful, that I implemented them in BootsFaces 0.8.0 myself. As for the performance considerations: granted, we should keep the performance in mind. However, I'm using the PrimeFaces search expressions for years now without noting a performance penalty. In particular, the expressions I use most frequently - @parent, @next and @previous - are implemented in a very efficient way.

Comment by balusc [ 20/Jun/16 ]

This is one of the things I'd like to see in JSF 2.3 as well. Community contribution is very welcome.

Comment by Ed Burns [ 10/Jan/17 ]

Diff of pull request 4.

Comment by Ed Burns [ 13/Jan/17 ]

Committed as b243817. Will roll back immediately if the build breaks.

Comment by Ed Burns [ 13/Jan/17 ]

This change appears to have broken the WLS 12.2.1 builds so I must revert it. I will move it to a topic branch.

Revert commit is 6e74667c.

Comment by Ed Burns [ 13/Jan/17 ]

Commit 3dade0c50300d62da59a7d30b693743903da7aed on topic branch has the work.

Comment by arjan tijms [ 13/Jan/17 ]

Was it the Spec1238IT test that failed? If so adding the following to the test might rectify it:

@JsfTest(value = JSF_2_3_0_M10, excludes = {WEBLOGIC_12_1_4, WEBLOGIC_12_2_1})
Comment by Ed Burns [ 13/Jan/17 ]

Thanks Arjan, yes it was that test that failed. But I don't want to exclude it on WLS. It should run on WLS if it is a truly backward compatible change, which it must be since it is not hidden behind a context param.

Comment by Ed Burns [ 16/Jan/17 ]

Ok, commit 3ab4cf8 has the fix that passes all tests. If it breaks the build this time, it is possible we may not have this feature in JSF 2.3.

Comment by Ed Burns [ 17/Jan/17 ]

Built with


Comment by Ed Burns [ 17/Jan/17 ]

Commit dcca156 has the @Ignore of the failing tests.

Comment by Ed Burns [ 18/Jan/17 ]

Commit c1eff0f removes the @Ignore and reverts the change that was causing them to fail.

Generated at Sun Apr 23 10:23:33 UTC 2017 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.