yeah thanks Dave...
thats exactly a method of operation I was wanting...

sal

Jared Rypka-Hauer wrote:
That's slick!

I've blogged it here... very handy, thanks Dave.

http://www.web-relevant.com/blogs/cfobjective/index.cfm?mode=entry&entry=F98F11D8-BDB9-5320-EF4EBF85EC2BAD6E

J

On Thu, 10 Aug 2006 14:31:09 -0500
 "Dave Shuck" <[EMAIL PROTECTED]> wrote:
  
João, you can see in the core files that it is used that
way.  However, a
nice side effect is that it is an easy way to check to
see if a record has
been loaded.

~d


And yes... we give each other high fives on a daily basis
around here about
Reactor.

On 8/10/06, João Fernandes
<[EMAIL PROTECTED]> wrote:
    
I think isDirty is to check if the currentTo inside the
      
record has been
    
changed since loaded without beeing commited to the DB.

Reactor keeps amazing me !

João Fernandes

On 8/10/06, Dave Shuck <[EMAIL PROTECTED]> wrote:

      
LOL  on re-read or your message, I guess you and I
        
are both right! :)
    
On 8/10/06, Dave Shuck < [EMAIL PROTECTED]> wrote:
      
Aaron I think that might be backwards, but to be
        
honest I have to try it
    
every time.

I *think* (NOT object.isDirty()) means it did load,
        
but try it yourself
    
and it won't take long to figure out!

~Dave


On 8/10/06, Aaron Lynch <[EMAIL PROTECTED] >
        
wrote:
    
SAL VALVERDE wrote:
          
any docs on the isDirty() method?
or explaination...?

sal

Dave Shuck wrote:
            
Rather than checking lengths or types of data,
              
we use the isDirty()
    
method.

~Dave

On 8/10/06, *Doug Sims* < [EMAIL PROTECTED]
<mailto: [EMAIL PROTECTED]>> wrote:

    Just curious and wanted feedback/drawbacks
              
from the group on
    
this
          
    approach:
    <cfif User.getUserId()>
    rather than this:
    <cfif len(User.getUserId()) and
              
User.getUserId()>
    

    Thanks,
    Doug S.
    www.evenamonkey.com
              
<http://www.evenamonkey.com>
    

    On 8/10/06, SAL VALVERDE <
              
[EMAIL PROTECTED]
    
    <mailto:[EMAIL PROTECTED]>> wrote:
    >
    >  hey thanks Jared...
    >  and for the quick response too...
    >
    >
    >  sal
    >
    >
    >
    >  Jared Rypka-Hauer wrote:
    >  <cfif len(obj.getUserId ())> is usually
              
how people do it,
    
    > but that can be frustrating if it returns
              
0, which means it
    
    > hasn't been loaded too.
    >
    > <cfif len(User.getUserId ()) and
              
User.getUserId()> will
    
    > cover you if your userId is 0 (which means
              
nothing's been
    
    > loaded because 0 isn't a valid pkey value
              
in most cases).
    
    >
    > Laterz,
    > J
    >
    > On Thu, 10 Aug 2006 11:24:15 -0600
    >  SAL VALVERDE < [EMAIL PROTECTED]
    <mailto: [EMAIL PROTECTED]>> wrote:
    >
    >
    >  Hello all,
    > I have a quick simple question that I hope
              
someone can
    
    > enlighten me with...
    > What would be best practice to see if a
              
record object has
    
    > been loaded or not? my current script is
              
as follows:
    
    >
    > <cfif len(userRecord)>
    >  <cfset
    >
              
