[Seaside] help to use routing with seaside

Cyril Ferlicot D. cyril.ferlicot at gmail.com
Wed May 16 19:08:24 UTC 2018


Le 16/05/2018 à 20:57, feav feav a écrit :
> 
> we can not realize a whole web application with a single url. that's why
> I want to set up a road-controller-Model system
> 

Hi,

In seaside by default you do not need to care for URLs.

Navigation in Seaside is not done as in classic web frameworks. By
default if you add an anchor to your page you can associate it with a
callback.

For example:

renderContentOn: html
  self counter ifNil: [ self counter: 0 ].

  html text: self counter.

  html anchor
    callback: [ self counter: self counter + 1 ];
    with: 'Increment'

In this rendering method you create a new anchor that will increment a
counter when clicked. The page will refresh and be re-drawn with the new
model behind (the counter incremented).

The URL of the anchor will be generated automatically by seaside. It
will be something like:
http://localhost:8080/MyApplication?_s=sr8lZ498rCXXt1_u&_k=FSAMnCtwxdLaoep6

Of course sometimes you want to be able to define the URL yourself. I
think that was the purpose of Setphan's question. What is your goal?
Knowing that we can know if you need to define your URLs by yourself or
if the default behaviour of Seaside is enough.


> *Cordialement, Armel EMBOLO*
> <https://accounts.google.com/SignOutOptions?hl=fr&continue=https://mail.google.com/mail&service=mail>
> *_Ingénieur de travaux en Informatique de Gestion / Analyste programmeur_*
> *Elève Ingénieur de Conception  en Génie Logiciel*
> *Université de Maroua, _Ecole Nationale Supérieure Polytechnique de
> Maroua (ex ISS)_
> *
> *Facebook : Armel Embolo <https://www.facebook.com/armel.embolo>
> *
> *Linkedin : armel embolo
> <https://www.linkedin.com/profile/view?id=AAMAABYswuMBn33mi4o_x8R49OxfxiIQVAryzw4&trk=hp-identity-name>
> *
> *Tel : (+237) 650231339/698594740*
> 
-- 
Cyril Ferlicot
https://ferlicot.fr


More information about the seaside mailing list