RE: Re: Subforms, Eh? Part I of III
"Michael Cortez" <[email protected]> Wed, 6 Apr 2005 18:02:26 -0700
| Newsgroups | gmane.comp.cms.xaraya.knowledge-base |
|---|---|
| Message-ID | <[email protected]> |
>> Thanks for that - sometimes I have the impression you're reading my
>> mind...
LoL! I've stated to others, we seem to think alike -- so I'm able to figure
out what your doing (eventually) when others have already fled for the
hills.
>> Guess I always thought you were my evil twin - or does this
>> mean I'm your evil twin instead ? :-)
Well... I _know_ you're the evil scientist {it wouldn't have occurred to me
to do a subforms property}
;)
I'm just the guy that picks up the toys you build, and figures out how to
actually use them on a site (in new, interesting and sometime twisted
ways!!!)
>> About list of children, thanks for picking it up and running with it.
>> Just in case you missed that part in my mind, I had the idea of
>> supporting different formats there : a simple view of existing
>> children (possibly with edit/delete/new links like subitems, but
>> basically as read-only), and one like now where you can update
>> or create items directly in the "parent" form.
>>
>> Reason is that in some cases, you may want to show only part of
>> the child items there, and/or you may not want to support creating
>> child items there, and/or it may not be possible to create a child
>> item at all there because you're not showing some field that's
>> mandatory on input, etc.
Right.
Now a question -- how will I go about theme'ing this sucker.
Lets say I just want to have two pubtypes, that use the same DD Object
(perhaps the DD Object is subscribers or something.) One of those pubtypes
will want add/edit/delete control. And the other is to only have "pick from
a list" support.
How do I get <xar:data-list /> to display using different templates? Can I
pass an overiding template into it via an attribute?
And a different, more difficult problem :
I'm also going to need help on the array of properties being displayed when
editting. For example, my code right now will NOT work for complex
datatypes like ComboBoxes and Uploads properties, because I had to manually
massage the data slightly using xarvarfetch() and putting it into arrays to
be passed to createItem() and updateItem().
The main problem is that when using <xar:data-list /> to display that table
of properties we end up with things like dd_123[0], dd_123[1], dd_123[2],
etc. The properties themselves don't know how to handle that, and even just
the simple ones like Text Box just grab dd_123 -- assume that it's a string,
and pass that along to the datastore for storage (which then blows up with
an Array to String conversion error.)
So I had to build some code that goes out and figures out the fact that
there is an array of them out there, and martial them into the properties in
a way that they could handle the data. The problem though, is that I only
check for the main dd_123 variable, and not any secondary variables that the
property may have -- for example, the combo box property puts two separate
input fields out there (a dropdown and a text box.)
--
Mike C.