I am trying to get a better setting working to update a model with nested properties.
Right now in my edit view, I define textFieldTag manually to create a params structure, setting the name as "myModel[myNestedProperty][#modelID#,#key2id#][name]"
in update action ...
if i just use myModel.update(params.myModel)i can't get the update to work if there are any items that need to be removed
so I destroy all models of the nested property that have the same identifier as myModel, in which case it works.
The disadvantage is that if the update fails, all the attached properties disappear.
I tried to capture all the models before deleting them and .savewith them, but for some reason this does not work.
It seems that cfwheel is configured for this relationship with checkboxes, but I need it to work with the text box and select the elements in my form.
Update
I realized that I have a different problem. Essentially, I would like to expand this to be able to use it for many nested properties and relationships.
the problem is how I customize the name specifically for selecting dropdown menus:
name="myModel[myNestedProperty][#modelID#, ][nestedID]"
the problem is that the second identifier cannot be declared, because it will be assigned as an identifier, and will not use the value that I select.
Honestly, this is the only problem that I struggled with all the time. I deal with this, regenerating models in the controller, I just forgot that I have not solved this problem yet.
Is there a way that I can not use these values at all and dynamically populate them from the structure?
, () tcat[34,0][catID] tcat[34,][catID] ( catID ID).
tcat params, ,
[34,0]{catID = 12,14,18}
[34,]{catID = 12,14,18}
, tcat params :
[34,12]{tID = 34; catID = 12}
[34,14]{tID = 34; catID = 14}
[34,18]{tID = 34; catID = 18}
?
, , . , - javascript, , (, ) .