Iliad (#show:onAnswer:)

Tagged:

Hi!

Just a short example of the #show:onAnswer: method of Iliad.

You can call an additional web-page in Iliad and continue afterwards, if the user ends the work on that page, in the same web-page, where you started the call to this page without wild tricks...

So I created a new page for the I forgot my password case for the login dialog.

It looks like this:

UrPics.PageTemplate subclass: ForgotPassword [
    | email |

    email [ ^email ifNil: [email := '']]
    email: anEmail [email := anEmail]

    mainContent [
        ^[ :e |
            | div form table row data |
            div := e div.
            div h1: 'Forgot Password'.
            form := div form.
            table := form table.
            row := table tableRow.
            row tableData text: 'Please enter your email address:'.
            row tableData input
                value: self email;
                size: 40;
                action: [:val | self email: val].
            row := table tableRow.
            row tableData.
            data := row tableData.
            data button
                action:  [self answer: 'asdf'];
                text: 'Send me a new one, please'.
            data button
                action: [self answer: nil];
                text: 'Cancel'.
            e break; break.
        ]
    ]

]

It's a simple form, which is not realy generating a password and without any sending of the password via mail. But it should only show, how you use the #show:onAnswer: method.

You see, in both cases of the buttons in this form, I provide some data to the method answer:. In one case the new highly secured password and in the other case of the cancel-button nil.

That's all to do in this dialog.

Into the Login dialog I only add this three lines to the contens: method:

div anchor
    action: [
        self
            show: ForgotPassword new 
            onAnswer: [:val |
                ('return value = ', val printString) printNl
            ]
    ];
    text: 'I forgot my password'.

That's all!

Now you saw, how to call another web-page, without any great hassle.

Happy coding!
Joachim.

I think you've combined the best parts of Seaside and AIDA/Web. Seaside's call and answer facility is obviously an extremely powerful feature for creating re-usable components. Yet AIDA/Web's simple composable GUI-building approach also leads to rapid element and widget construction.

I think you're on to something here.

May I ask, though, if Iliad will be ported to Squeak? I'd like to give it a try.

Iliad is developped under gst, but a port is on its way.
I will probably release both versions at the same time.

Cheers!

Nico

That's great. I'll be looking forward to the Squeak release.

There's one feature that I like from Seaside: the use of decorators to dynamically add new behavior and functionality to WAComponent at run-time. This facilitates building libraries of reusable decorators.

Can you show an example of using decorators in Iliad?

Thanks,

Hentai

User login