> On Fri, 28 Jan 2005 09:18:57 -0500, S. Isaac Dealey
> <[EMAIL PROTECTED]> wrote:
>> See, that's *way* more control than I want to leave
>> to the form tag... It also doesn't account for a
>> great number of other possibilities -- i.e. text
>> description of a field's content above, below
>> or to the right of the input element.

> I just used the default XSL skin but you can create
> arbitrary skins to do whatever formatting you want.
> The point is that it completely separates the form
> logic from the form presentation. If you've been
> following the Blackstone demos, you'll have seen
> a number of custom controls created using this
> technique two (such as multi-step wizards
> and related selects).

>> How would you make the form align all of the labels to
>> the left?

> Use a different skin.
>
> cfform takes some radical leaps forward in Blackstone. I
> expect that
> many more people will start using cfform now and the all
> the old
> complaints about the crappy code it generates will go
> away...

Okay good information. I really haven't had the time to follow the
demos unfortunately. The work I've been doing on the framework is done
primarily for myself -- that is -- I implement features which will
make my life easier and then I provide those tools to the general
public.

>> Do the input elements still require the form context?
>> I.e. if I change <cfform> to <form> will the <cfinput>
>> and <cfselect> tags still produce an error the way
>> they did with previous versions of
>> ColdFusion?

> I don't know. Why would you want to do that?

A number of reasons... If you wanted to use the same input element in
multiple forms, etc... The onTap framework forms really are a modular
(nearly OO) approach to development. Lets say that I develop an
application that I sell to someone and they don't like the way my
forms are written / presented -- they want to add or remove fields.
They have the ability to do this in my application without editing a
single character of the code I wrote. When I later produce an updated
version of my application, they can both upgrade quickly and maintain
all their modifications without the need for any kind of manual or
even automated code merging process. That's the primary reason I'd
want to do it.

>> Is that in reference to the automated database
>> integration?

> Yes. I didn't know what your radio button tag did so I
> just provided a single radio button.

It examines the database for a foreign key on a column matching the
name of the input element. If it finds a foreign key it then attempts
to query the database for content from the imported table to create a
series of radio buttons -- the same as it did/does for the select tag.
So in the previous example, if the database contained these tables:

PRODUCTSTATUS
  statusid,
  statusname

PRODUCTCATEGORY
  categoryid,
  categoryname

PRODUCT
  categoryid references productcategory.categoryid
  statusid references productstatus.statusid

this xhtml will produce a series of select-options (from the
productcategory table) and radio buttons (from the productstatus
table) which are properly i18n locally sorted for the current request.

<form tap:dbtable="product">
  <select name="categoryid" />
  <input type="radio" name="statusid" />
</form>

This is of course minus any formatting to highlight what is actually
being automated. Note that the default values for these fields is not
provided, however the form may still be populated when displayed as a
result of default form population (see below).

