1 Reply Latest reply on Jun 5, 2007 10:37 AM by insuractive

    forms / multiple browsers problem

      Hello all,

      I'll try to explain my problem,

      I have an application that uses cfc's as objects, the object knows if it is a new entry or not depending on the primary key
      that is empty (= new one) or is not empty (= exists in the database)
      So far so good, so, if i want to edit a record, the object is loaded with the data of that record with get and set methods

      But, if i use multiple forms it goes wrong, meaning i can cross post...

      Problem: I open a browser window and click to make a new record (= new empty object A)
      I open an existing record in a NEW browser window to get some data from it ( to copy paste )
      (= the cfc object A is loaded into the memory )
      Then i copy paste some data to my first form and submit it, here it goes wrong,
      because the application has the "existing edited record' still in memory it overwrites it

      Any idea's how to prevent cross browser postings?



        • 1. Re: forms / multiple browsers problem
          insuractive Level 3
          Sounds like you have a problem with your application structure. If you store your objects a session variables with the same name, it won't matter how many windows you open - you will be referencing the same object every time. I can think of 2 different possible solutions for this off the top of my head -

          1) Name your objects differently in the session scope - that way you won't have a collision like this. Of course, you probably want to clear the objects out of memory when you are done with them, otherwise you could be looking at a lot of overhead

          2) A better solution would be to come up with a method of serializing your objects (WDDX, JSON, etc) for passing data between form posts. That way, it would not matter how many windows you opened - your original object's information can be passed via 1 hidden field and then processed on your action page.