remoteURL and methodname?

16 views
Skip to first unread message

Jim Priest

unread,
Mar 18, 2013, 3:33:18 PM3/18/13
to valida...@googlegroups.com
I'm tinkering around with the custom validations and remoteURL.

The docs are a bit confusing...

They show:

<rule
type="custom" failureMessage="That UserName is already taken. Please try a different one."> <param name="methodname" value="validateDuplicateUserName" /> <param name="remoteURL" value="validateDuplicateUserName.cfm"/> </rule>

I'm using a CFC...

<rule type="custom" contexts="*" failureMessage="The filename violates one or more of our filename rules (see below).">
<param name="methodname" value="checkfilename" />
<param name="remoteURL" value="http://localhost/compliance_admin/oceft/remoteproxy.cfc" />
</rule>


But when I submit that in Firebug I see:

http://localhost/compliance_admin/oceft/remoteproxy.cfc?file=162212.pdf

I was expecting
remoteproxy.cfc?methodname=checkfilename&file=162212.pdf

It seems like I don't even need the methodName? I can declare it in the URL:

<rule type="custom" contexts="*" failureMessage="The filename violates one or more of our filename rules (see below).">
<param name="remoteURL" value="http://localhost/compliance_admin/remoteproxy.cfc?methodname=checkfilename" />
</rule>


And this correctly passes the methodname and the file.

Am I missing something or is this the correct behavior?

Thanks!
Jim


Jim Priest

unread,
Mar 19, 2013, 9:40:27 AM3/19/13
to valida...@googlegroups.com
I think I figured this out - the methodName is used for server side validation and the remoteUrl is for client side.

Jim

John Whish

unread,
Mar 19, 2013, 9:47:13 AM3/19/13
to valida...@googlegroups.com
Yup,
remoteURL is the URL you want the client side validation to call (as an AJAX request)
methodName is what is called server site.
You can omit the remoteURL is you want (maybe for security or some other reason).
- John

--
You received this message because you are subscribed to the Google Groups "ValidateThis" group.
To unsubscribe from this group and stop receiving emails from it, send an email to validatethis...@googlegroups.com.
To post to this group, send email to valida...@googlegroups.com.
Visit this group at http://groups.google.com/group/validatethis?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jim Priest

unread,
Mar 21, 2013, 2:55:10 PM3/21/13
to valida...@googlegroups.com
Where should I put the file declared in the remoteURL?  In the same directory as the rules file?

I'm using FW/1 and getting weird behavior regardless of what I use for the path.  Initially I had my remoteProxy.cfc in the root. But this fails if I use SES variables (I think) as the path changes relative to the URL.

<param name="remoteURL" value="../../../../remoteproxy.cfc?method=checkFileName" />

index.cfm/admin:document/maintain
index.cfm/admin:document/maintain/documentid/602

Doing an absolute path doesn't seem to work either?

I'm a bit stuck...  :\

Jim

Matt Quackenbush

unread,
Mar 21, 2013, 2:59:55 PM3/21/13
to valida...@googlegroups.com
Jim, I've always used a root path for the remote methods.

(i.e. `?load=registration.checkUsername` or `/registration/checkUsername` )






Jim

--
Reply all
Reply to author
Forward
0 new messages