arguments.event.setValue("badLogin","Invalid Username
    
    > or Password") />
    >  <cfset
    > arguments.event.addResult("notLoggedIn")
              
/>
    
    >  <cfelse>
    >  <cfset session.isLoggedIn = true />
    >  <cfset session.username =
    > #userRecord.getuserName()# />
    >  <cfset
              
arguments.event.addResult("loggedIn")
    
    > />
    >  </cfif>
    >
    > "userRecord" being the object...
    >
    >
    > I'm getting the following error:
    >
    > Complex object types cannot be converted
              
to simple
    
    > values.
    > *Detail* The _expression_ has requested a
              
variable or an
    
    > intermediate _expression_ result as a simple
              
value,
    
    > however, the result cannot be converted to
              
a simple
    
    > value. Simple values are strings, numbers,
              
boolean
    
    > values, and date/time values. Queries,
              
arrays, and COM
    
    > objects are examples of complex values.
    >
    > The most likely cause of the error is that
              
you are trying
    
    > to use a complex value as a simple one.
              
For example, you
    
    > might be trying to use a query variable in
              
a <CFIF> tag.
    
    > This was possible in ColdFusion 2.0 but
              
creates an error
    
    > in later versions.
    >
    >
    > thanks in advance...
    > sal
    >
    >
    > -- -- -- -- -- -- -- -- -- -- -- -- -- --
              
-- -- -- -- --
    
    > -- -- -- -- -- -- -- --
    > Reactor for ColdFusion Mailing List
    > [email protected] <mailto:
              
[email protected]>
    
    > Archives at:
    >
              
http://www.mail-archive.com/reactor%40doughughes.net/
    
    > -- -- -- -- -- -- -- -- -- -- -- -- -- --
              
-- -- -- -- --
    
    > -- -- -- -- -- -- -- --
    >
    >
    >
    > -- -- -- -- -- -- -- -- -- -- -- -- -- --
              
-- -- -- -- -- --
    
--
          
    -- -- -- --
    > -- --
    > Reactor for ColdFusion Mailing List
    > [email protected]
              
<mailto:[email protected] >
    
    > Archives at:
    >
              
http://www.mail-archive.com/reactor%40doughughes.net/
    
    > -- -- -- -- -- -- -- -- -- -- -- -- -- --
              
-- -- -- -- -- --
    
--
          
    -- -- -- --
    > -- --
    >
    >
    >
    >
    >
    >
    > -- -- -- -- -- -- -- -- -- -- -- -- -- --
              
-- -- -- -- -- --
    
--
          
    -- -- -- --
    > -- --
    >
    > Reactor for ColdFusion Mailing List
    > [email protected]
              
<mailto:[email protected]>
    
    > Archives at:
    >
              
http://www.mail-archive.com/reactor%40doughughes.net/
    
    > -- -- -- -- -- -- -- -- -- -- -- -- -- --
              
-- -- -- -- -- --
    
--
          
    -- -- -- --
    > -- --


    -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
              
-- -- -- -- -- --
    
--
          
    -- -- -- -- --
    Reactor for ColdFusion Mailing List
    [email protected]
              
<mailto:[email protected] >
    
    Archives at:

              
    http://www.mail-archive.com/reactor%40doughughes.net/
    
    <
              
http://www.mail-archive.com/reactor%40doughughes.net/>
    
    -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
              
-- -- -- -- -- --
    
--
          
    -- -- -- -- --




--
~Dave Shuck
[EMAIL PROTECTED] <mailto: [EMAIL PROTECTED]>
www.daveshuck.com <http://www.daveshuck.com>
www.worldwildweb.biz
              
<http://www.worldwildweb.biz >
    
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
              
-- -- -- -- -- --
    
--
          
-- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at:
              
http://www.mail-archive.com/reactor%40doughughes.net/
    
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
              
-- -- -- -- -- --
    
--
          
-- -- -- --
              
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
            
-- -- -- -- -- -- --
    
-- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at:
            
http://www.mail-archive.com/reactor%40doughughes.net/
    
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
            
-- -- -- -- -- -- --
    
-- -- -- --
            
The way I understand it is, you can do something
          
like...
    
//try to load a user
User.load(UserId = something);

if (User.isDirty()){
    //you have a new User record on your hands
}
else {
    //User is NOT isDirty() so you have an existing
          
User on your hands
    
}

Aaron


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
          
-- -- -- -- -- --
    
-- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at:
          
http://www.mail-archive.com/reactor%40doughughes.net/
    
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
          
-- -- -- -- -- --
    
-- -- -- --


          
--
~Dave Shuck
[EMAIL PROTECTED]
www.daveshuck.com
www.worldwildweb.biz

        

--
~Dave Shuck
[EMAIL PROTECTED]
www.daveshuck.com
www.worldwildweb.biz
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
      
-- -- -- -- -- -- --
    
-- --

Reactor for ColdFusion Mailing List
[email protected]
Archives at:
      
http://www.mail-archive.com/reactor%40doughughes.net/
    
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
      
-- -- -- -- -- -- --
    
-- --


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
      
-- -- -- -- -- -- --
    
-- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at:
      
http://www.mail-archive.com/reactor%40doughughes.net/
    
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
      
-- -- -- -- -- -- --
    
-- --

      

-- 
~Dave Shuck
[EMAIL PROTECTED]
www.daveshuck.com
www.worldwildweb.biz


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at:
http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- --
    



-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --


  


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply via email to