-
1. rich:validator passedLabel
alexsmirnov Mar 7, 2011 12:48 PM (in response to sparrowhawk)We put off 'passed' state in messages, because it's not clear how to implement that. In the mose cases, fields that user didn't touch should not show errors nor 'passed' status. Some attempts to implement that scenario in RF 3.3 doesn't work well, so we decided to review use cases and algorithms after 4.0 release.
-
2. rich:validator passedLabel
sparrowhawk Mar 7, 2011 12:51 PM (in response to alexsmirnov)np. I have a workaround for now. It's a bit hackadoo but it totally works. I just style rf-msg something like:
.ok {
background: url('/img/ok.gif') top left no-repeat;
}
.rf-msg {
position: absolute;
top: 3px;
left: -5px;
width: 12px;
height: 12px;
display: block;
}
.rf-msg-err {
background: url('/img/error.gif') top left no-repeat;
position: absolute;
top: 0;
left: 0;
width: 12px;
height: 12px;
display: block;
}
.rf-msg-dtl { display: none; }
and then add a jquery on blur to the inputText (or whatever):
onblur="if ($('#nameLast').val().length > 0) { $('#nameLastMessage').addClass('ok'); return true;} else { $('#nameLastMessage').removeClass('ok'); return true; }"
-
3. rich:validator passedLabel
alexsmirnov Mar 7, 2011 2:43 PM (in response to sparrowhawk)We already tried similar ways... the problem is that if field is required and you remove all input message will show 'Ok' again - and it's incorrect state. Having form submit and server-side messages adds mess to it.
Common use case should use more sofisticated algorithm to detect correct value and to not mark input as 'valid' then you remove input.
-
4. Re: rich:validator passedLabel
sparrowhawk Mar 7, 2011 2:54 PM (in response to alexsmirnov)Alexander, your extremely excellent points are really raining on my parade!
I suppose it I knew that the whole validation was to be executed on the client I could use keyup as the event which would avoid this pitfall .... but I do see that this may be a slippery slope.