W3C home > Mailing lists > Public > www-forms@w3.org > April 2010

Re: When the view has refreshed, how would I know?

From: John Boyer <boyerj@ca.ibm.com>
Date: Tue, 20 Apr 2010 17:47:09 -0700
To: Erik Bruchez <ebruchez@orbeon.com>
Cc: "www-forms@w3.org" <www-forms@w3.org>
Message-ID: <OFC5247DE6.AF557315-ON8825770C.0002C27F-8825770C.00045162@ca.ibm.com>
Actually, I think Philip is not asking a question that is ideally answered 
by databound switches, but rather is asking a question about maintaining 
switch cases across an instance replacement.  I agree with you, Erik, that 
switches should not resort back to their starting default cases because of 
something like an instance replacement.   It's a bug in the implementation 
to have the switch use the default case at any time other than 
initialization of the UI control. 

UI initialization is most easily seen to occur on form startup (i.e. 
during default processing of xforms-model-construct-done) and during 
creation of a new repeat item.  Generally, a UI control is capable of 
outliving the data to which it is bound, so even if an instance 
replacement occurs, if the switch was bound to a node and is again bound 
to a node, then the case selection would not be expected to change, even 
though the data inside the new node may be different and therefore the UI 
controls inside the case may bind to different nodes or have different 
values, or even not bind anymore.

The lifecycle of UI controls that directly become unbound or which become 
non-relevant for any of a host of reasons is a little hazier and was the 
subject of much discussion at the last face to face meeting. 

John M. Boyer, Ph.D.
STSM, Lotus Forms
Workplace, Portal and Collaboration Software
IBM Victoria Software Lab
E-Mail: boyerj@ca.ibm.com 

Blog: http://www.ibm.com/developerworks/blogs/page/JohnBoyer
Blog RSS feed: 

Erik Bruchez <ebruchez@orbeon.com>
"www-forms@w3.org" <www-forms@w3.org>
04/20/2010 03:38 PM
Re: When the view has refreshed, how would I know?


At least in Orbeon, switches will keep the currently selected case
until they become non-relevant (if they do become non-relevant). I
assume you have such a situation then? Otherwise, it's a bug ;)

Also, I assume you have looked at <fr:databound-switch>? [1]

Now one of the new features under consideration for XForms 1.2 is a
data-bound switch, which I think is meant to address exactly your use
case. [2] Note that this is just a proposal under consideration.
Feedback is welcome.



[2] http://www.w3.org/MarkUp/Forms/wiki/Model-based_switching_with_switch

On Tue, Apr 20, 2010 at 2:05 AM, Philip Fennell
<Philip.Fennell@marklogic.com> wrote:
> I have a view, rendered by some XForms groups and controls and 
> the instance, from which the view is rendered, will get reloaded as a 
> of other events in the UI. This causes the view to refresh and as a 
> any switches in the view will revert to their default case.
> Now, I can maintain the current selection(s) in an additional instance 
> structure but it doesn't appear that there is an event I can listener 
> that is dispatched once the view has completed rendering. If there was 
> I could invoke a toggle action to set the appropriate case(s). This, of
> course, relies upon the case element variant of a toggle action but just
> having an 'xforms-refresh-done' event would be nice.
> I see in Orbeon's documentation that they have considered this scenario, 
> I wonder what other people have experienced in this area.
> Regards
> Philip Fennell
> Consultant
> Mark Logic Corporation
Received on Wednesday, 21 April 2010 00:47:44 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:38:00 UTC