i was using multple wtkx file without an ID on the include element. When I
tried adding an ID attribute in the include element, I was getting an error
(forgot what it was)
But each panel had a unique ID (person_panel, company_panel, etc.) inside
their own wtxk file.
Bob
----- Original Message -----
From: "Greg Brown" <[email protected]>
To: <[email protected]>
Sent: Friday, March 05, 2010 5:49 PM
Subject: Re: events and wtkx:id's
I just had a thought. Do you use multiple <wtkx:include> elements in your
WTKX that contains the accordion? For example, do you have an include for
each panel? If so, do those includes define their own IDs? Finally, do you
assign IDs to the includes themselves? e.g.
<wtkx:include wtkx:id="foo" src="foo.wtkx"/>
Defining an ID for an include creates a separate namespace for that
include. Currently, if you don't define an ID for an include, it inherits
the namespace of the parent WTKX. This could create naming collisions and
may be the cause of some of your confusion. It also isn't very intuitive.
It might be more appropriate to define an "inline" attribute for the
<wtkx:include> element. If true, the include would inherit the parent's
namespace; otherwise, it would define its own. Does this make sense?
On Mar 5, 2010, at 5:09 PM, Greg Brown wrote:
Duplicate Id's are pretty helpful though. Are you supposed to be able
to add multiple instances of a wtkx file?
Sorry, I should have been more clear. Duplicate IDs aren't really
supported in a single WTKX file. However, you can duplicate them across
WTKX files, or within multiple instances of the same WTKX file.
Basically, the WTKX file defines a scope within which the IDs should be
unique.
It is analogous to defining multiple member variables with the same name
in a Java class. That's not allowed, but you can still have multiple
instances of that class, each of which has its own set of member
variables.
If I wanted to add multple accordion panels that share a generic
interface, what would be the best way to do that?
For each panel, I'd create a custom class that implements that interface.
Then I would create a separate WTKX file for each panel, using your
custom classes as the root element of your WTKX files. Then
<wtkx:include> the files into the Accordion.
G