Strange behaviour of selectOneMenu
Sounds like your validator is somehow munging it? Like the validator is failing and thus the old value remains.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1
-
- Posts: 25
- Joined: 16 Jun 2021, 16:48
But a validator should NOT act like this.... this is the ONLY validator that does not works. The code is wrong?
I would assume since if you remove the validator the code works fine. So it sounds like the bug is somewhere in this validator.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1
Also did you see the answer on StackOverflow: https://stackoverflow.com/questions/684 ... -not-rende
I was going to suggest the same thing I don't know why you even need this validator?
I was going to suggest the same thing I don't know why you even need this validator?
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1
-
- Posts: 25
- Joined: 16 Jun 2021, 16:48
The answer does not work, I'll write there why.
Why I need a Validator? Well, why you need int?
I need a Validator because I want to be sure that the user has done a choice in a SelectOneMenu, and I can't find a way to do it. It's the scope of validators, check if the value of an input is correct.
Why I need a Validator? Well, why you need int?
I need a Validator because I want to be sure that the user has done a choice in a SelectOneMenu, and I can't find a way to do it. It's the scope of validators, check if the value of an input is correct.
Why not just use required="true" and requiredMessage="A value is required" or whatever you want it to say?
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1
-
- Posts: 25
- Joined: 16 Jun 2021, 16:48
Because I have to repeat `requiredMessage="A value is required"` for every input. But what if the message changes? This is against the One Source of Truth.
Is there not a way to change the message globally by default?
Is there not a way to change the message globally by default?
Yep i believe you can configure that with a JSF Message Bundle property globally.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1
-
- Posts: 25
- Joined: 16 Jun 2021, 16:48
Ok, this is my solution:
https://stackoverflow.com/a/68483393/1763602
but the problem is that, if I select an option and then back the noSelectionOption, the wrapper does NOT update.
https://stackoverflow.com/a/68483393/1763602
but the problem is that, if I select an option and then back the noSelectionOption, the wrapper does NOT update.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 58 guests