o:viewParam (Omnifaces 1.10-RC1) triggers valueChangeListener on missing parameters #71

Closed
gusehr opened this Issue Nov 19, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@gusehr

gusehr commented Nov 19, 2014

Hi there!

I have updated from Omnifaces 1.7 to 1.10.RC1.
I noted just an issue with o:viewParam.
The valueChangeListener method of the o:viewParam is called when I'm not sending any value to the parameter.
The listener seems to trigger the change from "null String" to "empty String".

Can you check it?
Thank you. ;)

@BalusC

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC Nov 19, 2014

Member

The <o:viewParam> has in 1.8/2.0 been tuned to behave exactly like <h:inputText> and friends with regard to (bean)validation and triggering prevalidate/postvalidate events.

It should work as intented when you add the following context parameter.

<context-param>
    <param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
    <param-value>true</param-value>
</context-param>

Additional benefit is that you can now use @NotNull on <o:viewParam> (and <h:inputText>, etc). Let me know if this works out for you.

Member

BalusC commented Nov 19, 2014

The <o:viewParam> has in 1.8/2.0 been tuned to behave exactly like <h:inputText> and friends with regard to (bean)validation and triggering prevalidate/postvalidate events.

It should work as intented when you add the following context parameter.

<context-param>
    <param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
    <param-value>true</param-value>
</context-param>

Additional benefit is that you can now use @NotNull on <o:viewParam> (and <h:inputText>, etc). Let me know if this works out for you.

@gusehr

This comment has been minimized.

Show comment
Hide comment
@gusehr

gusehr Dec 2, 2014

Hello Bauke.

I'm sorry for the late reply.
I will try to make the suggested change, actually I'm passing an optional integer parameter via o:viewParam.

ASAP I will inform you about the results.

Thank you.

gusehr commented Dec 2, 2014

Hello Bauke.

I'm sorry for the late reply.
I will try to make the suggested change, actually I'm passing an optional integer parameter via o:viewParam.

ASAP I will inform you about the results.

Thank you.

@BalusC BalusC closed this Mar 2, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment