[jQuery] Re: appfuse: jQuery + scriptaculous + datePicker

2007-08-09 Thread syg6

I think I fixed it! (With your help of course ...)

This is the way I had it previously:

jQuery.noConflict();
$(function()
  {
jQuery('.date-pick').datePicker({clickInput:true});
  });

And this is how it should be:

jQuery.noConflict();
jQuery(function()
  {
jQuery('.date-pick').datePicker({clickInput:true});
  });

In other words, I replaced the '$' before ('.date-pick') with
'jQuery', but not the '$' before 'function()'. Dumb.

Now I just have to get css to work! The calendar appears with *some*
styles it seems, but at the bottom-left-hand corner of the screen! But
I think this is because Appfuse uses SiteMesh to decorate jsps, and if
you want to use custom css you have to mess with it ...

Many thanks!
Bob
On Aug 8, 4:09 pm, Kelvin Luck [EMAIL PROTECTED] wrote:
 Because you are using jQuery in noConflict mode you can no longer use $
 to create jquery objects. So you need to replace:

 $('.date-pick').datePicker({clickInput:true});

 with:

 jQuery('.date-pick').datePicker({clickInput:true});

 Hope that helps,

 Kelvin :)

 syg6 wrote:
  Thank you both, Kelvin and Klaus, for your replies.

  Yes, I saw that page and after a quick read decided (incorrectly) it
  was above my jQuery pay-grade and that it didn't apply to me. But as
  it turns out, if I put the jQuery.noConflict(); line in my page before
  calling the datePicker() function, the errors go away. Excellent!

  ... but my calendar doesn't appear! :( No errors, but no calendar. I
  think I have everything configured correctly:

  I include the jquery-1.1.2.js, date.js, date_es.js,
  jquery.dimensions.js, and datePicker.js libraries
  I include the datePicker.css and demo.css style files
  I include the snippet of js code that defines the datePicker - $
  ('.date-pick').datePicker({clickInput:true});
  I create an input that has the 'date-picker' style class

  And the calendar doesn't appear. There's no link next to the input nor
  is the input click-able. What could I be doing wrong?

  Many thanks!
  Bob



[jQuery] Re: appfuse: jQuery + scriptaculous + datePicker

2007-08-08 Thread Kelvin Luck


Hi,

Have you seen this page?

http://docs.jquery.com/Using_jQuery_with_Other_Libraries

Hope it helps,

Kelvin :)

syg6 wrote:

Hello all.

I posted this over at Appfuse's Nabble list as first, but then thought
this would be the better place.

I have a default.jsp page that uses SiteMesh to 'decorate' all of my
jsps. It contains the following js libraries:

prototype.js
scriptaculous.js
global.js

In order to use datePicker you need the following js libraries:

jquery-1.x.js
date.js
jquery-dimensions.js
jquery-datepicker.js

I put those 4 js files in my test.jsp file. But when the test.jsp page
is rendered, including all the stuff in default.jsp, Firefox goes
berserk. I get thousands of js errors, all in effects.js:


this._base has no properties, http://localhost:8080/scripts/effects.js, Line 516


This also happens if I put my jquery.js in default.jsp after
scriptaculous.js. However, if I put it before scriptaculous.js I get
no errors. But my calendar doesn't work! No errors, just doesn't
appear!

And if I comment out scriptaculous.js in default.jsp, and leave
jquery.js in test.jsp, my calendar works. Oddly enough, the calendar
appears in the bottom left corner of the screen and without any
styles. It seems it's not grabbing either the datepicker.css or
demo.css it needs, I don't know.

Anyone ever used datePicker, or more generally, scriptaculous +
jquery? It seems that the order you put them in your page is
important. It seems like if you put jquery after scriptaculous it goes
into a loop, when jquery's constructor is called, and never exits.

Thanks!
Bob



[jQuery] Re: appfuse: jQuery + scriptaculous + datePicker

2007-08-08 Thread Klaus Hartl


syg6 wrote:

Hello all.

I posted this over at Appfuse's Nabble list as first, but then thought
this would be the better place.

I have a default.jsp page that uses SiteMesh to 'decorate' all of my
jsps. It contains the following js libraries:

prototype.js
scriptaculous.js
global.js

In order to use datePicker you need the following js libraries:

jquery-1.x.js
date.js
jquery-dimensions.js
jquery-datepicker.js

I put those 4 js files in my test.jsp file. But when the test.jsp page
is rendered, including all the stuff in default.jsp, Firefox goes
berserk. I get thousands of js errors, all in effects.js:


this._base has no properties, http://localhost:8080/scripts/effects.js, Line 516


