Open djmj opened 1 month ago
Ahhh I think I see what you are saying. The Input value should not be processed and trigger a validation warning when only the country is selected.
@djmj why not just do this...use @none
<p:ajax event="countrySelect" process="@none" listener="#{controller.onCountrySelect}"/>
This is how most PF components work and gives you the added flexibility for people who DO want it to validate the submission on country change.
Case A) user entered number
I see your point in case a user already entered a phone number and then changes the country the validation should occur and for this case i want to validate it too.
Example: user switches from germany to austria with a valid phone number
Case B) Input field is still empty
But the case i described is when the user has not entered anything at all in the text input and this is confusing to the user since he has not done anything wrong to be "invalid".
Cant have A and B
Yes this could be a workaround but with a drawback. The workaround will work not work for case A which is not desired but for case B. Cant have both this way.
Internal solution
Can the component itself not check if its fired from event countrySelect
and stop validating empty input?
In this showcase its also confusing for the user since the required
JSF validator gets triggered while he has just selected a country.
For us its not really important since we dont have a use case for countrySelect
but i just wanted to check current state of the component if we shall use it in our application.
@NicolaIsotta @jepsar i also can see this scenario being confusing for users.
Describe the bug
In showcase the"countrySelect" ajax is fired on dynamic country detection from input and this should not trigger the input validation but show the info "selected" message.
Reproducer
http://www.primefaces.org/showcase-ext/sections/inputphone/basicUsage.jsf
Expected behavior
With "countrySelect" ajax event it should trigger the info message "country selected". Same behavior as if user selects it from dropdown menu.
PrimeFaces Extensions version
14.0
JSF implementation
None
JSF version
No response
Browser(s)
No response