[Proto-Scripty] Re: Using Ajax.Updater posts the contain form

2009-08-13 Thread T.J. Crowder

Hi,

The code you included in your message isn't posting any forms; it must
be something else on the page.

Can you produce a minimalist, complete, stand-alone example of the
behavior?  (There's a template here[1] if you like.)  See Step 3 in
this troubleshooting tip[2] on the FAQ for details and rationale.

[1] http://proto-scripty.wikidot.com/self-contained-test-page
[2] http://proto-scripty.wikidot.com/faq#xyzprob

HTH,
--
T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available


On Aug 13, 9:18 am, dpGoose cpzare...@googlemail.com wrote:
 Hi,

 I am using Axaj.Updater to retrieve a message from the server and it
 does do this but it also posts the form the Updater script and
 associated controls are contained in. I have followed the examples on
 the prototype site with modifications for my web server. Why is this
 happening? Here is the relevant code. This response is just a text
 message.

 script type=text/javascript
         function loadit()
         {
                 new Ajax.Updater( 'structureTree', 'Render?s=OrgConfigAjax',
                 {
                         method: 'get',
                         parameters:
                         {
                                 cmd: 'test'
                         }
                  });
         }
 /script
 button onclick=loadit();Click me/button
 div id=structureTreeLoading...
 /div
--~--~-~--~~~---~--~~
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: Using Ajax.Updater posts the contain form

2009-08-13 Thread Alex McAuley

Can you explain it a bit better?

I dont quite understand what is going on


Alex Mcauley
http://www.thevacancymarket.com
- Original Message - 
From: dpGoose cpzare...@googlemail.com
To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Thursday, August 13, 2009 9:18 AM
Subject: [Proto-Scripty] Using Ajax.Updater posts the contain form



 Hi,

 I am using Axaj.Updater to retrieve a message from the server and it
 does do this but it also posts the form the Updater script and
 associated controls are contained in. I have followed the examples on
 the prototype site with modifications for my web server. Why is this
 happening? Here is the relevant code. This response is just a text
 message.

 script type=text/javascript
 function loadit()
 {
 new Ajax.Updater( 'structureTree', 'Render?s=OrgConfigAjax',
 {
 method: 'get',
 parameters:
 {
 cmd: 'test'
 }
 });
 }
 /script
 button onclick=loadit();Click me/button
 div id=structureTreeLoading...
 /div

 
 


--~--~-~--~~~---~--~~
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: Responders

2009-08-13 Thread Richard Quadling

2009/8/12 Alex McAuley webmas...@thecarmarketplace.com:

 Thanks TJ, I'll look into it and see if i can hack something together
 Alex Mcauley
 http://www.thevacancymarket.com
 - Original Message -
 From: T.J. Crowder t...@crowdersoftware.com
 To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
 Sent: Wednesday, August 12, 2009 9:54 AM
 Subject: [Proto-Scripty] Re: Responders



 Hi Alex,

 I don't think there's any official way.  A quick look at the 1.6.0.3
 release (line #1439) suggests that your responder can access the
 target container via the request parameter passed to your responder,
 specifically request.container.success (the container that will be
 updated on success) and request.container.failure (the one that will
 be updated on failure).  As this is undocumented (AFAIK), it may
 change from release to release...

 HTH,
 --
 T.J. Crowder
 tj / crowder software / com
 Independent Software Engineer, consulting services available


 On Aug 12, 9:37 am, Jeztah webmas...@thecarmarketplace.com wrote:
 Morning Guys / Gals...

 I am sure this has been covered before but i'll post it anyway as i
 cant find it in a search!...

 I am speeding up a website at the moment by using Ajax to do some
 dirty work in heavy loading pages (pagination and so on)...

 I need to put a loading spinner or text in place of an element while
 the ajax is doing its thing

 I could code each function to do this but i am sure there is an easier
 way.

 My first thought is to use Ajax.Responders to do something,
 but..

 Is there a way i can get the Element that is going to be updated by
 the Ajax.Updater via Ajax.Responders - then i can just code something
 Generic into the JS and dont have to worry about updating stuff all
 the time...

 Thanks in advance

 Alex



 


My solution was to use responders.

As part of the response object, I add a spinner property and a form property.

In the responder, if these were present, then I processed them
accordingly (onCreate : spinner on , form elements disabled and
onComplete/onException/onError the settings are reversed).

It works for me, but does require 2 optional additional properties to
the AJAX request.



-- 
-
Richard Quadling
Standing on the shoulders of some very clever giants!
EE : http://www.experts-exchange.com/M_248814.html
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

--~--~-~--~~~---~--~~
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: Using Ajax.Updater posts the contain form

2009-08-13 Thread Daniel Rubin

dpGoose wrote:
 Hi,
 
 I am using Axaj.Updater to retrieve a message from the server and it
 does do this but it also posts the form the Updater script and
 associated controls are contained in. I have followed the examples on
 the prototype site with modifications for my web server. Why is this
 happening? Here is the relevant code. This response is just a text
 message.
 
 script type=text/javascript
   function loadit()
   {
   new Ajax.Updater( 'structureTree', 'Render?s=OrgConfigAjax',
   {
   method: 'get',
   parameters:
   {
   cmd: 'test'
   }
});
   }
 /script
 button onclick=loadit();Click me/button
 div id=structureTreeLoading...
 /div
Hi,
you might want to try putting the attribute setting
type=button
in your button-tag.

I assume the snippet you posted is contained in a form, right?
Button-tags are type=submit by default, so clicking the button will
trigger both 'click' and 'submit' events.

Does this help?

Daniel


--~--~-~--~~~---~--~~
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: Using Ajax.Updater posts the contain form

2009-08-13 Thread T.J. Crowder

 I assume the snippet you posted is contained in a form, right?
 Button-tags are type=submit by default...

Gah!  I read right past that.  Nice catch.

-- T.J.

On Aug 13, 1:21 pm, Daniel Rubin dru...@dimedis.de wrote:
 dpGoose wrote:
  Hi,

  I am using Axaj.Updater to retrieve a message from the server and it
  does do this but it also posts the form the Updater script and
  associated controls are contained in. I have followed the examples on
  the prototype site with modifications for my web server. Why is this
  happening? Here is the relevant code. This response is just a text
  message.

  script type=text/javascript
     function loadit()
     {
             new Ajax.Updater( 'structureTree', 'Render?s=OrgConfigAjax',
             {
                     method: 'get',
                     parameters:
                     {
                             cmd: 'test'
                     }
              });
     }
  /script
  button onclick=loadit();Click me/button
  div id=structureTreeLoading...
  /div

 Hi,
 you might want to try putting the attribute setting
     type=button
 in your button-tag.

 I assume the snippet you posted is contained in a form, right?
 Button-tags are type=submit by default, so clicking the button will
 trigger both 'click' and 'submit' events.

 Does this help?

 Daniel
--~--~-~--~~~---~--~~
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] Observing a checkbox

2009-08-13 Thread Jeztah

What is the correct Cross browser way to observe a checkbox being
checked or not

I am using

$('hidenonlive').observe('change',function() {

if($('hidenonlive').checked!==true) {
alert('Showing');

} else {
$$('.dead-vacancy').invoke('hide');

}

});

But it doesnt seem to want to work in IE8 and it doesnt throw an
error SHoudl i just use click instead?

Thanks in advance

ALex
--~--~-~--~~~---~--~~
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: Observing a checkbox

2009-08-13 Thread Douglas

checked === true is wrong you should check for ('checked' ==
$(input).checked || true == $(input).checked)

ps: untested

On Thu, Aug 13, 2009 at 10:53 AM, Jeztahwebmas...@thecarmarketplace.com wrote:

 What is the correct Cross browser way to observe a checkbox being
 checked or not

 I am using

 $('hidenonlive').observe('change',function() {

                                if($('hidenonlive').checked!==true) {
                                        alert('Showing');

                                } else {
                                        $$('.dead-vacancy').invoke('hide');

                                }

                        });

 But it doesnt seem to want to work in IE8 and it doesnt throw an
 error SHoudl i just use click instead?

 Thanks in advance

 ALex
 




-- 
Believe nothing, no matter where you read it, or who said it, no
matter if I have said it, unless it agrees with your own reason and
your own common sense.

--~--~-~--~~~---~--~~
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: Casting a json object into an instance of a class

2009-08-13 Thread Matt Foster

You could just have the server return code that instantiates the
object to begin with.  You aren't limited to JSON its just convienent
because the structure is simple and there are plenty of processors
that understand it.  But you can evaluate any JS code just as is.


--

http://positionabsolute.net

On Aug 12, 8:36 am, T.J. Crowder t...@crowdersoftware.com wrote:
  At least, I now know what is the state of the art way of getting a
  class instance through Ajax ;o)

 Well, I don't know if it's state of the art, but provided you're in
 control of both ends (so, for instance, the raw data object doesn't
 get fields that end up overwriting your methods), it seems fine.

  Thanks again!

 Happy to help,

 -- T.J.

 On Aug 12, 12:06 pm, Eric lefauv...@gmail.com wrote:

  Thanks for your reply T.J.!

  I did used Class instead of class. This was a typo when I posted :o)

  You're right, it should have work the way I did it... and it actually
  did work this way...
  ...except that due to a mistake in my events handling, my new thing
  value was overridden by some obsolete part of code just after being
  converted into a class instance :o(
  And since it was overridden by the raw JSON object value, I stupidly
  assumed that the casting didn't work.

  At least, I now know what is the state of the art way of getting a
  class instance through Ajax ;o)

  Thanks again!
  Eric

  On Aug 12, 10:49 am, T.J. Crowder t...@crowdersoftware.com wrote:

   Hi,

   That should work.  I notice that you have class.Create rather than
   Class.create; I assume that's just an error in the note and that the
   actual code uses Class.create?  Because if not, that's your problem.

