CFC getter and whitespace

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default CFC getter and whitespace

    Wondering if this is a bug. Using the following code.

    <cfapplication name="test" sessionmanagement="yes">
    <cflock timeout="20" type="exclusive" scope="session">
    <cfscript>
    SESSION.cfcEmployee = createObject("component", "Employee");
    SESSION.cfcEmployee.setFName("Joe");
    getterVar = SESSION.cfcEmployee.getFName();
    </cfscript>
    </cflock>
    <cfoutput>
    SESSION.cfcEmployee.fname = #SESSION.cfcEmployee.fName#
    getFName() = #Trim(SESSION.cfcEmployee.getFName())#
    getterVar = #getterVar#
    </cfoutput>

    This is the output in the html source code...

    SESSION.cfcEmployee.fname = Joe
    getFName() =
    Joe
    getterVar = Joe


    When I try to output the value directory w/my cfc 'getFName()' method, I
    cannot get rid of the whitespace. I've tried using trim() to no avail. Any
    thoughts?

    BSterner Guest

  2. Similar Questions and Discussions

    1. Yahoo! Getter
      Hi All, Let's say I want to write a script that: 1) Signs on to Yahoo! Mail for me. 2) Hits the 'Forward' button for each of my messages....
    2. Reply to the list WAS Yahoo! Getter
      Jerry Rocteur wrote: The list manager is right, and you should reply to the list :~). Do a "Group" reply or a "Reply to All" from your mail...
    3. [PHP-DEV] Property setter and getter in PHP5
      Hi, On Sun, 20 Jul 2003, Masoud wrote: You can use C# for that ;) No really, I think the PHP 5 syntax is okay here, PHP is just not C#. ...
    4. [PHP-DEV] Property setter and getter in PHP5
      Hi John I knew __get and __set available, but i want to told C# like syntax is a nice and clear syntax if available in php5 , so we dont need to...
    5. [PHP-DEV] Property setter and getter in PHP5
      Hi Masoud, It's already available. See http://www.phppatterns.com/index.php/article/articleview/28/1/2/ "Masoud" <masoud@iranphp.net> wrote...
  3. #2

    Default Re: CFC getter and whitespace


    [url]http://awads.net/wp/2005/06/15/coldfusion-and-white-space/[/url]

    Eddie Guest

  4. #3

    Default Re: CFC getter and whitespace

    You may have a carriage return in your string or other wierd characters,
    which would not go away using the trim function. Maybe you can use a regular
    expression to replace any non-alpha character with an empty string.


    "BSterner" <webforumsuser@macromedia.com> wrote in message
    news:dajodk$mgi$1@forums.macromedia.com...
    > Wondering if this is a bug. Using the following code.
    >
    > <cfapplication name="test" sessionmanagement="yes">
    > <cflock timeout="20" type="exclusive" scope="session">
    > <cfscript>
    > SESSION.cfcEmployee = createObject("component", "Employee");
    > SESSION.cfcEmployee.setFName("Joe");
    > getterVar = SESSION.cfcEmployee.getFName();
    > </cfscript>
    > </cflock>
    > <cfoutput>
    > SESSION.cfcEmployee.fname = #SESSION.cfcEmployee.fName#
    > getFName() = #Trim(SESSION.cfcEmployee.getFName())#
    > getterVar = #getterVar#
    > </cfoutput>
    >
    > This is the output in the html source code...
    >
    > SESSION.cfcEmployee.fname = Joe
    > getFName() =
    > Joe
    > getterVar = Joe
    >
    >
    > When I try to output the value directory w/my cfc 'getFName()' method, I
    > cannot get rid of the whitespace. I've tried using trim() to no avail.
    Any
    > thoughts?
    >

    Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139