|
Your welcome Brian, Your component was the key to the parser
as I needed the overall structure. For others, I’m going to try and pull out my
company’s specific code into maybe a sample app after I finish two other
projects. When done I’ll distribute here. Thanks, Phil From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brian Kotek Hi Philip, thanks for the
plug! This is twice in a week that someone here has posted about something I've
written that has helped them out. It's gratifying to know that others are
finding my ramblings helpful! On 1/20/06, Duba,
Phillip <[EMAIL PROTECTED]>
wrote: I can't give the full parser out, but I've attached the
XmlUtils.cfc that I use to load the XML into a Structure and I'll explain what
I do. The application is Fusebox 4.1 and the XmlUtils.cfc is the component that
Brian Kotek built in his Builder.com
article in 2003 at http://builder.com.com/5100-6386-5057635.html without his
recurseXMLObject function and with my XmlToStruct one. Now, I defined the
structure of the XML as follows: Application - Page -- Query -- Group --- Field Each tag has its own attributes that the parser uses to
determine what functionality to include or execute. I divided the building of the page into a few different
sections: - Generate queries to get the information needed which is
based off the DestinationTable and DestinationField attributes of the Field
tags. This is executed for the whole application not just those needed for the
page. - Build default Attribute variables based on the Field tags
and using the information returned in the queries above. I set <CFPARAM>
tags since these things may have been submitted from a previous page. - Build the queries defined for the Page the user is
currently on with a standard columns of Value, Display (, DependentValue for
those driven from another form) - Build _javascript_ functionality for each Field on the Page
the user is currently on. - Build Hidden form variables based on all Attribute values
not related to Fields on the Page the user is currently on. -
Phil From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
On Behalf Of Baz
Hey Phil, I'd be curious to take a look at a complete example of this, with
the parser and everything… is that possible? Cheers, Baz From: [EMAIL PROTECTED]
[mailto:
[EMAIL PROTECTED]] On Behalf Of Duba,
Phillip Here's what I use in the application I was referring to in
yesterday's thread on this same/similar subject (hope this goes through) : <Field Label="Some form Label"
Type="Text,Select,Radio,etc." Required="Page/Group"
DestinationTable="TableName" DestinationField="FieldName"
ChildFields="ChildField1,ChildField2"
ParentField="ParentField1" Size="" MaxLength=""
Datasouce="QueryName" Validation="Date,Numeric" /> Ok now to answer questions that will come up with what do
things mean: -
ChildFields: these are form fields dependent on
this one. They are only available in select boxes and the selected value of
this field drives the available options of the Child form fields -
ParentField: the field whose selection drives the
available options of this select box -
Required: Validation necessary for form
submittal. The Page indicates the field is required to submit the form. The
Group indicates that if other members of the Group (a parent-tag to field) are
filled in, then this field is required to submit the form. -
Datasource: a parent field called Query is
defined with a name attribute and that's what is here. I hope that help or at least gets you thinking on how you
might want to implement a schema yourself. This XML is built using web-based
tools that a user (administrator in this case) has access tools to defined
pages/groups/fields of this wizard-based application. Thanks, Phil From: [EMAIL PROTECTED]
[mailto:
[EMAIL PROTECTED]] On Behalf Of Seth
Petry-Johnson Baz:
I've never actually done this before, I'm just spouting off ideas from the top
of my head :) And just
to make sure we're on the same page, I wasn't suggesting that the XML itself
display the form. Rather, I was suggesting that XML be used to describe
the form's metadata and a rendering component would read the XML and create the
actual HTML form tags. [I couldn't tell from your question if I'd made
that sufficiently clear or not, so I thought I'd clarify just in case] On
1/20/06, Baz <[EMAIL PROTECTED]>
wrote: Hey Seth, Can I see an example of some XML you have generated to
display a form? Curious, Baz
---------------------------------------------------------- An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
----------------------------------------------------------
|
