Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
smokin_joe #1
Ben Forta - Where are you?...How to Count items in aSession Variable
Borrowing off of the Shopping Cart program in Ben Forta's book CF 4.0.... I am
using session variables to create a list of entities that will print to mailing
labels. After playing with spacing and such I finally have the first column of
lables printing.
There are ten labels for each of 3 columns. When session basket count reaches
11 records I want to start printing in the next column.
I was considering using the "Session.Basket" as a counter, so that when the
record count of items in the session basket reaches 11 and then 21 I would
move the print to a different portion of the table to print the output.
When I do a CFDUMP is can see the contents of the session basket, and there
seems to be a row count for each of the records. Is there a way of accessing
that counter to do any sort of calculations?
Or, can anyone have any suggestions as to how to do this?
Thanks
smokin_joe Guest
-
Reference Items in a Session Variable
I am attempting to reference specific items in a session variable. I can access the "Session.Basket.CurrentRow" of any particular ROW , e.g. (... -
Items.Count wrong on partial page
Hi, here's an odd one that blows my mind. I have a DataGrid with paging enabled. I have PageSize=10. I have 25 total items, so that gives me two... -
PageCount too high for Items.Count
I have a datagrid control that is working fine as I update, with what I assume are correct page counts (pre-filtered, there are probably 100 pages... -
Handler error in items.count
Hi I don't know if I've been looking at this project too long, but I've strangly acquired a for the code below; -------------- on MouseUp... -
How do I count blocks of characters in a string variable?
I'm trying to create a code to count a certain character in a string, lets say that I want to know how many letters "o" there are in the text "The... -
mpwoodward *TMM* #2
Re: Ben Forta - Where are you?...How to Count items in a Session Variable
On 2005-06-09 09:30:48 -0500, "smokin_joe" <webforumsuser@macromedia.com> said:
What kind of data is Session.Basket--is it an array, struct, or something else?> Borrowing off of the Shopping Cart program in Ben Forta's book CF
> 4.0.... I am using session variables to create a list of entities that
> will print to mailing labels. After playing with spacing and such I
> finally have the first column of lables printing.
> There are ten labels for each of 3 columns. When session basket count
> reaches 11 records I want to start printing in the next column.
>
> I was considering using the "Session.Basket" as a counter, so that
> when the record count of items in the session basket reaches 11 and
> then 21 I would move the print to a different portion of the table to
> print the output.
>
> When I do a CFDUMP is can see the contents of the session basket, and
> there seems to be a row count for each of the records. Is there a way
> of accessing that counter to do any sort of calculations?
>
> Or, can anyone have any suggestions as to how to do this?
>
> Thanks
--
Matt Woodward
[email]mpwoodward@gmail.com[/email]
Team Macromedia - ColdFusion
mpwoodward *TMM* Guest
-
smokin_joe #3
Re: Ben Forta - Where are you?...How to Count items in aSession Variable
The session is set up in the "custom tag" page as <cfset session.basket =
queryNew("ProductID, CustomerID, SHLastName, SHFirstName, Prefix, BuildingNo,
StreetName, Suffix, Apt, SHCity, SHState, SHPostalCode")>"
While playing with different scenarios.... I have been able to retrieve the
number of records that have been written to the session variable by
outputting.... "session.basket.recordcount"... NOW the question becomes.... How
can I reference a particular record in the session.... any suggestions....
session.basket.recordID - - doesn't work ?
Thanks !!
smokin_joe Guest
-
mpwoodward *TMM* #4
Re: Ben Forta - Where are you?...How to Count items in a Session Variable
On 2005-06-09 13:28:41 -0500, "smokin_joe" <webforumsuser@macromedia.com> said:
From what you post here session.basket is a query, so you would> The session is set up in the "custom tag" page as <cfset session.basket
> = queryNew("ProductID, CustomerID, SHLastName, SHFirstName, Prefix,
> BuildingNo, StreetName, Suffix, Apt, SHCity, SHState, SHPostalCode")>"
>
> While playing with different scenarios.... I have been able to
> retrieve the number of records that have been written to the session
> variable by outputting.... "session.basket.recordcount"... NOW the
> question becomes.... How can I reference a particular record in the
> session.... any suggestions.... session.basket.recordID - - doesn't
> work ?
>
> Thanks !!
reference the items as you would any CF query object. Here's a couple
of links that should help:
[url]http://tinyurl.com/3w82w[/url]
(note the "attributes" like RecordCount, etc.)
[url]http://tinyurl.com/bou9q[/url]
(check out the Dot Notation, Index Notation, and Mixing Notation sections)
To get a count of items, if I'm understanding what you're saying it
would just be Session.Basket.RecordCount. That second link will give
you a lot of info about how to access specific query records.
Hope that helps,
Matt
--
Matt Woodward
[email]mpwoodward@gmail.com[/email]
Team Macromedia - ColdFusion
mpwoodward *TMM* Guest
-
mpwoodward *TMM* #5
Re: Ben Forta - Where are you?...How to Count items in a Session Variable
On 2005-06-09 13:44:15 -0500, mpwoodward *TMM* <mpwoodward@gmail.com> said:
Sorry, that first link doesn't take you right to the cfquery discussion:> On 2005-06-09 13:28:41 -0500, "smokin_joe" <webforumsuser@macromedia.com> said:
>>>> The session is set up in the "custom tag" page as <cfset session.basket
>> = queryNew("ProductID, CustomerID, SHLastName, SHFirstName, Prefix,
>> BuildingNo, StreetName, Suffix, Apt, SHCity, SHState, SHPostalCode")>"
>>
>> While playing with different scenarios.... I have been able to
>> retrieve the number of records that have been written to the session
>> variable by outputting.... "session.basket.recordcount"... NOW the
>> question becomes.... How can I reference a particular record in the
>> session.... any suggestions.... session.basket.recordID - - doesn't
>> work ?
>>
>> Thanks !!
> From what you post here session.basket is a query, so you would
> reference the items as you would any CF query object. Here's a couple
> of links that should help:
>
> [url]http://tinyurl.com/3w82w[/url]
> (note the "attributes" like RecordCount, etc.)
[url]http://tinyurl.com/crus3[/url]
Matt
--
Matt Woodward
[email]mpwoodward@gmail.com[/email]
Team Macromedia - ColdFusion
mpwoodward *TMM* Guest



Reply With Quote

