Provide a way to find out if content was defined for a <ui:insert>
- Dominant language
- Java
- Stars
- 127
- Forks
- 59
- Avg merge
- 23h
- Merged PRs (30d)
- 7
Description
Currently there is no way to find out (except from ugly and/or implementation-specific hacks) to find out if a user provided content for a or not.
Scenario: Imagine you want to provide an optional search form, which the user can define via . Then you can insert it via . However, what if you have to render some additional markup around the user provided search form, but you don't want to render it if the user did not provide a search form?
One very ugly workaround is to use a h:panelGroup, which you bind to a bean, use as the only child and check via the binding if the h:panelGroup has any children.
It would be very nice to have an EL expression to check this stuff, or maybe to have a special facelets tag which only renders its content if a specific template is available, e.g. (note that I am not very good with names) .... ...
From the MyFaces-impl point of view, I think it is not very hard to implement.
#### Affected Versions
[2.1]
Contributor guide
Research direction
Start by reviewing how the Facelets tags and interact in the described optional search-form scenario. Compare the proposed EL expression with the conditional tag alternative, then define the expected behavior when no content is supplied. Done means one documented, supported way to conditionally render markup around user-defined template content.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100