Duplicated Menu

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

Duplicated Menu

Giuseppe
Hi all,

I think I asked this before, but I don't remember it. I was out from
Squeak since some time ago, and I'm returning to my little projects.

I have the following method:

IncigestApp>>companyMnu
    | e |
    e := WebElement new.
    e
        addButtonText: '<- Back '
        action: #back.
    e addSpace.
    e
        addButtonText: 'New Company'
        action: #addCompany.
    e addBreak.
    e addBreak.
    ^ self add: e


And on my view I have.

IncigestApp>>viewCompanies
    | e |
    e := WebElement new.
    e addTextH1: 'Companies'.
"    e add: self companyMnu."
    e table class: #webGrid.
    self observee companies do:
        [ :each |
        e cell addText: each companyName.
        e newCell
            addLinkTo: each
            text: each cif.
        e newCell addText: each address.
        e newCell
            align: #center;
            addText: each city.
        e newRow ].

    e add: self companyMnu.
    e title: 'InciGest: Incident Management'.
    self add: e


As you can see on the code, I want 2 menus, one first (under Companies
title), and other at the bottom. As you can see, I get 2 menus, but, on
the code, first is commented, I don't know from where the first menu is
showen.

If I uncomment it, I get 4 "menus" as companyMnu2.JPG attached.

I want the menus like companyMnu2.JPG (attached too) but without the 2
first menus thath is out of the "frame", I don't know why this behaviour.

Thanks for your time and I hope I explained it well.

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

companyMnu.JPG (53K) Download Attachment
companyMnu2.JPG (47K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Duplicated Menu

Janko Mivšek
Hi Giuseppe,

Giuseppe Luigi Punzi wrote:

> Hi all,
>
> I think I asked this before, but I don't remember it. I was out from
> Squeak since some time ago, and I'm returning to my little projects.
>
> I have the following method:
>
> IncigestApp>>companyMnu
>    | e |
>    e := WebElement new.
>    e
>        addButtonText: '<- Back '
>        action: #back.
>    e addSpace.
>    e
>        addButtonText: 'New Company'
>        action: #addCompany.
>    e addBreak.
>    e addBreak.
>    ^ self add: e
>
>
> And on my view I have.
>
> IncigestApp>>viewCompanies
>    | e |
>    e := WebElement new.
>    e addTextH1: 'Companies'.
> "    e add: self companyMnu."
>    e table class: #webGrid.
>    self observee companies do:
>        [ :each |
>        e cell addText: each companyName.
>        e newCell
>            addLinkTo: each
>            text: each cif.
>        e newCell addText: each address.
>        e newCell
>            align: #center;
>            addText: each city.
>        e newRow ].
>
>    e add: self companyMnu.
>    e title: 'InciGest: Incident Management'.
>    self add: e

Add that buttons in companyMnu to table cell instead:

        e cell add: self companyMnu.

Also, set title directly to the app, not to the element e:

        self title: 'title'

Let us know if this helps.

Best regards
Janko




>
>
> As you can see on the code, I want 2 menus, one first (under Companies
> title), and other at the bottom. As you can see, I get 2 menus, but, on
> the code, first is commented, I don't know from where the first menu is
> showen.
>
> If I uncomment it, I get 4 "menus" as companyMnu2.JPG attached.
>
> I want the menus like companyMnu2.JPG (attached too) but without the 2
> first menus thath is out of the "frame", I don't know why this behaviour.
>
> Thanks for your time and I hope I explained it well.
>
> ------------------------------------------------------------------------
>
>
> ------------------------------------------------------------------------
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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: Duplicated Menu

Giuseppe
Hi Janko,

The new method.
IncigestApp>>viewCompanies
    | e |
    e := WebElement new.
    e addTextH1: 'Companies'.
    e table class: #webGrid.
    e cell add: self companyMnu.
    e newRow.
    self observee companies do:
        [ :each |
        e cell addText: each companyName.
        e newCell
            addLinkTo: each
            text: each cif.
        e newCell addText: each address.
        e newCell
            align: #center;
            addText: each city.
        e newRow ].
    e newRow.
    e cell add: self companyMnu.
    self title: 'InciGest: Incident Management'.
    self add: e

Same result. Image attached.

Online Access:
http://81.33.224.143:8888/incigest.html
or
http://regnamurcia.dyndns.org:8888/incigest.html

The code under InciGest-glp.16.mcz is on
MCHttpRepository
    location: 'http://www.lordzealon.com/mc'
    user: ''
    password: ''

Cheers.


Janko Mivšek escribió:

> Hi Giuseppe,
>
> Giuseppe Luigi Punzi wrote:
>  
>> Hi all,
>>
>> I think I asked this before, but I don't remember it. I was out from
>> Squeak since some time ago, and I'm returning to my little projects.
>>
>> I have the following method:
>>
>> IncigestApp>>companyMnu
>>    | e |
>>    e := WebElement new.
>>    e
>>        addButtonText: '<- Back '
>>        action: #back.
>>    e addSpace.
>>    e
>>        addButtonText: 'New Company'
>>        action: #addCompany.
>>    e addBreak.
>>    e addBreak.
>>    ^ self add: e
>>
>>
>> And on my view I have.
>>
>> IncigestApp>>viewCompanies
>>    | e |
>>    e := WebElement new.
>>    e addTextH1: 'Companies'.
>> "    e add: self companyMnu."
>>    e table class: #webGrid.
>>    self observee companies do:
>>        [ :each |
>>        e cell addText: each companyName.
>>        e newCell
>>            addLinkTo: each
>>            text: each cif.
>>        e newCell addText: each address.
>>        e newCell
>>            align: #center;
>>            addText: each city.
>>        e newRow ].
>>
>>    e add: self companyMnu.
>>    e title: 'InciGest: Incident Management'.
>>    self add: e
>>    
>
> Add that buttons in companyMnu to table cell instead:
>
> e cell add: self companyMnu.
>
> Also, set title directly to the app, not to the element e:
>
> self title: 'title'
>
> Let us know if this helps.
>
> Best regards
> Janko
>
>
>
>
>  
>> As you can see on the code, I want 2 menus, one first (under Companies
>> title), and other at the bottom. As you can see, I get 2 menus, but, on
>> the code, first is commented, I don't know from where the first menu is
>> showen.
>>
>> If I uncomment it, I get 4 "menus" as companyMnu2.JPG attached.
>>
>> I want the menus like companyMnu2.JPG (attached too) but without the 2
>> first menus thath is out of the "frame", I don't know why this behaviour.
>>
>> Thanks for your time and I hope I explained it well.
>>
>> ------------------------------------------------------------------------
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Aida mailing list
>> [hidden email]
>> http://lists.aidaweb.si/mailman/listinfo/aida
>>    
>
>  

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

companyMnu3.JPG (44K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Duplicated Menu

Janko Mivšek
Giuseppe Luigi Punzi wrote:

>>> IncigestApp>>companyMnu
>>>    | e |
>>>    e := WebElement new.
>>>    e
>>>        addButtonText: '<- Back '
>>>        action: #back.
>>>    e addSpace.
>>>    e
>>>        addButtonText: 'New Company'
>>>        action: #addCompany.
>>>    e addBreak.
>>>    e addBreak.
>>>    ^ self add: e

Aha! Look at the last line! You need to return this element, not add it
to the app. That's why you have 4 occurrences of that menu on your app
view. So: ^e !

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: Duplicated Menu

Giuseppe
I love you.


Janko Mivšek escribió:

> Giuseppe Luigi Punzi wrote:
>
>  
>>>> IncigestApp>>companyMnu
>>>>    | e |
>>>>    e := WebElement new.
>>>>    e
>>>>        addButtonText: '<- Back '
>>>>        action: #back.
>>>>    e addSpace.
>>>>    e
>>>>        addButtonText: 'New Company'
>>>>        action: #addCompany.
>>>>    e addBreak.
>>>>    e addBreak.
>>>>    ^ self add: e
>>>>        
>
> Aha! Look at the last line! You need to return this element, not add it
> to the app. That's why you have 4 occurrences of that menu on your app
> view. So: ^e !
>
> Janko
>
>  

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