Forums / Setup & design / Object relations and selectboxes

Object relations and selectboxes

Author Message

Vivienne van Velzen

Wednesday 14 May 2003 12:56:12 am

I've created a couple of 'codetable folders' in which I keep the descriptions that appear in (single or multiple) selectboxes in my employee-form (codetable examples are function and location). When selecting an option from these selectboxes, an object relation is created between the employee and the entry in the codetable folder. So far so good.
Except that removing a established relation object doesn't work (on changing selection or deselecting).

I've tried it in a couple of different ways.
1. Place a DeleteRelationIDArray[] multipleselect in an invisible div (options are the same as in the SelectedObjectIDArray[]) and select those options that have been deselected in the SelectedObjectIDArray[]. Then when the form is submitted, this array (and the DeleteRelationButton field) is submitted along with it.
2. Place the above fields in a form in an iframe. On submit of the parent window loop through the items in the SelectedObjectIDArray[] and when not selected, pass them to the form in the iframe and submit this form.

Both methods won't work. Things I can think of that I'm doing wrong are:
1. I'm missing a formfield needed for object relation removal.
2. You can't do removal and adding in the same form (hence the solution with an iframe).
3. In the iframe solution, I'm submitting the iframe form with the wrong action (because this is sort of an included file, I don't have a node-id or something like that. I'm linking straight to the file itself).

Can anybody help me with this one?
TIA,

Vivienne