This also happens if I put my jquery.js in default.jsp after
scriptaculous.js. However, if I put it before scriptaculous.js I get
no errors. But my calendar doesn't work! No errors, just doesn't
appear!

And if I comment out scriptaculous.js in default.jsp, and leave
jquery.js in test.jsp, my calendar works. Oddly enough, the calendar
appears in the bottom left corner of the screen and without any
styles. It seems it's not grabbing either the datepicker.css or
demo.css it needs, I don't know.

Anyone ever used datePicker, or more generally, scriptaculous +
jquery? It seems that the order you put them in your page is
important. It seems like if you put jquery after scriptaculous it goes
into a loop, when jquery's constructor is called, and never exits.

Thanks!
Bob


This should help you:
http://docs.jquery.com/Using_jQuery_with_Other_Libraries


--Klaus


[jQuery] Re: appfuse: jQuery + scriptaculous + datePicker

2007-08-08 Thread syg6

Thank you both, Kelvin and Klaus, for your replies.

Yes, I saw that page and after a quick read decided (incorrectly) it
was above my jQuery pay-grade and that it didn't apply to me. But as
it turns out, if I put the jQuery.noConflict(); line in my page before
calling the datePicker() function, the errors go away. Excellent!

... but my calendar doesn't appear! :( No errors, but no calendar. I
think I have everything configured correctly:

I include the jquery-1.1.2.js, date.js, date_es.js,
jquery.dimensions.js, and datePicker.js libraries
I include the datePicker.css and demo.css style files
I include the snippet of js code that defines the datePicker - $
('.date-pick').datePicker({clickInput:true});
I create an input that has the 'date-picker' style class

And the calendar doesn't appear. There's no link next to the input nor
is the input click-able. What could I be doing wrong?

Many thanks!
Bob

On Aug 8, 1:13 pm, Klaus Hartl [EMAIL PROTECTED] wrote:
 syg6 wrote:
  Hello all.

  I posted this over at Appfuse's Nabble list as first, but then thought
  this would be the better place.

  I have a default.jsp page that uses SiteMesh to 'decorate' all of my
  jsps. It contains the following js libraries:

  prototype.js
  scriptaculous.js
  global.js

  In order to use datePicker you need the following js libraries:

  jquery-1.x.js
  date.js
  jquery-dimensions.js
  jquery-datepicker.js

  I put those 4 js files in my test.jsp file. But when the test.jsp page
  is rendered, including all the stuff in default.jsp, Firefox goes
  berserk. I get thousands of js errors, all in effects.js:

  this._base has no properties,http://localhost:8080/scripts/effects.js, 
  Line 516

  This also happens if I put my jquery.js in default.jsp after
  scriptaculous.js. However, if I put it before scriptaculous.js I get
  no errors. But my calendar doesn't work! No errors, just doesn't
  appear!

  And if I comment out scriptaculous.js in default.jsp, and leave
  jquery.js in test.jsp, my calendar works. Oddly enough, the calendar
  appears in the bottom left corner of the screen and without any
  styles. It seems it's not grabbing either the datepicker.css or
  demo.css it needs, I don't know.

  Anyone ever used datePicker, or more generally, scriptaculous +
  jquery? It seems that the order you put them in your page is
  important. It seems like if you put jquery after scriptaculous it goes
  into a loop, when jquery's constructor is called, and never exits.

  Thanks!
  Bob

 This should help you:http://docs.jquery.com/Using_jQuery_with_Other_Libraries

 --Klaus



[jQuery] Re: appfuse: jQuery + scriptaculous + datePicker

2007-08-08 Thread Kelvin Luck


Because you are using jQuery in noConflict mode you can no longer use $ 
to create jquery objects. So you need to replace:


$('.date-pick').datePicker({clickInput:true});

with:

jQuery('.date-pick').datePicker({clickInput:true});

Hope that helps,

Kelvin :)

syg6 wrote:

Thank you both, Kelvin and Klaus, for your replies.

Yes, I saw that page and after a quick read decided (incorrectly) it
was above my jQuery pay-grade and that it didn't apply to me. But as
it turns out, if I put the jQuery.noConflict(); line in my page before
calling the datePicker() function, the errors go away. Excellent!

... but my calendar doesn't appear! :( No errors, but no calendar. I
think I have everything configured correctly:

I include the jquery-1.1.2.js, date.js, date_es.js,
jquery.dimensions.js, and datePicker.js libraries
I include the datePicker.css and demo.css style files
I include the snippet of js code that defines the datePicker - $
('.date-pick').datePicker({clickInput:true});
I create an input that has the 'date-picker' style class

And the calendar doesn't appear. There's no link next to the input nor
is the input click-able. What could I be doing wrong?

Many thanks!
Bob