Can you please post an example?

Basically, I don't think that post-deleting the objects is good idea.

I do such dynamic stuff using input name prefixes.
Numeric part simply generated by JavaScript.

For example:
input_name_1
input_name_2
...

Each your level can have own prefix, numeric part also should contain
in some form parent number.
For example:
For example:
input_name_1
    input_name_1_1
    input_name_1_2
...

On server side I know the constraints: starting position and max
depth.
It means that I know the possible numeric parts, so I can do the plain
loop (or few loops) with checking the form structure matches.

for (i=1; ...) {

   tmpKey = "input_name_" & i;

    if (StructKeyExists(form, tmpKey)) {
        // verify and process data
        // maybe dive into the inner loop
    }

}

Only when I can see valid name, I do something objects manipulations.

Hope this helps.

-sg


On 29 Грд, 16:22, Jonathan <[email protected]> wrote:
> I have an object that composition goes 3 deep.  I have an HTML form
> that represents that object.  The form is dynamic via JQuery with add-
> a-row (add-an-object) button click events and add-a-row's within add-a-
> row's (3 deep).
>
> I have finished building and testing the form, but now it's time to
> post to the ColdBox backend.  In the form post I am sending the number
> of rows for each nested object so that I know how to loop over the
> form fields.
>
> The parent object is easy enough to handle, but I'm not sure the best
> way to handle the composition.  A user can potentially remove an
> object from the composition via the UI.  They can also add new objects
> or update existing (of course.)
>
> My knee jerk method of handling this is to loop through what's posted
> - creating new, updating old, and then loop through the transfer
> object deleting the composition which does not appear in the form
> post.  Is this good practice?  Can someone suggest better or best
> practice?
>
> Thanks!
> Jonathan

-- 
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer

You received this message because you are subscribed to the Google Groups 
"transfer-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/transfer-dev?hl=en

Reply via email to