Jquery dialog open vs. Chrome

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Jquery dialog open vs. Chrome

Thelliez
Hello,

While creating a dialog with JQuery, I found that the following code
works with FF, but not with Chrome. Under the later, nothing happens
when clicking the 'Test' link.

html div
      id: (id := html nextId);
      script: (html jQuery new dialog
          html: aComponent;
          title: 'Title';
                height: 200;
                width: 400;
          resizable: false;
          modal: true).
                                                                               
html anchor
      onClick: (( html jQuery id: id) dialog open);
              with: 'Test'.


If I replace the anchor with a submitButton, the dialog works fine in
the two browsers. Adding a fake url like 'url: '#'' did not help (it
did help getting the right cursor type).

Any suggestions?
Thanks,
Thierry
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Jquery dialog open vs. Chrome

Nick
Hi Thierry,

I tried your code and it works for me on FF (4.0.1) and Chrome (11.0.696.65) Mac. Have you added the JQuery libraries JQuery, JQueryUI and a JQueryTheme to your application?

Have you used the developer tools in FF (Firebug) and Chrome (View->Developer->Developer Tools) to see if the browser is reporting any errors?

One thing I noticed is that the #html: method on your dialog object causes Seaside to make an ajax request for the dialog content when you click on the anchor. An alternative is for the content to be rendered during page load, but remain invisible until the dialog is opened. To achieve this you add - autoOpen: false - and render the component using the div's #with:

html div
       id: (html nextId);
       script: (html jQuery new dialog
               title: 'Title';
               height: 200;
               width: 400;
autoOpen: false;
                resizable: false;
                modal: true);
with: aComponent.

html anchor
       onClick: (( html jQuery id: html lastId) dialog open);
             with: 'Test'.

Perhaps the problem is with the component, try removing the component and testing with simple html in the dialog:

html div
       id: (html nextId);
       script: (html jQuery new dialog
               html: [ :r | r text: 'hello dialog'];
               title: 'Title';
               height: 200;
               width: 400;
               resizable: false;
               modal: true).

html anchor
       onClick: (( html jQuery id: html lastId) dialog open);
             with: 'Test'.

Or even simpler:

html div
       id: (html nextId);
       script: (html jQuery new dialog
               title: 'Title';
               height: 200;
               width: 400;
               resizable: false;
               modal: true;
               autoOpen: false);
        with: 'hello dialog'.

html anchor
       onClick: (( html jQuery id: html lastId) dialog open);
             with: 'Test'.

Hope this helps

Nick

On 10 May 2011 05:10, Thierry Thelliez <[hidden email]> wrote:
Hello,

While creating a dialog with JQuery, I found that the following code
works with FF, but not with Chrome. Under the later, nothing happens
when clicking the 'Test' link.

html div
       id: (id := html nextId);
       script: (html jQuery new dialog
                       html: aComponent;
                       title: 'Title';
               height: 200;
               width: 400;
                       resizable: false;
                       modal: true).

html anchor
       onClick: (( html jQuery id: id) dialog open);
             with: 'Test'.


If I replace the anchor with a submitButton, the dialog works fine in
the two browsers. Adding a fake url like 'url: '#'' did not help (it
did help getting the right cursor type).

Any suggestions?
Thanks,
Thierry
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Jquery dialog open vs. Chrome

Robert Sirois
In reply to this post by Thelliez
Works fine in Chrome for me :/

RS

> Date: Mon, 9 May 2011 22:10:56 -0600
> From: [hidden email]
> To: [hidden email]
> Subject: [Seaside] Jquery dialog open vs. Chrome
>
> Hello,
>
> While creating a dialog with JQuery, I found that the following code
> works with FF, but not with Chrome. Under the later, nothing happens
> when clicking the 'Test' link.
>
> html div
> id: (id := html nextId);
> script: (html jQuery new dialog
> html: aComponent;
> title: 'Title';
> height: 200;
> width: 400;
> resizable: false;
> modal: true).
>
> html anchor
> onClick: (( html jQuery id: id) dialog open);
> with: 'Test'.
>
>
> If I replace the anchor with a submitButton, the dialog works fine in
> the two browsers. Adding a fake url like 'url: '#'' did not help (it
> did help getting the right cursor type).
>
> Any suggestions?
> Thanks,
> Thierry
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Jquery dialog open vs. Chrome

Thelliez
In reply to this post by Nick
Thanks for checking my code.  I added the autoOpen.

Restarting Chrome made it work.  Strange...

Thierry
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Jquery dialog open vs. Chrome

Robert Sirois
In reply to this post by Thelliez
You know, I've had strange problems with chrome, too. Even had to go so far as rebooting, even though other browsers didn't have an issue.

Gotta love technology ;)

RS

Thierry Thelliez <[hidden email]> wrote:

>Thanks for checking my code.  I added the autoOpen.
>
>Restarting Chrome made it work.  Strange...
>
>Thierry
>_______________________________________________
>seaside mailing list
>[hidden email]
>http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside