Re: Discussion points for <control/>

Requirements for <control/>

Behaves like an inbuilt command
     Uses recognizable interfaces (eg @ref @resource etc)

PRIVACY
     A form must indicate that it is willing to be embedded (thus revealing 
some internal data to the embedder)
     The embedded form must only have access to data granted by the 
embedder.

DATA
 Can pass data in; Can get data out

 Agreed interface is mirroring between a (sub)-instance in the embedding 
form, and a (sub-)instance in the embedded form.
 To the embedded form it looks like it is referencing one of its own 
instances.
 The embedding form sees the changes (more or less) simultaneously as they 
are made.
 There are clearly requirements to the two instances matching in shape in 
some way:

 QUESTIONS
         The embedding form has to supply a reference to a (sub-)instance 
that matches the instance in the embedded form.
 Are there requirements on the shape of that data? Are there checks that 
need to be made?

EVENTS
 Can get events passed in
 Can get events passed out

INDEPENDENCE
 A form should be able to be embedded and be free-standing.

PROPOSAL

 Any XForm that can be embedded signifies this with an element in the model 
that 1) identifies which instance receives the data, 2) receives events 
arriving from outside, 3) is the target for events to be sent to the 
outside.

 For now lets call it <interface/>; we can discuss naming later.

 So essentially the <control/> element in the embedder links to the 
<interface/> element in the embedee.

 Events targeted to <control/> emerge at the <interface/>; events targeted 
at <interface/> emerge at the linked <control/>

EXAMPLE

 <control id="process" resource="process.xhtml" ref="data" label="Before">
     <action ev:event="FINISHED">
         <setvalue ref="done">1</setvalue>
     </action>
 </control>
 ...
 <dispatch name="STOP" targetid="process"/>

------------
 <model>
    <interface ref="instance('values')" id="external">
        <action ev:event="STOP">
            ...whatever...
     <dispatch name="FINISHED" targetid="external"/>
        </action>
    </interface>
    ...
 </model>

QUESTIONS
Do events perform any differently in either forms?
For instance, do they still bubble up from the <interface/> element, and 
the <control/> element? Do they therefore appear in both forms?
What are the ramifications for xforms-ready if any?

Received on Thursday, 10 November 2022 11:28:46 UTC