Aida tutorial

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

Aida tutorial

Herbert König
Greetings everybody,

this is my first visit here. And I'll appear a bit wordy.

I started AidaWeb (any kind of web programming for that matter) with
the tutorial. I very much liked the idea of view.. and action..
methods and ..App classes and everything seemed easy.

I managed to add the "Back to Address Book" link to the addressApp's
viewMain by linking back:

e addLinkTo: self observee book text: 'Back to Address Book'.

For this I added book to the address so it could reference its book.
I didn't manage to do this via a button.

Next I wanted to add a cancel button to the add a new entry view. I'm
thinking GUI not web here so cancel should go back to the address book
without adding the new address.

I didn't manage this, though I found out about the naming convention
in #addButtonText:action:.

I tried
e cell addButtonText: 'Cancel' action: #actionAddCancel
having an #actionCancel and an #actionAddCancel (just in case)
implemented like:

actionCancel
    self redirectToView: #main.

I think these should be added to the tutorial (I'm willing to, if
shown how to edit it) as well as well as being able to change an
address in the addresses #viewMain (I guess I'll manage).

Also edit in line in the main address book (maybe I'll have to ask but
will try first).

As my own plans will require users to enter many point coordinates I
want to display only 10 or 20 addresses on the main address book
page so the "Add an entry" always stays visible. Most of this is
easily done in the model so I'll manage. As soon as I get several
buttons to work I'll also manage the necessary navigation.

This should less than double the tutorial and my belief is that the
tutorial should end with the address book in a more usable state. It
should definitely not get as lengthy as Stepahn Wessels laser game
tutorial.

To sum it up:
can someone please tell me how to get two buttons on one view working
and should I add a bit more to the tutorial?


--
Cheers,

Herbert                          mailto:[hidden email]

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Aida tutorial

Janko Mivšek
Hello Herbert,

Herbert König wrote:
> Greetings everybody,
>
> this is my first visit here. And I'll appear a bit wordy.

Welcome to the list and the Aida community. I hope you'll have a lot of
fun with us!

> I started AidaWeb (any kind of web programming for that matter) with
> the tutorial. I very much liked the idea of view.. and action..
> methods and ..App classes and everything seemed easy.
>
> I managed to add the "Back to Address Book" link to the addressApp's
> viewMain by linking back:
>
> e addLinkTo: self observee book text: 'Back to Address Book'.
>
> For this I added book to the address so it could reference its book.
> I didn't manage to do this via a button.

Why would you make a back link with button?

> Next I wanted to add a cancel button to the add a new entry view. I'm
> thinking GUI not web here so cancel should go back to the address book
> without adding the new address.
>
> I didn't manage this, though I found out about the naming convention
> in #addButtonText:action:.
>
> I tried
> e cell addButtonText: 'Cancel' action: #actionAddCancel

action: #cancel !

> having an #actionCancel and an #actionAddCancel (just in case)
> implemented like:
>
> actionCancel
>     self redirectToView: #main.

#actionAddCancel !

> I think these should be added to the tutorial (I'm willing to, if
> shown how to edit it) as well as well as being able to change an
> address in the addresses #viewMain (I guess I'll manage).

I agree, good idea. It seems that action naming conventions are not
clear enough. Did you check programming guide too?


> Also edit in line in the main address book (maybe I'll have to ask but
> will try first).

This could be fine for introduction into Ajax, let's say in next chapter
of tutorial. With in-place editing component for instance.

> As my own plans will require users to enter many point coordinates I
> want to display only 10 or 20 addresses on the main address book
> page so the "Add an entry" always stays visible. Most of this is
> easily done in the model so I'll manage. As soon as I get several
> buttons to work I'll also manage the necessary navigation.

This is like adding comments in many blogs? Note also that you can
initially hide such form and show it with click on some url link.

> This should less than double the tutorial and my belief is that the
> tutorial should end with the address book in a more usable state. It
> should definitely not get as lengthy as Stepahn Wessels laser game
> tutorial.

I agree, let we therefore open a second chapter of tutorial with more
advanced features. Ajax specially because it is so easy to do in Aida.

But let we put a Cancel button in existing tutorial. Shall we add back
references from Address to AddressBook here too?

> To sum it up:
> can someone please tell me how to get two buttons on one view working
> and should I add a bit more to the tutorial?

I hope above answers will help!

Janko


--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Aida tutorial

Herbert König
Hello Janko,

JM> Welcome to the list and the Aida community. I hope you'll have a lot of
JM> fun with us!
thank you, and yes I think we will.

>> For this I added book to the address so it could reference its book.
>> I didn't manage to do this via a button.
JM> Why would you make a back link with button?

I think more GUI than Web. For now it doesn't matter but later on I
will need a (more fancy looking) button. A fancy link is ok too.


>> Next I wanted to add a cancel button to the add a new entry view. I'm
>> thinking GUI not web here so cancel should go back to the address book
>> without adding the new address.
>>
>> I didn't manage this, though I found out about the naming convention
>> in #addButtonText:action:.
>>
>> I tried
>> e cell addButtonText: 'Cancel' action: #actionAddCancel

JM> action: #cancel !

>> having an #actionCancel and an #actionAddCancel (just in case)
>> implemented like:
>>
>> actionCancel
>>     self redirectToView: #main.

JM> #actionAddCancel !

Well I've tried all four possible combinations and cancel still adds
the entry. I use a 3.8.2 image with a Win 3.10.6 VM if that matters.

>> I think these should be added to the tutorial (I'm willing to, if
>> shown how to edit it) as well as well as being able to change an
>> address in the addresses #viewMain (I guess I'll manage).

JM> I agree, good idea. It seems that action naming conventions are not
JM> clear enough. Did you check programming guide too?

I did and it more or less quotes the comment. So my first attempt was
to have in viewAdd a line:
 e cell addButtonText: 'Cancel' action: #actionCancel.
and create a method:
actionAddCancel
    self redirectToView: #main.
But from this convention a I understand it the add action should be
named #actionAddAdd for the view being add and the action being add.


>> Also edit in line in the main address book (maybe I'll have to ask but
>> will try first).

JM> This could be fine for introduction into Ajax, let's say in next chapter
JM> of tutorial. With in-place editing component for instance.

Definitely yes.

>> As my own plans will require users to enter many point coordinates I
>> want to display only 10 or 20 addresses on the main address book
>> page so the "Add an entry" always stays visible. Most of this is
>> easily done in the model so I'll manage. As soon as I get several
>> buttons to work I'll also manage the necessary navigation.

JM> This is like adding comments in many blogs? Note also that you can
JM> initially hide such form and show it with click on some url link.

No, the points form a closed polygon of e.g. the cross section of a
road. Other than the address book where the main use is reading the
main work here is to enter points.

So this should require few mouse miles (I claim copyright for this
term :-)) and little waiting on a server. Ideally the user has the
fingers on the numerical block of the keyboard without touching the
mouse or any other key.

>> This should less than double the tutorial and my belief is that the
>> tutorial should end with the address book in a more usable state. It
>> should definitely not get as lengthy as Stepahn Wessels laser game
>> tutorial.

JM> I agree, let we therefore open a second chapter of tutorial with more
JM> advanced features. Ajax specially because it is so easy to do in Aida.

JM> But let we put a Cancel button in existing tutorial. Shall we add back
JM> references from Address to AddressBook here too?

Yes. I think edit an address in the addressApp's view and delete an
entry (maybe same place at first) should go into the first chapter.
The tutorial is beautifully short and should stay that way. But I
would wish that in the and of a tutorial the learner should say:
"Wow there is a fully operational app built in this few steps and I
know everything to extend it to a real address book (mobile, business
phone, address, different summary views).

In the end it's your child and you decide.

JM> I hope above answers will help!

Dunno why I don't get the cancel button working but I'll continue with
the other steps outlined in the first post.


Cheers,

Herbert                            mailto:[hidden email]

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Aida tutorial

Herbert König
Oops,

HK> Well I've tried all four possible combinations and cancel still adds
HK> the entry. I use a 3.8.2 image with a Win 3.10.6 VM if that matters.

