Hi all,

Just a very quick question for you all. I am having problems with using get and set methods inside a CFC and it's driving me crazy.

I can set a string variable as such;
<CFSCRIPT>
   NewReg.setUsername("abc");
</CFSCRIPT>

This will execute the following lines of code in the NewReg CFC.

<CFFUNCTION NAME="setUsername" ACCESS="public" RETURNTYPE="void">
   <CFARGUMENT NAME="Username" TYPE="string" REQUIRED="true">
   <CFSCRIPT>
       variables.username = '#Arguments.Username#';
   </CFSCRIPT>
</CFFUNCTION>

However, when I then call the NewReg.getUsername() method in the same CFC, I seem to be getting tabs or something appended to the front of the string.

For reference purposes, I have appended the code used in the get method also;

<CFFUNCTION NAME="getUsername" ACCESS="public" RETURNTYPE="string">
       <CFRETURN variables.username>
</CFFUNCTION>

This is quite odd, because if I use the Len() function on the value returned from this call I get the number 3 returned, and the following code evaluates to "True";

NewReg.getUsername() IS "abc"

However when I output the code in the HTML form field, I get a box with two tabs before the beginning of the string.
(Please note this is only occuring in IE)


When I examine the source for the web page, I see this;

<INPUT NAME="username" TYPE="text" ID="username" VALUE="
       callummc">

While firefox seems to be ignoring the line break and tabs that are added to this, IE does not...

Whilst this may on the face of things appear to be a browser issue, my questions is why is ColdFusion adding tabs and line breaks where there are none ?

If someone can help me out here I would really appreciate it... my head is starting to hurt.

Cheers,

Callum






---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

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




Reply via email to