On Nov 28, 2003, at 2:02 PM, Jon Gunnip wrote:
For example, if a name can be at most 50 characters, I want some easy way for my GUI to make sure the name input text box has an attribute size="50".

You mean maxlength="50" not size="50" I think.


How are you generating your HTML? Are you using a separate view (a la Mach II) or are you generating the field from the CFC itself?

This is one of those interesting situations where you have data that is needed by the model and the view but you only want loose coupling between the two.

My question is: What is the best way to expose the most basic validation logic to my UI? It doesn't seem appropriate to have it locked away just in the component.

One possibility is to create a separate validation component, perhaps driven by XML, and have that act as a service to both your view and your model.


Another possibility is to tie your view to your model a little more closely by having methods on the model to return enough data for your view to generate appropriate HTML / JS (which is what you're already considering and concerned about).

Another possibility is to add methods to your model that render HTML controls for capturing the data fields (lots of controversy around this option but it might be appropriate since you want your UI to closely reflect some of the business logic in your model).

Sean A Corfield -- http://www.corfield.org/blog/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email.


CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to