Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[Enhancement] default value for viewParam #118
This is related to the open ticket at JSF spec issue tracker.
What about allowing the definition of a default value for a view-parameter?
Defining number of displayed items (pagination feature) as a view-parameter but still keeping default value within xhtml and not java bean.
Following example is a very clean approach provinding a default value.
This could also be extended to el expression providing java objects as default values.
Currently there are two workarounds which have no clean separation between markup and java code:
Passing the default value to bean.
Hardcoding the default value in bean. But markup should be responsible and not bean.
If conversion is invoked it may also be possible to use a converter that returns the default value if null or empty string is passed. But this needs new java converter classes for such simple things.
This can be more enhanced solving the problem of irrelevant parameters appended to link components, creating more friendly URL's and making it easier to develop.
How often one wrote something like
This behavior maybe is a good idea to be optional or optionally be deactivated using a param like