3.10.10 VM that is

Cheers

Herbert                            mailto:[hidden email]

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Aida tutorial

Janko Mivšek
In reply to this post by Herbert König
Herbert,

I updated the tutorial and completely rewrote the Forms chapter using a
pattern which I found most useful.

Would you check and follow it to see how understandable is? Note also
that you need to add initialization to Address, see first chapter.

Best regards
Janko

Herbert König wrote:

> Hello Janko,
>
> JM> Welcome to the list and the Aida community. I hope you'll have a lot of
> JM> fun with us!
> thank you, and yes I think we will.
>
>>> For this I added book to the address so it could reference its book.
>>> I didn't manage to do this via a button.
> JM> Why would you make a back link with button?
>
> I think more GUI than Web. For now it doesn't matter but later on I
> will need a (more fancy looking) button. A fancy link is ok too.
>
>
>>> Next I wanted to add a cancel button to the add a new entry view. I'm
>>> thinking GUI not web here so cancel should go back to the address book
>>> without adding the new address.
>>>
>>> I didn't manage this, though I found out about the naming convention
>>> in #addButtonText:action:.
>>>
>>> I tried
>>> e cell addButtonText: 'Cancel' action: #actionAddCancel
>
> JM> action: #cancel !
>
>>> having an #actionCancel and an #actionAddCancel (just in case)
>>> implemented like:
>>>
>>> actionCancel
>>>     self redirectToView: #main.
>
> JM> #actionAddCancel !
>
> Well I've tried all four possible combinations and cancel still adds
> the entry. I use a 3.8.2 image with a Win 3.10.6 VM if that matters.
>
>>> I think these should be added to the tutorial (I'm willing to, if
>>> shown how to edit it) as well as well as being able to change an
>>> address in the addresses #viewMain (I guess I'll manage).
>
> JM> I agree, good idea. It seems that action naming conventions are not
> JM> clear enough. Did you check programming guide too?
>
> I did and it more or less quotes the comment. So my first attempt was
> to have in viewAdd a line:
>  e cell addButtonText: 'Cancel' action: #actionCancel.
> and create a method:
> actionAddCancel
>     self redirectToView: #main.
> But from this convention a I understand it the add action should be
> named #actionAddAdd for the view being add and the action being add.
>
>
>>> Also edit in line in the main address book (maybe I'll have to ask but
>>> will try first).
>
> JM> This could be fine for introduction into Ajax, let's say in next chapter
> JM> of tutorial. With in-place editing component for instance.
>
> Definitely yes.
>
>>> As my own plans will require users to enter many point coordinates I
>>> want to display only 10 or 20 addresses on the main address book
>>> page so the "Add an entry" always stays visible. Most of this is
>>> easily done in the model so I'll manage. As soon as I get several
>>> buttons to work I'll also manage the necessary navigation.
>
> JM> This is like adding comments in many blogs? Note also that you can
> JM> initially hide such form and show it with click on some url link.
>
> No, the points form a closed polygon of e.g. the cross section of a
> road. Other than the address book where the main use is reading the
> main work here is to enter points.
>
> So this should require few mouse miles (I claim copyright for this
> term :-)) and little waiting on a server. Ideally the user has the
> fingers on the numerical block of the keyboard without touching the
> mouse or any other key.
>
>>> This should less than double the tutorial and my belief is that the
>>> tutorial should end with the address book in a more usable state. It
>>> should definitely not get as lengthy as Stepahn Wessels laser game
>>> tutorial.
>
> JM> I agree, let we therefore open a second chapter of tutorial with more
> JM> advanced features. Ajax specially because it is so easy to do in Aida.
>
> JM> But let we put a Cancel button in existing tutorial. Shall we add back
> JM> references from Address to AddressBook here too?
>
> Yes. I think edit an address in the addressApp's view and delete an
> entry (maybe same place at first) should go into the first chapter.
> The tutorial is beautifully short and should stay that way. But I
> would wish that in the and of a tutorial the learner should say:
> "Wow there is a fully operational app built in this few steps and I
> know everything to extend it to a real address book (mobile, business
> phone, address, different summary views).
>
> In the end it's your child and you decide.
>
> JM> I hope above answers will help!
>
> Dunno why I don't get the cancel button working but I'll continue with
> the other steps outlined in the first post.
>
>
> Cheers,
>
> Herbert                            mailto:[hidden email]
>
> _______________________________________________
> Aida mailing list
> [hidden email]
> http://lists.aidaweb.si/mailman/listinfo/aida
>

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Aida tutorial

