Re: Validation errors during xforms-submit

Hi Aaron,

thank you, this clears things. Obviously my thinking is too tied up with 
server-side processing (where a batch update of multiple controls at a 
time could lead to this confusion).

Regards,
Uli.

Aaron Reed wrote:
> 
> Ulrich Nicolas Lissé wrote:
> 
>>
>> Hi All,
>>
>> I have a question about submit processing. At 
>> http://www.w3.org/TR/2005/PER-xforms-20051006/slice11.html#submit-event 
>> you can read:
>>
>> ...
>> 2. All selected instance data nodes are checked for validity according 
>> to the definition in 4.3.5 The xforms-revalidate Event (no 
>> notification events are marked for dispatching due to this operation). 
>> Any selected instance data node that is required but empty or found to 
>> be invalid stops submission processing after dispatching event 
>> xforms-submit-error.
>> ...
>>
>> My question is: How is the UI expected to behave in case some nodes 
>> are found to be invalid ?
>>
>> Since no notification events are marked for dispatching one could draw 
>> the conclusion that the UI isn't updated as well. But this would mean 
>> that the user won't see which fields are invalid and caused the 
>> submission to fail. There could be an event handler for 
>> xforms-submit-error executing a xf:refresh in order to update all 
>> control's states, but I don't think this would be good option. That 
>> way the form authors would be forced to attach such an event handler 
>> to any xf:submission just to be able to visualize what went wrong. So 
>> how can/should this be accomplished ?
>>
>> Regards,
>> Uli.
> 
> 
> Hey Uli,
> 
> Well, if the form author is really anxious about it, they can put a 
> refresh inside a xforms-submit handler on the submission element so that 
> all of the controls bound to that instance data are refreshed before the 
> default handling is done.  Or make sure submission is triggered outside 
> of any control that can be used to update instance data (xf:submit or in 
> DOMActivate handler on trigger, for example).  So any necessary refresh 
> is automatically done due to the focus change when the user gives focus 
> to the xf:submit, for example.
> 
> But having said that, I don't know the reasoning behind why the WG 
> decided not to require the processor to refresh the instance prior to 
> submission.
> 
> --Aaron
> 
> 
> 
> 


-- 
Ulrich Nicolas Lissé

Received on Tuesday, 22 November 2005 08:59:00 UTC