form tag library, "please select an option"

1 view
Skip to first unread message

Brian FitzGerald

unread,
Sep 6, 2010, 1:46:10 PM9/6/10
to Mach-II for CFML
Hey all,

I'm trying to plug the awesome new form tag library into my
application, and I'm hitting one little snag. I noticed that the form
tag library documentation states that:

"We recommend that if you use a "please select an option" value in the
drop down that you use - (dash) as a value by default."

The issue for me is, my form is an add/edit forms (manage users) where
if an existing user is selected it's an edit, and if not, it's an
add. As a result, the listeners and model are currently written to
look for the value of 0 to indicate a new user rather than an existing
user. However, when I use 0 rather than "-" in my "please select a
user" option tag, it never gets selected. Is there a way around this,
or do I need to modify my model and listeners to look out for the dash
rather than the 0 when indicating a new user.

Thanks in advance for any insight!

Brian

Peter J. Farrell

unread,
Sep 6, 2010, 2:03:05 PM9/6/10
to mach-ii-for...@googlegroups.com
Brian, you can use whatever you want for a default value. Could you
share the code you have for the form?

.pjf

Brian FitzGerald said the following on 09/06/2010 12:46 PM:

Brian FitzGerald

unread,
Sep 6, 2010, 2:26:18 PM9/6/10
to Mach-II for CFML
Hey Peter, actually I would have been more than happy to share the
code, but before I did I wanted to avoid anything embarrassing by
giving another thorough once over =) What was causing the issue for
me (clearly my own error) was that I had the form bound to "user",
while the variable in the event object for my user object was actually
called "currentUser".

Updating the bind attribute to "currentUser" in the form tag corrected
my mistake.

Thanks for the reply!
Brian

Peter J. Farrell

unread,
Sep 6, 2010, 3:51:21 PM9/6/10
to mach-ii-for...@googlegroups.com
Brian, glad you got your issue fixed. I've run into the same problem
before myself -- definitely error between keyboard and programmer.
Anyways, would it be helpful if the form:form tag wrote a log message to
show what it was bound to? Maybe under a "trace" level log message? If
so, please file a ticket for that in Trac.

.pjf

Brian FitzGerald said the following on 09/06/2010 01:26 PM:

Reply all
Reply to author
Forward
0 new messages