search for: update_element_function

Displaying 17 results from an estimated 17 matches for "update_element_function".

2005 Dec 07
3
update_element_function fail gracefully?
I am using the update_element_function to update the text in some elements. This works fine, however, if I try to update an element that is not on the page anymore, it fails silently and no further javascript statements will be executed within that same request.responseText. Is there a way to fail gracefully in this scenario and ignor...
2005 Dec 24
2
Ajax Help: Multiple Updates - ?
...gt; <div id="detail2"> </div> <br> <div id="detail3"> </div> <br> <div id="detail4"> </div> # controller def updateDivs render(:layout => false) end # updateDivs.rhtml <%= javascript_tag( update_element_function( "detail1", :position => :top, :content => "testData1" ) + update_element_function( "detail2", :position => :top, :content => "testData2" ) + update_element_function( "detail3", :position => :top, :content...
2006 Jun 14
3
problem trying to update multiple <DIV> elements with AJAX
...are the) relevant code snippets are as follows: Calling view: <%= form_remote_tag(:url => {:action => ''create_problem''}, :complete=>evaluate_remote_response) %> Controller action: @choices = get_prob_list_choices render(:layout=>false) Returning view: <% update_element_function("new_prob", :binding=>binding) do %> <%=render(:partial=>"new_prob")%> <%end%> <% update_element_function("prob_list", :binding=>binding) do %> <%=render(:partial=>"prob_list", :locals=>{:choices=>@choices})%&...
2006 Feb 01
0
Using draggable_element doesnt work with update_element_function
Hi everyone, I am writing a ruby on rails application, and making heavy use of AJAX calls and evaluate_remote_response. In my remote responses I often have several update_element_function calls going on, to update several divs on the page. What I am doing is calling update_element_function, with the content as a block. Inside the block I usually have html, or make calls to other partials or components. This all works great. The problem I am having seems to come when I try to make t...
2006 Feb 05
0
Using javascript with update_element_function
Hi, I am using evaluate_remote_response and update_element_function, to update elements with blocks of content, something like this: <% update_element_function("div_id", :binding => binding) do %> <div id="newdiv_id"> This is a new div! </div> <%= draggable_element(''newdiv_id'') %> <% end...
2006 May 24
0
Javascript as content parameter for update_element_function?
Is there any way to do this? The goal is to have the update_element_function update a div with alternating strings. Is there a better way to do this? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060524/a99b90de/attachment.html
2005 Dec 27
0
update_field question
...uot;, :url => { :action => "preview" }, :with => "''song_words_chords='' + escape(value)" %> then in my preview.rhtml, which is called by the preview action (which updates the contents of @song_words_chords, I have: <p><%= update_element_function("pre_preview", { :action => :empty }) %> <p><%= textilize(@song_words_chords) %></p> But instead of emptying the "pre_preview" div, update_element_function just displays the following on the page: $(''pre_preview'').innerHTML = '...
2006 Apr 12
22
Dynamic Select Box
Hi, I''m new to rails/ruby having come from PHP and am just starting to get my head round how easy it can be :) However, can anyone point me in the right direction for dynamicaly updating a select box based upon the choice of a previous select box, without a page refresh. Any and all help greatly appreciated. Thanks -- Posted via http://www.ruby-forum.com/.
2006 Apr 11
2
link_to_remote to update multiple components
...n languages and it has to update every component in my application (like, let''s say: the main screen, the top navigation bar and the search bar). Each component is created in a different DIV and whenever the language is switched, the entire application should reflect the change. Using update_element_function is pretty much out of the equation because I can''t specify a controller/action for content (instead of *ugh* just plain html). Same goes for using rjs. -- Posted via http://www.ruby-forum.com/.
2006 Jan 01
0
Using standard helper methods in my helpers
...''ve written some simple helper method. My method uses standard helper methods from Rails. When I try to use them from templates - everything is working, but when I try to execute from my helper I get an exception. Here is my code: module ApplicationHelper def reset_add_function r=update_element_function("add") { link_to_remote( "Nowy watek", :update => "add", :url => {:controller=>"add", :action => "add" } ) } end end The reset_add_function throw an exception: undefined local variable or method `_erbout'' for #&l...
2006 Feb 03
2
JavaScript Prototype Help?
...ue.length"}) %> And obviously I also have the form text area called "text_area" and a div called "count_display". My helper looks like this: def observe_field_length(field_id, options = {}) options[:content] = options[:with] || ''value'' callback = update_element_function("#{options[:update]}", options) javascript = "new Form.Element.Observer(''#{field_id}'', " javascript << "#{options[:frequency]}, " javascript << "function(element, value) {" javascript << "#{callback}}" javas...
2006 Feb 28
2
AJAX: do render but show element in same click?
.... Click that, the div goes away, everything''s great... except now I can''t get it back. How can I call the remote AND make the div show at the same time? I see element.show, but I don''t know how to execute that without having the user click on it. I looked at the API for update_element_function, but that looks like I can change the content of the div, or it''s position, but not hide/show it. Micah -- Posted via http://www.ruby-forum.com/.
2005 Aug 17
5
asynchronous Ajax.Updater
I had one point in my project where I needed a synchronous Ajax call; in other words, I wanted the Ajax.Updater call to not return until the content of my page had been updated. However, I found that if you call Ajax.Updaterwith the {asynchronous: false} option, the onComplete() function would never be called and your content would not be updated. Was this the intended behavior? I added the
2006 Mar 15
4
RJS template eating encoding
...onse. I use UTF-8 in my pages, and my app requires that I be able to, say, put Japanese characters in. The problem is that when I switched this over to an RJS template it started eating the encoding. I now get garbage characters where before I got the correct ones. The code for the RHTML: <%= update_element_function( "front", :content => simple_format( h(@card.front_side))) %> <%= update_element_function( "back", :content => simple_format( h(@card.back_side))) %> and for RJS: page.replace_html ''front'', simple_format( h( @card.front_side ) ) page.replac...
2005 Sep 01
0
Teething problems with Ajax.updater
Hi all, Forgive what I expect is a silly question. I have the following code: #CONTROLLER def calculate render :partial => ''calculate'' end #CALCULATE PARTIAL <%= update_element_function("update_1", :position => :bottom, :content => "<p>New product1!</p>") %> #VIEW <p><label for="order_unit_price">Unit price</label><br/> <%= text_field ''order'', ''unit_price'' %><...
2005 Dec 30
11
Losing my mind with Ajax link_to_remote
I''m playing around with Rails, and I can''t get this to work. I just can''t seem to wrap my brain around it. I''m having some trouble doing an Ajax navigation column. Here''s what I have: view layout: <div id="navigation"> <%= render(:partial => "navigation", :collection => @categories) %> </div> My
2006 Aug 16
8
Multiple (AJAX) Observers on the Same Field and MSIE
I have been using multiple observers, i.e., observe_field(), on the same input field and relying on them to execute in the same order that they appear in the page. This has been working fine in FireFox, but it does not seem to work in MSIE; the requests come in and are processed in a different order. Now, I''ve always been a little hesitant about using this technique, but it always