Scaffolding vs documentation example

8 views
Skip to first unread message

Randy Johnson

unread,
Nov 26, 2009, 6:09:17 PM11/26/09
to ColdFusion on Wheels
Here is the code from the documentation:

<p>
        #radioButton(objectName="user", property="gender", tagValue="m", label="Male")#<br />
        #radioButton(objectName="user", property="gender", tagValue="f", label="Female")#
    </p>



Here is the code from the scaffolding plugin:

<p><label>Gender</label> <br />
#textField(objectName='user', property='gender')#</p>

I am curious as to why the scaffolding plugin wouldn't follow the documentation example?  I would assume that the documentation example would be the best practice?

Granted I know the bottom one is a text field and the top is a radio button, but the scaffolding plugin actually put in the html rather than using the label attribute as the example did.


Is one way better than the other?

Thanks!

Randy


raulriera

unread,
Nov 26, 2009, 7:02:27 PM11/26/09
to ColdFusion on Wheels
Randy,

I wrote that plugin.. you are right there.. I followed that
"convention" because that is what Rails was doing.. but I guess I
should be doing that instead. What do you guys think? should I keep it
a single Wheels function? makes more sense now that I think about it

John C. Bland II

unread,
Nov 26, 2009, 8:43:29 PM11/26/09
to cfwh...@googlegroups.com
Stick to the docs, IMO.

Sent from iPhone 3G
> --
>
> You received this message because you are subscribed to the Google
> Groups "ColdFusion on Wheels" group.
> To post to this group, send email to cfwh...@googlegroups.com.
> To unsubscribe from this group, send email to cfwheels+u...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/cfwheels?hl=en
> .
>
>

Chris Peters

unread,
Nov 26, 2009, 8:50:24 PM11/26/09
to cfwh...@googlegroups.com
+1 on using the Wheels functions.

The plugin still kicks ass though!

John C. Bland II

unread,
Nov 26, 2009, 9:08:04 PM11/26/09
to cfwh...@googlegroups.com
I'm giving it a whirl this weekend and def' look forward to using it.

Sent from iPhone 3G

raulriera

unread,
Nov 26, 2009, 9:36:11 PM11/26/09
to ColdFusion on Wheels
I certanly don't like the HTML this produces

#textField(objectName="user", property="name", label="Name")#

so I am thinking something like this

#textField(objectName="user", property="name", label="Name",
labelPlacement="before", prepend="<p>", append="</p>")#

Is it HTML "safe" to wrap a label around a field? doesn't sit right
with me...

On Nov 26, 9:43 pm, "John C. Bland II" <johncblan...@gmail.com> wrote:
> Stick to the docs, IMO.
>
> Sent from iPhone 3G
>

John C. Bland II

unread,
Nov 26, 2009, 10:00:26 PM11/26/09
to cfwh...@googlegroups.com
Yeah, label can wrap a field just fine.

Sent from iPhone 3G

Chris Peters

unread,
Nov 26, 2009, 10:08:59 PM11/26/09
to cfwh...@googlegroups.com
Why not let the developer worry about the defaults of labelPlacement, prepend, append, etc?

You can set those in config/settings.cfm or events/onapplicationstart.cfm. I wrote a blog post about this back in July:
http://www.clearcrystalmedia.com/pm/setting-global-defaults-wheels/

Chris Peters

unread,
Nov 26, 2009, 10:10:09 PM11/26/09
to cfwh...@googlegroups.com
I should mention that things have changed slightly since I wrote that blog post. Instead of the wrapLabel argument, it should be the labelPlacement argument.

raulriera

unread,
Nov 26, 2009, 10:18:55 PM11/26/09
to ColdFusion on Wheels
Chris = Rock star, will do
> > cfwheels+u...@googlegroups.com<cfwheels%2Bunsubscribe@googlegroups.c om>
> > > > .
> > > > For more options, visit this group athttp://
> > groups.google.com/group/cfwheels?hl=en
> > > > .
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "ColdFusion on Wheels" group.
> > To post to this group, send email to cfwh...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > cfwheels+u...@googlegroups.com<cfwheels%2Bunsubscribe@googlegroups.c om>

John C. Bland II

unread,
Nov 26, 2009, 10:26:10 PM11/26/09
to cfwh...@googlegroups.com
No doubt!

+1

Sent from iPhone 3G

raulriera

unread,
Nov 26, 2009, 10:31:22 PM11/26/09
to ColdFusion on Wheels
http://github.com/raulriera/Scaffold/blob/master/CHANGELOG

What's in 0.3.1 so far, ideas are welcome
> > > cfwheels+u...@googlegroups.com<cfwheels%2Bunsubscr...@googlegroups.c om>
> > > > > .
> > > > > For more options, visit this group athttp://
> > > groups.google.com/group/cfwheels?hl=en
> > > > > .
>
> > > --
>
> > > You received this message because you are subscribed to the Google Groups
> > > "ColdFusion on Wheels" group.
> > > To post to this group, send email to cfwh...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > cfwheels+u...@googlegroups.com<cfwheels%2Bunsubscr...@googlegroups.c om>

Chris Peters

unread,
Nov 26, 2009, 10:42:27 PM11/26/09
to cfwh...@googlegroups.com
Is there a way that you can introspect if it's of type TEXT (and equivalent in other RDBMSes) and make it a textArea() instead of textField()? That was something that I noticed when I was playing with it the other day.

To unsubscribe from this group, send email to cfwheels+u...@googlegroups.com.

raulriera

unread,
Nov 26, 2009, 11:21:33 PM11/26/09
to ColdFusion on Wheels
Yeah I hate that too, but I am using Wheels introspection and it just
returns varchar to me... can't really tell if it is TEXT if I dont
manually introspect every adapter
> > > > > cfwheels+u...@googlegroups.com<cfwheels%2Bunsubscribe@googlegroups.c om>
> > <cfwheels%2Bunsubscr...@googlegroups.c om>
> > > > > > > .
> > > > > > > For more options, visit this group athttp://
> > > > > groups.google.com/group/cfwheels?hl=en
> > > > > > > .
>
> > > > > --
>
> > > > > You received this message because you are subscribed to the Google
> > Groups
> > > > > "ColdFusion on Wheels" group.
> > > > > To post to this group, send email to cfwh...@googlegroups.com.
> > > > > To unsubscribe from this group, send email to
> > > > > cfwheels+u...@googlegroups.com<cfwheels%2Bunsubscribe@googlegroups.c om>
> > <cfwheels%2Bunsubscr...@googlegroups.c om>
> > > > > .
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/cfwheels?hl=en.
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "ColdFusion on Wheels" group.
> > To post to this group, send email to cfwh...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > cfwheels+u...@googlegroups.com<cfwheels%2Bunsubscribe@googlegroups.c om>

Chris Peters

unread,
Nov 26, 2009, 11:39:30 PM11/26/09
to cfwh...@googlegroups.com
Gotcha.

To unsubscribe from this group, send email to cfwheels+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages