MonoRail - Clearing value on edit form submission doesn't trigger validation
Posted
by Justin
on Stack Overflow
See other posts from Stack Overflow
or by Justin
Published on 2010-05-28T18:19:15Z
Indexed on
2010/05/28
18:22 UTC
Read the original article
Hit count: 241
monorail
Hey,
In a MonoRail app I have an add/edit view. On add if I don't pick a value for a dropdown I get a validation error and am forced to pick a value. However, if I then edit that same item and reset the dropdown back to the first item ("Select an Item", "0"), it saves and doesn't say it was invalid. Debugging the entity sent back to the server, I can see that it's sending the original value for the dropdown instead of the new value of "0".
What's going on here? The first thing I would expect is that it would trigger the validation since the dropdown value isn't set. The second thing I would expect is that it would send the new value I send, not the original. It does send the new value if I change it to another value, but it's as if it has internal logic that says - "I'm updating this entity and a new value was not passed, just don't change the entity value."
Thanks, Justin
© Stack Overflow or respective owner