Cynthia,
Alteration of Spectra code is allowed, but do it with caution. Realize that
any changes in cfa_button.cfm will be changes EVERYWHERE that tag is used,
including the Webtop. You will also have to make sure you have a record of
the changes for when you upgrade to new versions of Spectra because the tags
will be overwritten. One way to avoid this is to just copy the code from
cfa_button.cfm into the custom tags directory, make your changes, and call
it using cf_button (or some other name) instead.
To answer the question about the structures, try this code:
<cfscript>
stFirst = structNew();
stSecond = structNew();
stFirst.A = "a";
stFirst.B = "b";
stFirst.C = "c";
stFirst.D = "d";
stFirst.E = "e";
stSecond.A = "aa";
stSecond.B = "bb";
stSecond.C = "cc";
</cfscript>
Dump of stFirst:
<cfa_dump var="#stFirst#">
Dump of stSecond:
<cfa_dump var="#stSecond#">
<cfloop collection="#stSecond#" item="key">
<cfset stFirst[key] = stSecond[key]>
</cfloop>
Dump of new stFirst:
<cfa_dump var="#stFirst#">
Hope this helps!
Jason
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 09, 2000 8:11 PM
To: [EMAIL PROTECTED]
Subject: Help! Structs, properties therein... =)
Hello...
I have 2 structures. Struct X is a superset of struct Y.
Say Struct X has properties: A, B, C, D, E. Struct Y has properties that
are a unknown subset of Struct X, eg, A, B, C.
If struct X has data: A = 1, B = 2, C = 3, D = 4, E = 5.
If struct Y has data: A = 7, B = 8, C = 9.
The resultant struct I want has values: A = 7, B = 8, C = 9, D = 4, E = 5.
Struct Y can have properties that are any subset of struct X.
What is the cleanest way to do this?
The reason for this is for the use of cfa_button. We would like to alter
the default colour from grey to green.
When a customised stNormalStyle is defined, the validation code in
cfa_button.cfm uses this struct instead of its default stNormalStyle. In
doing so, all unspecified properties (from the customised stNormalStyle) is
unset. All the default values for these are lost. This is the case for
all style structures within this tag.
If there's to be no alteration to spectra code, the only way seems to be
making the developers specify values for all properties, even when default
values are desired. On an even uglier note, the developer would have to do
the width calculation of the button using len("the button label") as well.
The effort expended in cfa_button.cfm for this calculation is totally
wasted. I don't think this was intended. (Granted, I might be wrong.
*grin*)
If alteration to spectra code is allowed, my question at the beginning of
the mail comes into play. Equating struct X as the default stNormalStyle
defined within cfa_button.cfm and struct Y is the customised version. This
is so the developers would only need to specify properties that they want
to customise and be able to leverage the code that's within cfa_button.cfm.
Is there another solution? Please help.
With thanks,
Cynthia. =)
----------------------------------------------------------------------------
--
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/spectra_talk
or send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body.
------------------------------------------------------------------------------
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/spectra_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.