javascript function with seaside callback [Fwd: generating a script containing html]

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

javascript function with seaside callback [Fwd: generating a script containing html]

SainTiss
Alternatively, I think the problem would be solved if the following is
possible:

can I generate a javascript function, the body of which invokes a seaside
callback?

Thanks,

Hans


----------  Forwarded Message  ----------

Subject: generating a script containing html
Date: Tuesday 22 July 2008
From: SainTiss <[hidden email]>
To: "Seaside - general discussion" <[hidden email]>

Hi,

I'd like to generate the following:

<script>
var homeMenu=new Array()
homeMenu[0]='***myLink***'
</script>

where basically ***myLink*** should be generated by means of
html anchor with:

The problem is that the following doesn't work:

html script with: 'var homeMenu=new Array()\nhomeMenu[0]=''' , (html anchor
with: 'myLink')'.

Because that just generates the string representation of an anchorBrush.

What's the proper way to do this?

Thanks,

Hans

--
If we cannot live so as to be happy, let us at least live so as to deserve it
 -- Immanuel Hermann Fichte

A liberal is a person whose interests aren't at stake at the moment
 -- Willis Player

Ark Linux - Linux for the Masses (http://arklinux.org)

Hans Schippers
Aspirant FWO - Vlaanderen
Formal Techniques in Software Engineering (FoTS)
University of Antwerp
Middelheimlaan 1
2020 Antwerpen - Belgium
Phone: +32 3 265 38 71
Fax: +32 3 265 37 77

-------------------------------------------------------

--
A liberal is a person whose interests aren't at stake at the moment
  -- Willis Player

Hans Schippers
Research Assistant of the Research Foundation - Flanders (FWO - Vlaanderen)
http://www.win.ua.ac.be/~hschipp/
Formal Techniques in Software Engineering (FoTS)
University of Antwerp
Middelheimlaan 1
2020 Antwerpen - Belgium
Phone: +32 3 265 37 88
Fax: +32 3 265 37 77
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: javascript function with seaside callback [Fwd: generating a script containing html]

Lukas Renggli
>  can I generate a javascript function, the body of which invokes a seaside
>  callback?

(html request callback: [ "some callback" ]) asFunction

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

Re: javascript function with seaside callback [Fwd: generating a script containing html]

SainTiss
On Wednesday 23 July 2008 11:17:04 Lukas Renggli wrote:
> (html request callback: [ "some callback" ]) asFunction

Thanks... Is a callback created this way supposed to rerender the current
page?

I tried this:

html anchor onClick: (html javascript add: (html request callback: [self
addEntry: 'Test'])); with: 'myLink'.

Where self addEntry modifies the current component's state. However, when I
click the link, the page is not rerendered...

Thanks,

Hans


--
A liberal is a person whose interests aren't at stake at the moment
  -- Willis Player

Hans Schippers
Research Assistant of the Research Foundation - Flanders (FWO - Vlaanderen)
http://www.win.ua.ac.be/~hschipp/
Formal Techniques in Software Engineering (FoTS)
University of Antwerp
Middelheimlaan 1
2020 Antwerpen - Belgium
Phone: +32 3 265 37 88
Fax: +32 3 265 37 77
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: javascript function with seaside callback [Fwd: generating a script containing html]

Gerhard Obermann
Hi!
> (html request callback: [ "some callback" ]) asFunctionThanks...
> Is a callback created this way supposed to rerender the current
> page?

NO!
 
I tried this:

html anchor onClick: (html javascript add: (html request callback: [self
addEntry: 'Test'])); with: 'myLink'.


You need an id for your html element, and you need a rendering method for the element content which should be updated!
Then something like this should work!

html anchor onClick: (html updater id: idOfDOMElement;
    callback: [:renderer | self addEntry: 'Test'.
                             self renderElementOn: renderer] )

br
Gerhard


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