shouldnt this:
<cf_data_list query="myQuery">
<cf_column
headerText="Name"><cfoutput>#myQuery.name#</cfoutput></cf_column>
<cf_column
headerText="Date"><cfoutput>#myQuery.date#</cfoutput></cf_column>
</cf_data_list>
be this:
<cf_data_list query="myQuery">
<cf_column
headerText="Name" columnName="name"></cf_column>
<cf_column
headerText="Date" columnName="date"></cf_column>
</cf_data_list>
and therefore all the need for iteration/notation knowledge is taken away
from the user?
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Murat Demirci
Sent: 23 February 2005 15:53
To: [email protected]
Subject: RE: Re[2]: [CFCDev] query object (was: Using application.cfc to
modify the request stream)
Yes I know the solutions, and they are easy. However they could be easier.
If I want to develop a custom tag to iterate a query object I should *first
think the code* instead of just typing. What should I think:
- First think a solution for iteration
- Hmm, users of my custom tag have to use array notation
- I need to document this: "don't use myQuery.myField notation, use array
notation"
- I should provide a variable to use with array notation: <cf_data_list
query="" rowVariable="" />
- And I and users shouldn't forget thread issues in CFCs, users should
remember to define their function local row variable while using this custom
tag in functions.
Maybe this is a little boring and unimportant topic, but all of them for
more easier solutions.
Murat.
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of CF
> Sent: Wednesday, February 23, 2005 5:06 PM
> To: Murat Demirci
> Subject: Re[2]: [CFCDev] query object (was: Using
> application.cfc to modify the request stream)
>
> Hello Murat,
>
> > previous() and other methods for query objects, for example
> query.currentRow
> > could be writeable:
>
> > <cfquery name="myQuery" ..>
> > Select ...
> > </cfquery>
>
> > <cfset myQuery.currentRow = 2 />
> > <cfoutput>#myQuery.field1#</cfoutput>
>
> > However CF doesn't allow this currently (it doesn't work as
> expected).
>
> CurrentRow is just available inside a query loop and represents the
> number of the current row. It's not like a pointer you can use to
> address a certain row like in other languages. And there is no need
> for it to be. Actually, IMHO currentrow works just as expected.
>
> If you want to address a specific rows of a result set, you can use
> array notation:
>
> <cfset myRow=2>
> <cfoutput>#myQuery.field1[myRow]#</cfoutput>
>
> Since CF MX you can even addresse the field with array notation:
> <cfoutput>#myQuery[field1][myRow]#</cfoutput>
>
> HTH
>
> Chris
>
>
>
>
> ----------------------------------------------------------
> 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]
>
>
>
----------------------------------------------------------
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]
----------------------------------------------------------
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]