Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 40369 invoked by uid 500); 20 Dec 2002 14:39:49 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 40336 invoked from network); 20 Dec 2002 14:39:46 -0000 Subject: [Proposal] XForm with linking and model item properties WAS:Re: [Proposal] XMLForm: Data Provider From: Jakob Praher To: cocoon-dev@xml.apache.org In-Reply-To: <016301c2a745$f89dac20$d767a8c0@kpiroumian> References: <1040233951.11146.649.camel@localhost> <00f501c2a73e$1fee3130$d767a8c0@kpiroumian> <016301c2a745$f89dac20$d767a8c0@kpiroumian> Content-Type: text/plain Organization: Message-Id: <1040395083.1069.104.camel@localhost> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.0 Date: 20 Dec 2002 15:38:03 +0100 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 20 Dec 2002 14:36:20.0046 (UTC) FILETIME=[295C8EE0:01C2A835] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N hi konstantin, hi all, first, thanks for your pointers. I looked at the various "advanced" xforms constructs and have come to following solution for realising it in "standard" xforms: I will first introduce the solution and then put some questions, which should be settled before implementation starts ... the solution I found: ============================================================ select a country ... select a state ... +======================================================================+ | questions/problems and orthogonalities: | +======================================================================+ * how to refer to the model which is kept in the Form.getFormModel( ) and is accessed via JXPath? ---------------------------------------------------------------------------- I propose here a kind of well-known identifier. In my example, I have used 'xf:builtin-instance' as the name of the instance that resides in the Form object, and is accessed via JXPath. We could also use a kind of form( ) method or something like that. but that is not standard conform. * there is a instance( ) method to access different instances, but there is no method to change the model via XPath. ----------------------------------------------------------------------------- so we have to suppose that the well known instance 'xf:builtin-instance' is a member of very model. Otherwise we can't write the binding, as there is no xpath expression for chaging the model. [ or does the instance( 'id' ) method work accross models ? ] * first version will be as simple as possible: ------------------------------------------------------------------------------ the tricky part of the implementation is part of translating the calculate property to DHTML Javascript Form. surely it would be interesting to get only the "required" data from the server. Such a mechanic could be implemented by using data request line, with which the client can request the data on an as needed basis - this could probably be implemented using a generic Action Component that, looks up the data description from the form defnition and serves the data to the client. a very "cheap" idea would be to give the client all the data and let him choose the appropriate data. the logic can be deduced from the calculate model properties like : javascript: for the sake of simplicity one could write a huge recalculate function and trigger it based on the dependencies in the calculate xpath. the transformer also has to track which form elements depend on calcluated data. these form elements must be recalculated if the data they depend on is recalculated too. for instance: for every instance data element refered to by a "ref", make function for refreshing the view for every bind nodeset with a calculate property make a recalculation function. in the recalculate function call those refresh functions that refer to the recalculated instance data. the xpath calculate expression to javascript converter could get quite tricky. I will experiment with them a bit. any ideas on this are appreciated. thanks -- Jakob Am Don, 2002-12-19 um 11.04 schrieb Konstantin Piroumian: > From: "Konstantin Piroumian" > > From: "Jakob Praher" > > > > > > Also see how the input controls are bound to the instance data using > binding > > expressions: > > > http://www.w3.org/TR/2002/CR-xforms-20021112/slice3.html#structure-bind-elem > > ent > > Minor addition to this point. Usually, an XForms form contain a defaul > 'instance' data which is referenced by simple expressions like > '/customer/name', but you are allowed to use multiple 'instance' data > objects and you can reference particular 'instance' using instance() > function, e.g.: > > The instance: > > > John > > > > and the reference:ref="instance('orderform')/shipTo/firstName" > The default instance in case of XMLForms is the underlying Form object, so > this will require support for multiple instances.As for the function in > referencing expression: it should not be much difficult as XMLForms uses > JXPath to retrieve values and it's quite easy to add extension functions to > it. > > Konstantin > > > > > > > Regards, > > Konstantin > > > > > > > > thanks in advance > > > > > > -- Jakob > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org > For additional commands, email: cocoon-dev-help@xml.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org For additional commands, email: cocoon-dev-help@xml.apache.org