help-smalltalk
[Top][All Lists]
Advanced

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

[Help-smalltalk] Iliad: did widgets change, too?


From: Bèrto ëd Sèra
Subject: [Help-smalltalk] Iliad: did widgets change, too?
Date: Wed, 11 Nov 2009 07:12:28 +0200

Hi!

it may have been because of some misunderstanding of mine on previous
versions, but I'm currently a bit puzzled at the way examples in 0.7.1
look. My existing code was deriving a hierarchy from
- Iliad.Widget
  - LocalizedWidget
     - AmbaradanLocalizedWidget
       - WidgetSearch

the actual WidgetSearch class had a #contents message in <building>
that was making the HTML for the form. I was now to implement the
effect of making a search and had a new look at how widgets work in
examples (say, the Blog example)... and I find that
1) there is no direct hierarchy from Iliad.Widget, the widget is a
subclass of Object and turns into a widget by an #asWidget message
2) components are not declared in a #contents message, but rather at
class level, with a #descriptionFieldname message

So, at application level:

actionsContents [
        <category: 'building'>
        ^[:e |
            | div |
            div := (e div)
                class: 'actions';
                yourself.
            div a
                text: 'new post';
                action: [self addPost]]
    ]

behaves more or less like I was used to. Yet, addPost goes

addPost [
        <category: 'actions'>
        self
            show: (((BlogPost new asWidget)
                addValidatedForm;
                yourself) addMessage: [:e | e h3:'Add new post'])
            onAnswer: [:ans | ans ifNotNil: [self model posts add: ans]]
    ]

which shows the form on a blank page and processes the input. At this
point I see a 'model' thing that kind of naturally recalls views and
controller we already met, but I cannot remember seeing anything that
would explain how to use them properly.

Now I'll better describe what I'm trying to do. My example app is here
http://www.voxhumanitatis.net/ambaradan (it works with ff3.5 only
AFAIK) what I want is to enable the search widget and have it print
out its results in the central white space (which is currently not a
widget proper, but simply a div called 'centralDiv'). On showing up
the results it must append the query to the widgetHistory on the left,
so that one can keep track of his own searches.

I'm not asking you to write code for me, obviously, but I'd really
appreciate a basic guidance as per what is a "canonical" approach to
widgets in Iliad, so I can avoid wasting time :)

Berto
-- 
==============================
Constitution du 24 juin 1793 - Article 35. - Quand le gouvernement
viole les droits du peuple, l'insurrection est, pour le peuple et pour
chaque portion du peuple, le plus sacré des droits et le plus
indispensable des devoirs.




reply via email to

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