Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
OnAdd question (Read 1067 times)
Michael Webster
Full Member
*
Offline



Posts: 8

OnAdd question
Jan 04th, 2016, 4:27pm
 
Sorry in advance that I'm probably missing something jaw droppingly obvious...

I'm reading The Tinderbox Way and in the list section find the following recommendation for setting actions that occur when a note is dropped into a container:

OnAdd: $Completed=true; $Status="complete";$CompletionTime=
date(”today”);$Color=;

When I do that OnAdd, I made it so it turns the color of the box red, and that works; but I cannot find "Completed", "Status" or "CompletionTime" anywhere. How am I supposed to add them to the note, or prototype? Are they user defined attributes?
Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: OnAdd question
Reply #1 - Jan 4th, 2016, 5:30pm
 
This is simply an example.  In this case, Tinderbox Way assumes you have already created three user attributes (in the Document inspector’s User pane)

    $Completed: a boolean attribute
    $Status: a string attribute
    $CompletionDate: a date attribute

Getting Started With Tinderbox has more detailed walkthroughs of the mechanics of creating and using attributes; here, The Tinderbox Way is focussing on the sorts of things one might do with attributes.
Back to top
 
 
WWW   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: OnAdd question
Reply #2 - Jan 4th, 2016, 5:42pm
 
My copy of the book's the first edition but i'm guessing you're referring to page #39 in Chapter #3 ("List and Cntainers"). My version has different, but similar code there. Those latter three attributes are indeed user-added attributes as they aren't system attributes; it's worth noting that the book isn't written as a step-by-step tutorial.

From the values being assigned, I'm assuming $Completed will be Boolean data type, $Status is a String type $CompletedTime will be Date-type.

Althuogh you can add those attribute named to your OnAdd code, they will have no effect unless the names attribute(s) actually exist.

Add user attributes via the User sub-tab of the Document Inpsecctor.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Michael Webster
Full Member
*
Offline



Posts: 8

Re: OnAdd question
Reply #3 - Jan 4th, 2016, 8:44pm
 
Thanks. Sorry, I should have read further before posting. Just a little excited to get going.
Back to top
 
 
  IP Logged
Pages: 1
Send Topic Print