if(myInstance.isB())...

= isB is undefined

   That indicates there's a different problem.  isB should be defined
   regardless, you defined it in your class definition.  If the
   Object.extend thing weren't working, it should *return* undefined, but
   not *be* undefined.

   FWIW, this works:
   * * * * (also athttp://pastie.org/581050)
   // Defining
   var Thing = Class.create({
       initialize: function(src)
       {
           if (src) {
               Object.extend(this, src);
           }
       },

       isB: function()
       {
           return this.b;
       }

   });

   // Using:
   var t;
   t = new Thing({b: true});
   alert(t.isB() ?  + t.isB());
   * * * *

   HTH,
   --
   T.J. Crowder
   tj / crowder software / com
   Independent Software Engineer, consulting services available
--~--~-~--~~~---~--~~
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: image flickering with Effect.Morph

2009-08-13 Thread Matt Foster

 I am trying to code an OS X-style menu bar with prototype

Are you talking about the dock?

http://positionabsolute.net/blog/2007/08/prototype-fisheye.php


On Jul 13, 4:05 pm, Mario Colombo mario.colo...@yetnet.ch wrote:
 Hi everybody,

 I am trying to code an OS X-style menu bar with prototype and
 scriptaculous 1.8.2. I have two problems which I hope to solve with
 your feedback. I myself am stuck after failing with all the ideas I
 had.

 Please find the example 
 here:http://aldebaran.mine.nu/menu/menu.htmlhttp://aldebaran.mine.nu/menu/menu.jshttp://aldebaran.mine.nu/menu/menu.css

 1st problem: image flickering: changing mouseover over the different
 divs produces a flash or flickering. Reading this group and other
 sources suggest that it is a problem with different Effects active at
 the same time. I tried to solve this over Effect.Queues and cancel the
 whole queue with my scope: 'menu' but unfortunately cancelling queues
 results in no effects at all:

 ---[code]--
 // menuelement is the current menu div from  $$('.level_one').each
 (function(menuelement) {

 elDimensions = menuelement.getDimensions(); // to set style manually
 to where the effect was cancelled
 var queue = Effect.Queues.get('menu'); // cancelling the whole scope:
 'menu' queue
 queue.each(function(effect) { effect.cancel(); });

 menuelement.setStyle('height:'+ elDimensions.height + 'px; ' +
 'width:' + elDimensions.width + 'px;')   // set dimensions to where
 effect stops
 var myEffect = new Effect.Morph(menuelement, {style: {width:'100px',
 height:'100px'}, queue: {position: 'end', scope: 'menu'}}); //new
 effect takes place
 ---[/code]--

 I also tried to save all effects to the same variable myEffect,
 trying to have them overwrite themselves, which brought a partial
 improvement.

 2nd problem: On 'mouseout' I would like the menu to return to its
 original state 'width:100px; height:100px;' I tried the following
 code:

 ---[code]--
 Event.observe($('menu'), 'mouseout', function(event) {          //
 'menu' is the id of the containing div
         $$('.level_one').each(function(menuelement) {
         var myEffect = new Effect.Morph(menuelement, {style:
 {width:'100px', height:'100px'}});
         });});

 ---[/code]--

 This resulted in erratic behaviour.

 Help would be greatly appreciated.  Help for better OO programming is
 always welcome. Thank you in advance.

 Mario
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---