[aida] ComboBox and CheckButton element?

Giuseppe Luigi Punzi glpunzi at lordzealon.com
Mon Aug 18 10:23:32 CEST 2008


Thanks you very much, now, is very more clear.

But this, force me to do more questions, sorry.

I will explain a little my troubles (noob troubles sorry)

I want to create a new technician on Incigest, but this technician, 
needs to be "linked" to a company.
Incigest has 'companies customers technicians' instVars. This, are for 
store a collection of companies created, customers and technicians. 
Obviously, one technician or customers, could be on 1 or more companies. 
But now, at this first aproach, I want only every Technician on 1 company.

This code, is the form for adding a new technician.

IGTechnicianApp>>viewAdd
    | e companies |
    "companies := WebAutocompleteField
                aspect: #field for: self observee choiceAspect: 
#companies: for self."
    e := WebElement new.
    e addTextH1: 'Add new technician'.
    e cell
        addText: 'Technician name:';
        addBreak.
    e cell
        addInputFieldAspect: #techName
        for: self observee.
    e newRow.
    e cell
        addText: 'BirthDate';
        addBreak.
    e cell
        addInputFieldAspect: #birthDate
        for: self observee.
    e newRow.
    e cell
        addText: 'Creation Date:';
        addBreak.
    e cell
        addInputFieldAspect: #creationDate
        for: self observee.   
    e newRow.
    e cell
        addText: 'Company:';
        addBreak.
    e cell
        addMenuCollection: (self observee parent companies) 
selectedToAspect: #company of: self observee.
    e newRow.
    e cell addButtonText: 'Add Technician'.
    self add: e

My idea (but probably I will change in next days, technicians under 
company), is to select the company where this Technician "will live". 
But the model, is not so important now.

I think the sentence:
e cell
        addMenuCollection: (self observee parent companies) 
selectedToAspect: #company of: self observee.

is Ok (thanks Rob) but...

- Wich text will be showed on drop-down?
- Why with this code I get a MNU  IGCompany>>readStream? IGCompany, 
inherits from Object

Anyway, I will change the creation of Technicians, and customers, under 
Company responsability, but I would like to understand this.

Note: OMG, so many years developing in so many languages, and Smalltalk 
still being hard to me :( I need a new brain.
Note2: Sorry for my english, is a little dificult to me to express all I 
want to say.



Rob Rothwell escribió:
> On Sun, Aug 17, 2008 at 2:18 PM, Giuseppe Luigi Punzi Ruiz 
> <glpunzi at lordzealon.com <mailto:glpunzi at lordzealon.com>> wrote:
>
>     e addMenuCollection: (self parent companies) selectedToAspect:
>     #company of: anObject.
>
>     I think this is the use but, I don't know what is the meaning of
>     "of: anObject"
>
>
> Oh...sorry...like many other Aida expressions, you "map" the values of 
> web elements to your domain objects through "aspects," which are methods.
>
> So, for example, you can have your app object do something like:
>
> MyApp>>viewMain
>
> |e|
> e := WebElement new.
>
> blah, blah, blah...
>
> e addMenuCollection: (self observee parent companies) 
> selectedToAspect: #company of: self observee.
>
> etc...
>
> Or, if you only need to "get an answer" from a view and then do 
> something with it, your App object itself can have an instance 
> variable, say "selectedCompany," and then you could do something like:
>
> e addMenuCollection: self observee parent companies selectedToAspect: 
> #selectedCompany of: self.
>
> where I am assuming that your App object has a method selectedCompany.
>
> Does this help?  Would you like me to create a small example application?
>
> Rob
>  
>
>
>
>     El 16/08/2008, a las 14:18, Rob Rothwell escribió:
>
>>     Giuseppe,
>>
>>     Do you need just a drop-down, or a real combo box?  For a drop
>>     down, you can use WebMenu:
>>
>>           e addMenuCollection: aMenuCollection selectedToAspect:
>>     anAspect aspect of: anObject.
>>
>>     For a "combo" box, I'd have to think about that...
>>
>>     To mark thinks in a Grid to delete, I am doing this:
>>
>>     abstractorListComponent
>>     | e |
>>     e := WebDataGrid new.
>>     e columnNames: #('abstractor' '' '' '' ).
>>     e columnAspects: #(#label nil nil nil ).
>>     e collection: self observee loadAbstractors.
>>     e 
>>     column: e columns size - 1
>>     addBlock: 
>>     [ :rowObject | 
>>     WebElement new 
>>     addLinkTo: rowObject currentDesignPage
>>     text: 'edit' ].
>>     e 
>>     column: e columns size - 2
>>     addBlock: 
>>     [ :rowObject | 
>>     WebElement new 
>>     addLinkTo: rowObject currentDesignPage
>>     text: 'design'
>>     view: #design ].
>>
>>     e 
>>     checkboxesColumn: e columns size
>>     collection: self observee selected.
>>     ^ e
>>
>>
>>     where you can see the checkboxesColumn:collection: method in use,
>>     as well as the idea of using a block to navigate to specific
>>     views based on a hyperlink in a grid as well.
>>
>>     To delete the items, you can reference the collection in self
>>     observee selected.  If the objects you are deleting are other web
>>     elements rendered as pages, you are about to go down the road of
>>     Aida garbage collection, and I might be able to point you in the
>>     right direction there when you get to it!
>>
>>     Take care,
>>
>>     Rob
>>
>>
>>     On Sat, Aug 16, 2008 at 5:44 AM, Giuseppe Luigi Punzi Ruiz
>>     <glpunzi at lordzealon.com <mailto:glpunzi at lordzealon.com>> wrote:
>>
>>         Hi all,
>>
>>         I need a ComboBox component to fill with a collection, and
>>         retrieve
>>         the option selected, and CheckButtons to put on every row of
>>         a Grid,
>>         to mark things to delete, but I don't find something like
>>         this on Aida-
>>         Elements and/or Documentation. Somebody can help?
>>
>>         Cheers.
>>         _______________________________________________
>>         Aida mailing list
>>         Aida at aidaweb.si <mailto:Aida at aidaweb.si>
>>         http://lists.aidaweb.si/mailman/listinfo/aida
>>
>>
>>     _______________________________________________
>>     Aida mailing list
>>     Aida at aidaweb.si <mailto:Aida at aidaweb.si>
>>     http://lists.aidaweb.si/mailman/listinfo/aida
>
>

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: SqueakDebug.log
Url: http://lists.aidaweb.si/pipermail/aida/attachments/20080818/f3c2d762/attachment-0001.bat 


More information about the Aida mailing list