help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] Re: html element id facility?


From: Nicolas Petton
Subject: Re: [Help-smalltalk] Re: html element id facility?
Date: Fri, 26 Jun 2009 17:07:25 +0200

Le vendredi 26 juin 2009 à 13:02 +0200, Stefan Schmiedl a écrit :
> On Fri, 26 Jun 2009 12:42:37 +0200
> Nicolas Petton <address@hidden> wrote:
> 
> > Le vendredi 26 juin 2009 à 09:23 +0200, Stefan Schmiedl a écrit :
> > > Hi Nico,
> > > 
> > 
> > Hi Stefan,
> > 
> > 
> > > does Iliad have any facility for generating unique element ids
> > > (like nextId in Seaside)?
> > > 
> > 
> > Yes, you can use Iliad.Id or Iliad.Session>>nextId
> > 
> > e div id: self session nextId.
> > e div id: Id new.
> 
> Will I break something if I stupidly mix these two different ways?

no :)
> 
> > 
> > > I've been brooding about how to work with labels and checkboxes
> > > being used in a list of multiple choice questions.
> > 
> > Maybe I should write something about forms and actions in Iliad?
> 
> You can write whatever you want on Iliad, I'll read it :-)
> 
> > It basically works like anchors:
> > 
> > | form |
> > form := e form.
> > form checkbox 
> >     action: [:boolean | self doSomethingWith: boolean];
> >     checked: true.
> > form button 
> >     text: 'submit'
> 
> I am coming to this later today .-)
> 
> My current plan is to _not_ use any forms, instead have every
> radiobutton submit a request to the server after being activated.
> Probably some 
>       e radioButton onChange: [...]
> thing I assume.
> 
> On a side note: 
> 
> I'll have lots of places showing things like
> 
>   6*9=42   o true   o false   o don't know
> 
> hence I feel the strong need for collecting label and radiobutton into
> a single object, which would be descendant of Element, right?
> Ideally, I'll end today having code like
> 
>   [:e | 
>     e text: '6*9=42'.
>     model answers do: [ :a | 
>       e radioButton: a label; onChange: [ whatever: a value ]
>     ]
>   ]

In the latest revision (I changed the implementation of radio buttons),
something like this should work :

| form |
form := e form.
model answers do: [:each |
        form radioButton
                group: 'answers';
                action: [self whatever: each].
        form text: each; break]

About the submit on change, there are two possibilities right now:

1. use onChange: 'submit()', but it won't use an AJAX request
2. use onChange:
'Iliad.evaluateFormAction(jQuery(this).closest("form"))' 

I know, the latest is tricky...

Cheers!

Nico

Attachment: signature.asc
Description: Ceci est une partie de message numériquement signée


reply via email to

[Prev in Thread] Current Thread [Next in Thread]