Quantcast

AJAX

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

AJAX

Jakub-8
Hello,

i am coming to seaside from php and it looks as really hard way :-), but i used JQuery for easy and fast ajax.

There was something like from index.php call skript.php via ajax and when i get result i can clear (change his inner html = everything between his div tag) < div class="clearme"> and change his content with new html.

I want do this in root component render left menu head and bottom and content area. And i want change content with ajax. Sometimes shows new, sometimes users account info etc. i look on scriptacolous website but i dont find any demo to do this. May be it's problem i dont know whati want to find because i think there will be now script to call site skript.php from index.php :). But can anybody show me best way to do what i want?

Thnx

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

Re: AJAX

Lukas Renggli
> I want do this in root component render left menu head and bottom and
> content area. And i want change content with ajax. Sometimes shows new,
> sometimes users account info etc. i look on scriptacolous website but i dont
> find any demo to do this. May be it's problem i dont know whati want to find
> because i think there will be now script to call site skript.php from
> index.php :). But can anybody show me best way to do what i want?

Have a look at the senders of #updater.

You pass it the id of the div that you want to change its contents and
a callback block that renders the contents of that particular div
element. Something like:

html anchor
    onClick: (html updater
       id: 'someid';
       callback: [ :r |
           body := aComponent.
           self renderBodyOn: r ];
     with: 'menu 1'.
html div
    id: 'someid';
    with: [ self renderBodyOn: html ]

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: AJAX

Jakub-8
Ok,

>html anchor
>   onClick: (html updater
>      id: 'someid';
>      callback: [ :r |
>          body := aComponent.
>          self renderBodyOn: r ];
>    with: 'menu 1'.

r is renderer, but its renderer of  html updater or i must write here html renderer when i call this part of code in:

anotherComponent >> renderConententOn: html
 html anchor
   onClick: (html updater
      id: 'someid';
      callback: [ :r |
          body := aComponent.
          self renderBodyOn: r ];
    with: 'menu 1'.

or r is right in this small example?


2007/12/30, Lukas Renggli <[hidden email]>:
> I want do this in root component render left menu head and bottom and
> content area. And i want change content with ajax. Sometimes shows new,
> sometimes users account info etc. i look on scriptacolous website but i dont
> find any demo to do this. May be it's problem i dont know whati want to find
> because i think there will be now script to call site skript.php from
> index.php :). But can anybody show me best way to do what i want?

Have a look at the senders of #updater.

You pass it the id of the div that you want to change its contents and
a callback block that renders the contents of that particular div
element. Something like:

html anchor
    onClick: (html updater
       id: 'someid';
       callback: [ :r |
           body := aComponent.
           self renderBodyOn: r ];
     with: 'menu 1'.
html div
    id: 'someid';
    with: [ self renderBodyOn: html ]

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
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
|  
Report Content as Inappropriate

Re: AJAX

Lukas Renggli
> r is renderer, but its renderer of  html updater or i must write here html
> renderer when i call this part of code in:

The callback block will be evaluated during a different request, at
that time html is not a valid renderer anymore as this document has
been already sent to the browser. r is then new renderer that you
should use within the callback block.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Loading...