[Proto-Scripty] Re: Detecting failure
Just change the script to adjust a little http://pastie.org/575168 HTH Alex Mcauley http://www.thevacancymarket.com - Original Message - From: Krish ilaymy...@yahoo.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Friday, August 07, 2009 5:18 AM Subject: [Proto-Scripty] Detecting failure This maybe a newbie questions but I am having some trouble with this. 1. I would like use prototype to make an ajax call to load a page .. grab a particular div target_div from that page and stick it into a destination div dest_div on this page. $(#dest_div).load(load_test.html #target_div img); Is there something similar for prototype? 2. If load fails, I want to put some default content that can be on this page. I am having detecting load failure. The exception handlers in makeAjaxCall don't work properly. Whats the best way to detect failure in a cross browser way? Thanks in advance, Kris --- my test page html head script type=text/javascript src=prototype-1.6.0.3.js/script script type=text/javascript function makeAjaxCall() { alert(); new Ajax.Request('./load_test.html?x=2345', { method:'get', onSuccess: function(transport){ var response = transport.responseText || no response text; alert(Success! \n\n + response); }, //onFailure: function(){ alert('Failure: Something went wrong...') } onException: function(){ alert('Exception: Something went wrong...') } }); } /script /head body onload=javascript:makeAjaxCall(); div id=dest_div/div original page. /body /html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] PeriodicalExecuter Error: this.callback is not a function (prototype.js Line 308)
Hi there! Got an error with Prototypes PeriodicalExecuter() (Version 1.6.0.3): When I use the verified (http://www.prototypejs.org/api/ periodicalExecuter) new PeriodicalExecuter(myobject.testMethod(), 3);, everything seems fine (no error in Firebug etc) but after 3 Seconds an error this.callback is not a function [...]/prototype.js Line 308 appears. testMethod was not started. The line new PeriodicalExecuter(function() { alert(test); }, 3); works when written instead. When I change the line into new PeriodicalExecuter (myobject.unknownMethod(), 3);, firebug at once states correctly that this function doesn't exist, which is right. Now I wonder about why this error appears. As you may imagine, testMethod() is part of an Object, but the error appears outside as inside the initialize()-function of the Class created by Class.create (). Even outside the class. The used testMethod() seems to exist nonetheless. I would like to read any hint or maybe solution to this problem, please feel free to ask for more information, too. Schweitzer --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: PeriodicalExecuter Error: this.callback is not a function (prototype.js Line 308)
Hi, When I change the line into new PeriodicalExecuter (myobject.unknownMethod(), 3);, firebug at once states correctly that this function doesn't exist, which is right. And if it did exist, it would execute once, immediately, and the PeriodicalExecuter would fail three seconds later. This line of code: new PeriodicalExecuter(obj.method(), 3); ...like any other function call runs obj.method _immediately_ and passes the return value of the method into the PeriodicalExecuter constructor. Unless the method returns a function reference, that's not going to work. You probably want to do this: new PeriodicalExecuter(obj.method.bind(obj), 3); Note that we are *not* calling method here; we're calling bind and telling it to return a function that, when called, will call obj.method. If you're not using an object method, just a function, you don't need bind: new PeriodicalExecuter(someFunction, 3); Note, again, that we are not *calling* someFunction there (there are no parens after it), we're just passing a reference to it into the constructor. [1] http://prototypejs.org/api/periodicalExecuter [2] http://prototypejs.org/api/function/bind HTH, -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Aug 7, 1:30 am, Schweitzer lul...@gmx.de wrote: Hi there! Got an error with Prototypes PeriodicalExecuter() (Version 1.6.0.3): When I use the verified (http://www.prototypejs.org/api/ periodicalExecuter) new PeriodicalExecuter(myobject.testMethod(), 3);, everything seems fine (no error in Firebug etc) but after 3 Seconds an error this.callback is not a function [...]/prototype.js Line 308 appears. testMethod was not started. The line new PeriodicalExecuter(function() { alert(test); }, 3); works when written instead. When I change the line into new PeriodicalExecuter (myobject.unknownMethod(), 3);, firebug at once states correctly that this function doesn't exist, which is right. Now I wonder about why this error appears. As you may imagine, testMethod() is part of an Object, but the error appears outside as inside the initialize()-function of the Class created by Class.create (). Even outside the class. The used testMethod() seems to exist nonetheless. I would like to read any hint or maybe solution to this problem, please feel free to ask for more information, too. Schweitzer --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: 2 onchange functions - 1 jquery, 1 prototype - not working in safari
Got it working by putting the hidden field inside one of the tds On Aug 7, 9:33 am, Ram yourstruly.vi...@gmail.com wrote: Hi, jNice is a jQuery plugin for nice form elements basically -http://www.whitespace-creative.com/jquery/jNice/ i narrowed down the issue to one line of code in the item_row function. it tries to insert a value into a hidden_field which is kind of like hanging inside tr tags. Here's the HTML and JS code.. HTML - tr class=row td/td td/td input class=item_id id=order_item_id name=order[item_id] type=hidden / td %= f.collection_select :item_name, Item.all, :item_for_order, :name, { :name = select, :onchange = item_row($(this));} % /td /tr JS function item_row(element){ id = /* calculation excluded for brevity */ (element).up('.row').down('.item_id').value = id ; //this is the line that fails in safari but works in FF } Anything wrong with my HTML structure that Safari is rejecting? thanks. On Aug 7, 2:58 am, mr_justin gro...@jperkins.otherinbox.com wrote: Please show the code of your item_row function. There is likely an exception occurring in Safari, halting your script execution. I am not familiar with jNice at all, never heard of it. I assume it is a jQuery plugin? -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: PeriodicalExecuter Error: this.callback is not a function (prototype.js Line 308)
Thank you very much for responding that fast and clear. In fact you are right, I misinterpreted the usage. Thanks to you, this file is closed now ;) On 7 Aug., 10:51, T.J. Crowder t...@crowdersoftware.com wrote: Hi, When I change the line into new PeriodicalExecuter (myobject.unknownMethod(), 3);, firebug at once states correctly that this function doesn't exist, which is right. And if it did exist, it would execute once, immediately, and the PeriodicalExecuter would fail three seconds later. This line of code: new PeriodicalExecuter(obj.method(), 3); ...like any other function call runs obj.method _immediately_ and passes the return value of the method into the PeriodicalExecuter constructor. Unless the method returns a function reference, that's not going to work. You probably want to do this: new PeriodicalExecuter(obj.method.bind(obj), 3); Note that we are *not* calling method here; we're calling bind and telling it to return a function that, when called, will call obj.method. If you're not using an object method, just a function, you don't need bind: new PeriodicalExecuter(someFunction, 3); Note, again, that we are not *calling* someFunction there (there are no parens after it), we're just passing a reference to it into the constructor. [1]http://prototypejs.org/api/periodicalExecuter [2]http://prototypejs.org/api/function/bind HTH, -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Aug 7, 1:30 am, Schweitzer lul...@gmx.de wrote: Hi there! Got an error with Prototypes PeriodicalExecuter() (Version 1.6.0.3): When I use the verified (http://www.prototypejs.org/api/ periodicalExecuter) new PeriodicalExecuter(myobject.testMethod(), 3);, everything seems fine (no error in Firebug etc) but after 3 Seconds an error this.callback is not a function [...]/prototype.js Line 308 appears. testMethod was not started. The line new PeriodicalExecuter(function() { alert(test); }, 3); works when written instead. When I change the line into new PeriodicalExecuter (myobject.unknownMethod(), 3);, firebug at once states correctly that this function doesn't exist, which is right. Now I wonder about why this error appears. As you may imagine, testMethod() is part of an Object, but the error appears outside as inside the initialize()-function of the Class created by Class.create (). Even outside the class. The used testMethod() seems to exist nonetheless. I would like to read any hint or maybe solution to this problem, please feel free to ask for more information, too. Schweitzer --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] RJS working in FF not in Safari
Hi, Im trying to insert a tr into a table. the code is as below. HTML - table id=tab tr !-- SOME tds HERE -- /tr %= render :partial = item, :collection = @order.items % tr onmouseover=document.getElementById ('plussign').style.display='block'; onmouseout=document.getElementById('plussign').style.display='none'; id=empty_row td div style=display:none; id=plussign%= add_item_link + %/ div /td !-- MORE tds HERE -- /tr !-- MORE trs HERE -- /table _item.html.erb - tr class=row !-- tds HERE -- /tr helper method - def add_item_link(name) link_to_function name do |page| page.insert_html :before, :empty_row, :partial='item', :object = Item.new end end This works in FF but not in Safari. Any idea what the problem might be? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: RJS working in FF not in Safari
Dude i am not sure why you use prototype and then revert to native document.getElementById().. and other vanilla JS Try putting a tbody in your table tbody is required HTML in tables ... some browsers add it if its missing and some dont - Safari might be one that doesnt. Alex Mcauley http://www.thevacancymarket.com - Original Message - From: Ram yourstruly.vi...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Friday, August 07, 2009 11:14 AM Subject: [Proto-Scripty] RJS working in FF not in Safari Hi, Im trying to insert a tr into a table. the code is as below. HTML - table id=tab tr !-- SOME tds HERE -- /tr %= render :partial = item, :collection = @order.items % tr onmouseover=document.getElementById ('plussign').style.display='block'; onmouseout=document.getElementById('plussign').style.display='none'; id=empty_row td div style=display:none; id=plussign%= add_item_link + %/ div /td !-- MORE tds HERE -- /tr !-- MORE trs HERE -- /table _item.html.erb - tr class=row !-- tds HERE -- /tr helper method - def add_item_link(name) link_to_function name do |page| page.insert_html :before, :empty_row, :partial='item', :object = Item.new end end This works in FF but not in Safari. Any idea what the problem might be? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: RJS working in FF not in Safari
Sheesh! bang on! including tbody tags did it. Thanks! oh and the vanilla js.. still playing around with the page.. thats all :) 2009/8/7 Alex McAuley webmas...@thecarmarketplace.com Dude i am not sure why you use prototype and then revert to native document.getElementById().. and other vanilla JS Try putting a tbody in your table tbody is required HTML in tables ... some browsers add it if its missing and some dont - Safari might be one that doesnt. Alex Mcauley http://www.thevacancymarket.com - Original Message - From: Ram yourstruly.vi...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Friday, August 07, 2009 11:14 AM Subject: [Proto-Scripty] RJS working in FF not in Safari Hi, Im trying to insert a tr into a table. the code is as below. HTML - table id=tab tr !-- SOME tds HERE -- /tr %= render :partial = item, :collection = @order.items % tr onmouseover=document.getElementById ('plussign').style.display='block'; onmouseout=document.getElementById('plussign').style.display='none'; id=empty_row td div style=display:none; id=plussign%= add_item_link + %/ div /td !-- MORE tds HERE -- /tr !-- MORE trs HERE -- /table _item.html.erb - tr class=row !-- tds HERE -- /tr helper method - def add_item_link(name) link_to_function name do |page| page.insert_html :before, :empty_row, :partial='item', :object = Item.new end end This works in FF but not in Safari. Any idea what the problem might be? -- In Sport We Trust !!! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Sortable.create and onHover
Hi All, I need to capture the onHover event for on a Sortable element. The onHover callback does not work (as far as I tested) for Sortable element, is there a way around this? I can of course make the element also a Droppable, in which case I can work around this restriction, but it is particularly heavy I guess. Any thoughts? Thanks, Seb --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Example values input text
Hello to the people of the group. It´s my first question. Any one know abut something like this http://mucur.name/system/jquery_example/ to prototype?? I need to use the element title of the text input. Thanks for all; Spielberg --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: dom:loaded exceptions
On Aug 6, 4:32 pm, mr_justin gro...@jperkins.otherinbox.com wrote: Don't call a method on an element unless it exists. This is a basic defensive coding technique. He gets this. His question is about why he does not receive an exception. I'm not sure, and now that I think about it, I may have had the same problem. Nicolas, have you tried your example with the latest RC of Prototype? Nathan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Sortable.create and onHover
is it not onmouseover ? Never knew there was an onHover Alex Mcauley http://www.thevacancymarket.com - Original Message - From: Sebastien seb.mar...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Friday, August 07, 2009 11:24 AM Subject: [Proto-Scripty] Sortable.create and onHover Hi All, I need to capture the onHover event for on a Sortable element. The onHover callback does not work (as far as I tested) for Sortable element, is there a way around this? I can of course make the element also a Droppable, in which case I can work around this restriction, but it is particularly heavy I guess. Any thoughts? Thanks, Seb --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Example values input text
You can do this quite easily in prototype... for input type=text just use the title attribute input type=text class=access title=Type something here... / Event.observe(window,'load',function() { $$('.access').invoke('observe','focus',function(element) { if(element.value==element.defaultValue) { element.value=''; } }); $$('.access').invoke('observe','blur',function(element) { if(element.value!=element.defaultValue || element.value=='') { element.value=element.defaultValue; } }); }); (untested but should work no problems) Alex Mcauley http://www.thevacancymarket.com - Original Message - From: spielberg inmo...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Friday, August 07, 2009 12:04 PM Subject: [Proto-Scripty] Example values input text Hello to the people of the group. It´s my first question. Any one know abut something like this http://mucur.name/system/jquery_example/ to prototype?? I need to use the element title of the text input. Thanks for all; Spielberg --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Example values input text
I don't know of a plugin like that but shouldn't be too hard to port On 8/7/09, spielberg inmo...@gmail.com wrote: Hello to the people of the group. It´s my first question. Any one know abut something like this http://mucur.name/system/jquery_example/ to prototype?? I need to use the element title of the text input. Thanks for all; Spielberg -- Sent from my mobile device --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Sortable.create and onHover
What exactly are you trying to do with that callback? Let's see some code. Sortable just implements Draggables and Droppables for you under the covers, and the onHover callback you pass to Sortable is just passed on through to the Droppable constructor. You know the onHover is for when your Draggable is hovering over a Droppable, right? I mean it's not for when you hover over a sortable object or anything like that. -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: 2 onchange functions - 1 jquery, 1 prototype - not working in safari
Got it working by putting the hidden field inside one of the tds Yes, I imagine having valid HTML would be helpful ;) -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: dom:loaded exceptions
He gets this. His question is about why he does not receive an exception. I'm not sure, and now that I think about it, I may have had the same problem. Oh my bad, I was reading this all wrong. That is weird indeed, I had never noticed that before. It looks like a browser issue, not a Prototype issue. Tried in Firefox and my code silently failed, but exceptions were raised in Safari and IE as expected. If I switched from document.observe('dom:loaded', ...) to Event.observe (window, 'load', ...) then the exception was raised as expected in Firefox. -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] autosuggest feature enter button hack in new Ajax.Autocompleter
Hello All, I have just joined this group and it's my first post. I will like to thank the community for coming up with such a powerful library. I am using new Ajax.Autocompleter in one of script and it works fine. I am using it in a input text box, in which, user types in the search term and back end script queries the database to get a result set and suggested items get shown as a list in input text box. When the suggested items show up as list in my input text box, when I press enter/tab key, a single list item gets selected. However, to submit this item, I have to press enter key again. In short, I need to hit enter twice in order to submit the list item. I will like if this action is done in a single hit of enter key. I tried using some JavaScript hacks to submit the form on enter key but I think scriptaculus is over riding it. Is this the case? Is there any way to make this work with just single enter key? Thanks. Regards, Yogesh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: autosuggest feature enter button hack in new Ajax.Autocompleter
I've never actually used this component but in researching the docs, could you use the callback for afterUpdateElement and then programatically execute the form's submit method? http://wiki.github.com/madrobby/scriptaculous/ajax-autocompleter -- http://positionabsolute.net On Aug 7, 10:11 am, Yogesh yogesh.aga...@gmail.com wrote: Hello All, I have just joined this group and it's my first post. I will like to thank the community for coming up with such a powerful library. I am using new Ajax.Autocompleter in one of script and it works fine. I am using it in a input text box, in which, user types in the search term and back end script queries the database to get a result set and suggested items get shown as a list in input text box. When the suggested items show up as list in my input text box, when I press enter/tab key, a single list item gets selected. However, to submit this item, I have to press enter key again. In short, I need to hit enter twice in order to submit the list item. I will like if this action is done in a single hit of enter key. I tried using some JavaScript hacks to submit the form on enter key but I think scriptaculus is over riding it. Is this the case? Is there any way to make this work with just single enter key? Thanks. Regards, Yogesh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: autosuggest feature enter button hack in new Ajax.Autocompleter
Hi Matt, I tried it and it works. Thank you so much for the quick reply. Thanks again. Regards, Yogesh On Aug 7, 11:48 am, Matt Foster mattfoste...@gmail.com wrote: I've never actually used this component but in researching the docs, could you use the callback for afterUpdateElement and then programatically execute the form's submit method? http://wiki.github.com/madrobby/scriptaculous/ajax-autocompleter -- http://positionabsolute.net On Aug 7, 10:11 am, Yogesh yogesh.aga...@gmail.com wrote: Hello All, I have just joined this group and it's my first post. I will like to thank the community for coming up with such a powerful library. I am using new Ajax.Autocompleter in one of script and it works fine. I am using it in a input text box, in which, user types in the search term and back end script queries the database to get a result set and suggested items get shown as a list in input text box. When the suggested items show up as list in my input text box, when I press enter/tab key, a single list item gets selected. However, to submit this item, I have to press enter key again. In short, I need to hit enter twice in order to submit the list item. I will like if this action is done in a single hit of enter key. I tried using some JavaScript hacks to submit the form on enter key but I think scriptaculus is over riding it. Is this the case? Is there any way to make this work with just single enter key? Thanks. Regards, Yogesh --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Updating a form's clean state
This is in no way a prototype related question, but we've got some pretty smart JavasScript people on here so I figured I'd pose the question. Here's the scenario: I have a form on a page with a bunch of inputs (text boxes). That form is hidden by default. Elsewhere on the page is a list of elements that are hooked up to an IPE. The elements that can be edited by the IPE are the same as those that can be edited in the form. So yes, there are two ways to edit the same data. One place is inline while you're reading it, and the other is if you click a little edit link that flips the page into edit mode. Does that make sense so far? Once in edit mode, you can either save your changes or click cancel which calls the built-in Form#reset() method that resets the form to it's clean state (the state the form was in when the page loaded). Now here's the thing, if you use the IPE to edit the data inline, the data is saved to the server AND also the corresponding input control in the hidden form is updated. That puts the form in a dirty state. So if I call the reset method at this point, the changes I just made with the IPE are cleared out. Those changes have already been saved to the server, so it doesn't make sense to clear them. Now that I've explained it all, my question is, does anyone know of a way to update a form's clean state somehow without a DOM reload? Perhaps there's a method that can be called on a form object? Maybe instead of just updating the value of the input I should replace the entire input. Hmmm, that's not a bad idea. What do you guys think? -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Updating a form's clean state
You could implement your own reset method on your form object. On 8/7/09, mr_justin gro...@jperkins.otherinbox.com wrote: This is in no way a prototype related question, but we've got some pretty smart JavasScript people on here so I figured I'd pose the question. Here's the scenario: I have a form on a page with a bunch of inputs (text boxes). That form is hidden by default. Elsewhere on the page is a list of elements that are hooked up to an IPE. The elements that can be edited by the IPE are the same as those that can be edited in the form. So yes, there are two ways to edit the same data. One place is inline while you're reading it, and the other is if you click a little edit link that flips the page into edit mode. Does that make sense so far? Once in edit mode, you can either save your changes or click cancel which calls the built-in Form#reset() method that resets the form to it's clean state (the state the form was in when the page loaded). Now here's the thing, if you use the IPE to edit the data inline, the data is saved to the server AND also the corresponding input control in the hidden form is updated. That puts the form in a dirty state. So if I call the reset method at this point, the changes I just made with the IPE are cleared out. Those changes have already been saved to the server, so it doesn't make sense to clear them. Now that I've explained it all, my question is, does anyone know of a way to update a form's clean state somehow without a DOM reload? Perhaps there's a method that can be called on a form object? Maybe instead of just updating the value of the input I should replace the entire input. Hmmm, that's not a bad idea. What do you guys think? -justin -- Sent from my mobile device --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Effect.Appear Fade in IE
Hello, I'm having some difficulties getting the Effect.Appear and Effect.Fade to work in IE. The Effect.Appear on the page http://spanglerdesign.com/test/askmary/home/eatbetter isn't working in IE 6 and 7. If you click on the click here to read more link the new window won't show. The Effect.Fade is working though in those versions of IE. In IE 8 the Effect.Fade isn't working, and the Effect.Appear is sort of working, but the positioning is off. The js file I am using for these effects is http://spanglerdesign.com/test/askmary/public/js/EatBetter.js Thanks, -Andy p.s. Is there an estimate for scripty2's release date? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] help with select on element not working
I have the following httml and javascript code (see snippets below). I am running this using firebug I am able to get the element lotTotalTr = $(accountTotal) to work However the select on the element does not work. I have tried many variations of the select totalLotSharesTd = lotTotalTr.select('td.totalLotShares') I was able to use lotTotalTr.childElements() and then totalLotSharesTd3 = totalLotSharesTd2[3] to position myself where I want to be but not select. This is not a good way to do this Can anyone explain this to me? -- tr id=Total 87002B class=TableRow1 td type=textTotal 87002B/td td type=text/ td type=text/ td class=totalLotShares name=totalLotShares type=text18031/ td td type=text316186.29/td td type=text316186.29/td td type=text/ td type=text/ /tr - function lotShareChange(obj){ var e = $(obj).up('tr'); var account = e.select('td input.account'); var accountVal = account[0].value; var accountTotal = Total + accountVal; var lotTotalTr = $(accountTotal); var totalLotSharesTd; var totalLotSharesTd2, totalLotSharesTd3, totalLotSharesTd4; totalLotSharesTd = lotTotalTr.select('td.totalLotShares'); // selects do not work totalLotSharesTd2 = lotTotalTr.childElements(); //worked totalLotSharesTd3 = totalLotSharesTd2[3]; //worked totalLotSharesTd4 = lotTotalTr.select('td'); //does not work //totalLotSharesTd = lotTotalTr.select('td'); totalLotSharesTd3.update(totalShares); } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: lightwindow not working after ajax update
lightwindow is based on scriptaculous. http://www.stickmanlabs.com/lightwindow/ Nobody uses it? 2009/8/6 DJ Mangus d.man...@gmail.com: Explain lightwindow for me, does it use javascript to display? If so then post that script too please. On 8/6/09, Martín Marqués martin.marq...@gmail.com wrote: We are working on and html page which has a div with id=container that gets updated when pressing link buttons that are on the top. This is very simple code: new Ajax.Updater('container', 'somepage.html', { parameters: { method: GET } }); The thing is that one of the pages has a link with lightwindow class. This page by it self works great, but when it is inserted in the container div it doesn't use the lightwindow efect, it just opens the link as if it was a normal link youn press on. Anything wrong with how we are working with this? -- Martín Marqués select 'martin.marques' || '@' || 'gmail.com' DBA, Programador, Administrador -- Sent from my mobile device -- Martín Marqués select 'martin.marques' || '@' || 'gmail.com' DBA, Programador, Administrador --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: lightwindow not working after ajax update
From glancing at the source of that it doesn't look like it handles elements created after the lightwindow object is initialized. You might want to get ahold of the author of that for support with it. 2009/8/7 Martín Marqués martin.marq...@gmail.com: lightwindow is based on scriptaculous. http://www.stickmanlabs.com/lightwindow/ Nobody uses it? 2009/8/6 DJ Mangus d.man...@gmail.com: Explain lightwindow for me, does it use javascript to display? If so then post that script too please. On 8/6/09, Martín Marqués martin.marq...@gmail.com wrote: We are working on and html page which has a div with id=container that gets updated when pressing link buttons that are on the top. This is very simple code: new Ajax.Updater('container', 'somepage.html', { parameters: { method: GET } }); The thing is that one of the pages has a link with lightwindow class. This page by it self works great, but when it is inserted in the container div it doesn't use the lightwindow efect, it just opens the link as if it was a normal link youn press on. Anything wrong with how we are working with this? -- Martín Marqués select 'martin.marques' || '@' || 'gmail.com' DBA, Programador, Administrador -- Sent from my mobile device -- Martín Marqués select 'martin.marques' || '@' || 'gmail.com' DBA, Programador, Administrador --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Updating a form's clean state
Yeah that would require quite a bit more work than I was thinking. I tried out the technique of replacing the entire input control rather than just updating the value, and it works great. Except in IE. Of course. -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Updating a form's clean state
Of course. Shouldn't be really hard to implement your own reset though. Just keep a hash of initial values and ids (you can use http://www.prototypejs.org/api/element/identify to give elements w/o an id one) and upon customreset set them all back. Then if you save changes to server just update the hash. On Fri, Aug 7, 2009 at 1:53 PM, mr_justingro...@jperkins.otherinbox.com wrote: Yeah that would require quite a bit more work than I was thinking. I tried out the technique of replacing the entire input control rather than just updating the value, and it works great. Except in IE. Of course. -justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] How to loop through array? New to Proto
I have some code that appears to be a prime candidate for a loop. How could I wrap this up in one neat little function??? /* Hide previous errors */ $('ErrorConsumerEmail0address').hide(); $('ErrorConsumerfirstname').hide(); $('ErrorConsumerlastname').hide(); $('ErrorConsumerPhone0Number').hide(); Thank you. Trope! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: How to loop through array? New to Proto
Give them all a class of 'error' and use $$('error').each('hide') Note: drycoded on my phone so look those up before using them. On 8/7/09, trope jtrope...@gmail.com wrote: I have some code that appears to be a prime candidate for a loop. How could I wrap this up in one neat little function??? /* Hide previous errors */ $('ErrorConsumerEmail0address').hide(); $('ErrorConsumerfirstname').hide(); $('ErrorConsumerlastname').hide(); $('ErrorConsumerPhone0Number').hide(); Thank you. Trope! -- Sent from my mobile device --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---