javascript - How do you deal with saving an attribute related to an object not yet created, via AJAX? -


I have an object that has not yet been created (hence its no id), but in the user process To make it one of the fields to fill fields, they create an attribute for this object, but that attribute requires an object's ID.

This is the point where - the object is not actually created yet (in the process of filling fields to make the user), it does not have an ID when you are editing the object and In this way the object has an ID, so there is no problem creating the property.

Here are the relationships:

  object (name, id) ^ ATTRIBUTE (name, object_id, id)  

How do you deal with the situation? I was thinking of adding an "temporary" field to the object so that he could get an ID from the bat, but surely there could be a better way?

itemproc = "text">

Good question, in fact you have two options:

  • Creating a client-side form status To be able to handle conservation, modify the "ATTRIBUTE" creation code.
  • Use the "floating" field, and regularly clean them with ongoing work.

The latter is easy to implement, but you are_temporary = ' Everywhere you use objects everywhere, and even when people stop, your id sequences are useless.

The option depends on the difficulty of the ATTRIBUTE creation code. If the object is not created (without the id), then select the latter option. Otherwise, choose pre.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -