Forums Window

SetContent "is not a function" problem

Subscribe to SetContent "is not a function" problem 4 post(s), 2 voice(s)

 
Avatar SkaveRat 7 post(s)

When I try to do this in RoR/RJS:
page << “new UI.Window({theme: \”vista\”, id: \”message_window\”}).show();”
page[:message_window].set_content “test”

I get:
TypeError: $(“message_window”).setContent is not a function

oh, and is there a RJS way of “new UI.Window()”?

 
Avatar SkaveRat 7 post(s)

ok, found out, I have to do “getWindow” before I can do actions on a window (kinda obvious, but lacks documentation, somehow…)

 
Avatar SkaveRat 7 post(s)

okay, another problem:
to clean up the “UI.defaultWM.getWindow()”-mess, I created an helper:
def grab_window(window_id)
self.UI.defaultWM().get_window(window_id)
end

but when I use
page.grab_window(“message_window”)
in the RJS file, rails automaticly converts “UI.defaultWM.getWindow()” into “UI.defaultWM().getWindow()” – which is wrong, because defaultWM is not a function. the only problem is the added “()” by rails. is there a way to prevent it from happening? or a workaround?

€dit: okay, after searching a bit it seems there is no way to prevent rails to convert this

 
Avatar Seb Administrator 133 post(s)

I dont think it’s possible just do page << your_code

Forums Window