Thanks, for the quick reply -
I actually read your article earlier on thanks.
Hmm, now lets see if I am getting this right.
When I write somthing in the RJS file the page object takes my DLD and
transforms it into javascript which is immediatley sent out to the
browser which then does the rendering it has been asked for.
I hope I got that bit right?
As it is possible to send snippits of javascript to the browser and ask
it to get me a value of a DOM back, then I ask by self why this request
cannot be handled by the javascript engine in rails.
The only logical explination to me is that asking the browser and
telling the browser are 2 completely different things.
So that would mean that the rails javascript engine has been written to
handle all the “tell stuff” - but it can’t handle the “ask stuff” i.e.
that engine is probably missing.
Could it be that the underlying problem is that the messaging
(responder, initiator sequence) is entirely differnt depending on what
is being done (asking or telling).
If all this is understandable and the answer is (yes this is how it
works) then I will be relieved to know.
Thanks a million
Jason
Frederick C. wrote:
On Oct 4, 6:27�am, Jason Franklin-stokes <rails-mailing-l…@andreas-
s.net> wrote:
Was this issue ever resolved? if so I would love to know how!!
Jason.
At the time the RJS runs you cannot find the value of an element: the
rjs is running on the server, but the info is on the client’s page.
So for example,
if page[:something].empty?
…
or anything like that is impossible.
You can however generate javascript that will check a certain
condition, for example
page << “if($F(‘foo’) == ‘bar’){”
page[:baz].hide()
page << “}”
I waffled about this at some length here:
Conditional RJS explained - Space Vatican
Fred