Hello dear Fellows,
as I first found Mootools I immediately fell in love with the concept
it stands on. I come many from Java and C++ and I needed some good way
to bring JavaScript to software development. GWT was too big, so was
jquery...
However, I am working on a browser application that handles different
"items" that each has its properties. Those items are instances of a
Item class with instances create divs including images and stuff.
After being manipulated by the user the application finds all the
diffs and '.retrieves' the class instances that hold all the data to
be stored to a database via Ajax request.
So far it worked very fine.
Now, where i click on one of this divs, representing a item, it sets
its 'this' to a property div, where the user can set e.g. a url. To
instantly save all changes of the url a 'keyup' event want to set the
items url variabel.
The problem I have is, that the moment the item object (which listens
to the click event) calls the "setItem()" method of the property div
class it seems it instantiates a new property div instance, because
setting the current item to be viewed works, but the eventHandler on
the input element ('keyup') has the old (or no) instance of the item.
Here is a simplified test code that shows the problem:
http://pastebin.de/15429
I played the hole story using plane JavaScript to illustrate, what I
was up to and to demonstrate that it can work. But it dosen't with my
mootools version:
http://pastebin.de/15431
I really would appreciate some help here.
Thank you very much!