Herbert König
Hello Janko,

JM> Would you check and follow it to see how understandable is? Note also
JM> that you need to add initialization to Address, see first chapter.

I'm doing and I got stuck.
Don't take this as complaints, I have the opposite of the Midas touch.
Everything Midas turned into gold, when I touch things they turn into
.... This make me good in testing software, which is part of my
profession.

This is what I did:
I got me a fresh 3.10.2 image. Being without my usual tools should
help to follow the tutorial more closely.

First, why is the text not wordwrapping? it's too wide to have two
windows (Browser and Squeak) side by side on one screen.

ADemoaddress:
using name as an ivar seemed to collide with my 3.8.2, so there I used
firstName. Let me see what happens in 3.10.

Again I ran into the name problem, the web browser shows an ADemoAdress
instead of the first name. Problem is, that Object defines #name
already, so auto creating accessors (which I did) omits creating #name.

So I went back to changing the ivar of ADemoAddress to firstName, the
accessor and the initialize as well as classSide's newName: ....

Then in an Explorer I changed the firstName ivars of the three
already existing addresses.

Then in the ...App class I always send #firstName instead of name.
Then I changed the Workspace to use firstName: instead of name.

Then I changed the sequence of things and implemented #preferredUrl
before displaying the first address in the browser. And knowing I
would enter my family, I implemented it as:
^'address/', self firstName, '_', self surname, '.html'

Then I implemented the links in the address books #viewMain and got a
404 not found on http://localhost:8888/address/sebastjan_dormir.html.
Being new to web programming I thought the '_' might be bad in an url
but I also got 404 for http://localhost:8888/address/heinzriese.html

So now I will take my 3.8 code and compare it to the 3.10 code to look
for errors. Sorry I don't have an old version of the tutorial to
compare it against the new one. Maybe you can help me out with that.

Some more remarks:

New defined as ^super new initialize is owed to dialects other than
Squeak and does no harm in Squeak? It just seemed uncommon from my
Squeak perspective.

I would put the first opening of the web page directly behind the
definition of viewMain. Let people see what they have done before
talking about it.

The paragraph after mentioning the convenience methods might read:

The *last* line of our example adds our element into a page and frames it
with a standard header and navigation bar on the left. Try to change
that to add directly to self (self add: e) *to get an unadorned page after
refreshing your browser*.

I'm writing tutorials _and_ have to answer the hotline. So I've been
bitten by my ambiguous or incomplete wordings more than once :-))

Now I'll start debugging. I'll report later.

Cheers

Herbert                            mailto:[hidden email]

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Aida tutorial found my Error

Herbert König
Hello,

HK> I'm doing and I got stuck.
found the bug
HK> ^'address/', self firstName, '_', self surname, '.html'
missed the first '/' in ^'/address/' ...

Will continue.

Cheers


Herbert                            mailto:[hidden email]

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Aida tutorial

Herbert König
In reply to this post by Janko Mivšek
Hello Janko,

JM> Would you check and follow it to see how understandable is? Note also
JM> that you need to add initialization to Address, see first chapter.

after finding my error the remainder worked smoothly.

The add/edit view reusing is a neat trick!

Just one more remark:
5.1 Prefered urls imho could use the following addition before "Now we
are ready to make links to our addresses:"

"Note that the URL for an object is created when it first is
displayed on a form. So the nicer URL's will show up only for
addresses created subsequently."

Because people might go searching for their typo if the new URL's
don't show up, following the old programmers saying "the error is
usually in front of the screen".

First of the two sentences might need some correction.


Cheers

Herbert                            mailto:[hidden email]

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida