WORepetition and two arrays...
WORepetition and two arrays...
- Subject: WORepetition and two arrays...
- From: Alexandra <email@hidden>
- Date: Thu, 3 Jun 2004 16:04:37 +0200
Hi!
I have been struggling with a problem for a while now and just have to
ask if somebody have some ideas how to solve this.
I have a page in my CMS that the user will use to edit the content
(mixed text and pictures) on a page) and that page has a form whose
WOElements (number of items and type) is created from a template object
using a WOSwitchComponent.
The bindings for the WORepetition looks like this;
Repetition1: WORepetition {
item = editElementItem;
list = editTemplate.templateToElementType;
}
Where editTemplate.templateToElementType is an array containing the
WOElements in terms of a string that is bound to the WOSwitchComponent
below.
The bindings for the WOSwitchComponent (that sits in the WORepetition)
looks like this now:
SwitchComponent2: WOSwitchComponent {
WOComponentName = editElementItem.elementTypeDesc;
filePath = pageContent.dataPath;
mimeType = pageContent.dataMimeType;
data = pageContent.dataContent;
value = pageContent.dataText;
cols = editElementItem.elementCols;
rows = editElementItem.elementRows;
}
What I want to do (which might be all wrong) is to create x number of
content-objects based on the number of objects in
editTemplate.templateToElementType and bind them to the appropriate
object in the iteration.
Is the best way to create and array based on the number of objects in
the template or can I bind everything together in some other smart way
using some other kind of bindings where two arrays can be combined this
way,
Obviously my current binding for the WOSwitchComponent is wrong since
only the text in the last WOTextField is saved to the database.
Regards,
Alexandra Milton
Stockholm, Sweden
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.