>> It looks like it still leaves other complexities
>> unhandled by the form tho... Would this form be
>> populated (since there aren't any value attributes)
>> if I entered "&productName=myprocuct" on the
>> url for example?

> I did not provide any initial values for the form fields
> but I could have done.

Which is a "no" answer. If you put the above xhtml (along with the tag
that drives it) in an onTap request and added
"&categoryid=1&statusid=2" it would automatically populate the form
with those values (if the options contained those values).

>> Does this equivalent Blackstone form also automatically
>> validate the input elements?

> Yes. Go read Ben Forta's blog for more information about
> field validation and input masking.

Just did. The answer is actually still "no". By automatic validation
I'm not referring to having an attribute in the tag which allows you
to specify how a field is validated -- I'm talking about validating a
field to a given type _without_ specifying the type. That's what the
onTap framework's form features do when you use the xhtml syntax and
specify a database table to compare the form elements against. The
framework of course provides opportunities to suppress, replace,
add-to or alter this default validation also. Although Forta's blog
entry does bring up another feature I should add, which is onblur
validation.

>> Does blackstone offer a validation tag (as opposed to
>> attributes) which allows multiple input elements to be
>> validated simultaneously?

> I'm not sure I understand your question.

It's a syntax question... In the previous example:

<tap:validate type="required">
  <input name="offerprice" />
  <input name="availabledate" />
</tap:validate>

the <tap:validate> tag allows you to indicate that all contained input
elements are required at one time without needing to specify
validation for each input element individually. The error messages
produced have default values which are then merged with the labels of
the fields being validated.

>> When fields fail validation are they highlighted?

> Depends on the skin.

Fair enough.

>> Do blackstone forms
>> handle server-side form validation gracefully using the
>> same code or
>> does it still rely on the clunky server-side validation
>> provided with
>> previous versions of ColdFusion?

> I don't know enough about how things used to work to
> comment.
> Blackstone form validation is very slick and powerful.

The answer here is also "no". Server-side validation with ColdFusion
has always been a weakness... While it's possible to create your own
server-side form validation with <cferror> it's just not a very
thorough solution...

By comparison, lets say that you had created a form using xhtml in the
onTap framework. You would then submit that form to a sub-process (in
most cases) and the structure of the form (all it's xhtml, etc) would
be available for modification at the time it's validated on the
server.

<cfmodule template="#request.tapi.xhtml()#">
  <form tap:variable="myform">...</form>
</cfmodule>

<cfif formValidate(myform,myerrors)>
  ... do some stuff
<cfelse>
  <cfoutput>#htlib.show(myform)#</cfoutput>
</cfif>

The server side form validation works the same way the client-side
validation works -- it checks each field, places any errors in an
array and can then optionally automate the process of placing the
messages in another html element (a <div> for instance). Individual
form fields can have event listeners which make modifications to the
resultant html when the input element fails server-side validation.

Going back to the previous question about needing the context of the
cfform tag for cfinput elements -- if I've sold an application to
someone who decides they don't want to use a form field which is
required by default, they can remove the required input element
without affecting the form's validation (and without editing a single
character of my code) -- that is, the form only validates what it
contains at the time it is validated.

Some of these features come from the fact that the forms themselves
are part of the html function library which creates _completely_
modular display. The xhtml syntax is merely an interface for
simplifying and extending some of the features of the html library's
API. Some of the API's features do require the xhtml syntax to be used
-- for isntance the automated select-options are an affectation of the
xhtml syntax which can only be achieved because the syntax itself
provides context which is not available to the underlying API.


> Since you're so very interested in all this stuff, perhaps
> you should
> have made the time to join the beta program to get early
> access to
> features and also to help the product team by testing
> stuff and even
> offering input?

I really wasn't trying to be inflammatory... Blackstone's getting a
lot of ink and deservedly so, the folks at MM are doing a lot of great
things with it. But there are many ways to skin a cat as they say, and
I figured this was as good an opportunity as any to get some ink for
the framework by pointing out that it's available for free for anyone
who would like an alternative to cfform.

I certainly don't expect it to replace cfform for everyone, but it
does what I need and has a number of features that cfform doesn't --
and likely wouldn't even if I were offering feature suggestions on the
beta as a simple result of being one person's voide in a huge crowd.
As an independent developer I find that I'm able to get a lot more
accomplished and in a much shorter period of time by working on my own
development than I can by contributing to a beta.

On a purely personal level I'm still not very impressed with the new
form features -- I'm not really interested in getting heavy into XSLT
just so I can do something that's currently easy for me, doesn't
require much time on my part and for the most part only affects the
style of the display. I could emulate some of the encapuslation
features of the cfform skins if I wanted to with little effort by
adding a couple of functions to drive the xhtml syntax, i.e.
<tap:form><tap:input /></tap:form> could do essentially the same thing
as the new cfform/cfinput tags (plus the onTap features) with little
effort on my part.


s. isaac dealey   954.927.5117
new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework

http://macromedia.breezecentral.com/p49777853/
http://www.sys-con.com/story/?storyid=44477&DE=1
http://www.sys-con.com/story/?storyid=45569&DE=1
http://www.fusiontap.com




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192122
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to