ComboBox and CheckButton element?

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

ComboBox and CheckButton element?

Giuseppe
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
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: ComboBox and CheckButton element?

Rob Rothwell
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.
column: e columns size - 1
addBlock: 
[ :rowObject | 
WebElement new 
addLinkTo: rowObject currentDesignPage
text: 'edit' ].
column: e columns size - 2
addBlock: 
[ :rowObject | 
WebElement new 
addLinkTo: rowObject currentDesignPage
text: 'design'
view: #design ].

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 <[hidden email]> 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
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida


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

Re: ComboBox and CheckButton element?

Giuseppe
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"

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.
column: e columns size - 1
addBlock: 
[ :rowObject | 
WebElement new 
addLinkTo: rowObject currentDesignPage
text: 'edit' ].
column: e columns size - 2
addBlock: 
[ :rowObject | 
WebElement new 
addLinkTo: rowObject currentDesignPage
text: 'design'
view: #design ].

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 <[hidden email]> 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
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida

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


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

Re: ComboBox and CheckButton element?

Janko Mivšek
Giuseppe Luigi Punzi Ruiz 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"

Selection will be stored into anObject with calling an aspect method.
For instance selectedToAspect: #name of: aPerson will call aPerson name:
'selected name'. It will also preselect a menu choice by calling aPerson
name, when this menu is built.

Best regards
Janko


>
> 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
>> <[hidden email] <mailto:[hidden email]>> 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
>>     [hidden email] <mailto:[hidden email]>
>>     http://lists.aidaweb.si/mailman/listinfo/aida
>>
>>
>> _______________________________________________
>> Aida mailing list
>> [hidden email] <mailto:[hidden email]>
>> http://lists.aidaweb.si/mailman/listinfo/aida
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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: ComboBox and CheckButton element?

Giuseppe
In reply to this post by Giuseppe
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
> <[hidden email] <mailto:[hidden email]>> 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
>>     <[hidden email] <mailto:[hidden email]>> 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
>>         [hidden email] <mailto:[hidden email]>
>>         http://lists.aidaweb.si/mailman/listinfo/aida
>>
>>
>>     _______________________________________________
>>     Aida mailing list
>>     [hidden email] <mailto:[hidden email]>
>>     http://lists.aidaweb.si/mailman/listinfo/aida
>
>

MessageNotUnderstood: IGCompany>>readStream 18 August 2008 9:47:04 am VM: Win32 - a SmalltalkImage Image: Squeak3.10.2 [latest update: #7179] SecurityManager state: Restricted: false FileAccess: true SocketAccess: true Working Dir E:\Desarrollo\Squeak3.10.2-7179-glp Trusted Dir E:\Desarrollo\Squeak3.10.2-7179-glp\Giuseppe Untrusted Dir C:\My Squeak\Giuseppe IGCompany(Object)>>doesNotUnderstand: #readStream Receiver: an IGCompany Arguments and temporary variables: aMessage: readStream Receiver's instance variables: companyName: 'Regna Murcia' cif: 'E123456789' address: 'C/ Mariano Girada' city: 'Murcia' parent: nil AIDASite class>>convert:toCodepage: Receiver: AIDASite Arguments and temporary variables: aString: an IGCompany aSymbol: #'UTF_8' encoding: #'UTF_8' converter: an UTF8TextConverter in: nil out: nil Receiver's instance variables: superclass: Site methodDict: a MethodDictionary(size 139) format: 154 instanceVariables: #('style' 'settings' 'systemServices' 'userServices' 'timest...etc... organization: ('private-serving' addAllowHeaderTo: addDontCacheHeaderTo:forPage...etc... subclasses: nil name: #AIDASite classPool: a Dictionary(#Default->nil #Instance->nil #SloveneCharacters->nil ) sharedPools: nil environment: a SystemDictionary(lots of globals) category: #'Aida-Core' traitComposition: nil localSelectors: nil AIDASite class>>convertToWeb:on: Receiver: AIDASite Arguments and temporary variables: aString: an IGCompany aSession: a WebSession Receiver's instance variables: superclass: Site methodDict: a MethodDictionary(size 139) format: 154 instanceVariables: #('style' 'settings' 'systemServices' 'userServices' 'timest...etc... organization: ('private-serving' addAllowHeaderTo: addDontCacheHeaderTo:forPage...etc... subclasses: nil name: #AIDASite classPool: a Dictionary(#Default->nil #Instance->nil #SloveneCharacters->nil ) sharedPools: nil environment: a SystemDictionary(lots of globals) category: #'Aida-Core' traitComposition: nil localSelectors: nil [] in WebMenu>>printOptionsOn: {[:each |  option := self aspect isNil     ifTrue: [each]     ifFalse: [each ...]} Arguments and temporary variables: aStream: a WriteStream '<!-- AIDA/Web, Smalltalk Web Application Server -->
<!...etc... option: an IGCompany preselected: a Set('') session: a WebSession each: an IGCompany --- The full stack --- IGCompany(Object)>>doesNotUnderstand: #readStream AIDASite class>>convert:toCodepage: AIDASite class>>convertToWeb:on: [] in WebMenu>>printOptionsOn: {[:each |  option := self aspect isNil     ifTrue: [each]     ifFalse: [each ...]} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OrderedCollection>>do: WebMenu>>printOptionsOn: WebMenu>>printHTMLPageOn:forSession: [] in WebTableCell(WebElement)>>printHTMLPageOn:forSession: {[:element | element notNil   ifTrue: [element printHTMLPageOn: aStream forSe...]} OrderedCollection>>do: WebTableCell(WebElement)>>printHTMLPageOn:forSession: WebTableCell>>printHTMLPageOn:forSession: [] in WebTableRow(WebElement)>>printHTMLPageOn:forSession: {[:element | element notNil   ifTrue: [element printHTMLPageOn: aStream forSe...]} OrderedCollection>>do: WebTableRow(WebElement)>>printHTMLPageOn:forSession: WebTableRow>>printHTMLPageOn:forSession: [] in WebTable(WebElement)>>printHTMLPageOn:forSession: {[:element | element notNil   ifTrue: [element printHTMLPageOn: aStream forSe...]} OrderedCollection>>do: WebTable(WebElement)>>printHTMLPageOn:forSession: WebTable>>printHTMLPageOn:forSession: [] in WebElement>>printHTMLPageOn:forSession: {[:element | element notNil   ifTrue: [element printHTMLPageOn: aStream forSe...]} OrderedCollection>>do: WebElement>>printHTMLPageOn:forSession: [] in WebForm(WebElement)>>printHTMLPageOn:forSession: {[:element | element notNil   ifTrue: [element printHTMLPageOn: aStream forSe...]} OrderedCollection>>do: WebForm(WebElement)>>printHTMLPageOn:forSession: WebForm>>printHTMLPageOn:forSession: IGTechnicianApp(WebPage)>>printHTMLPageOn:forSession: AIDASite>>answer:toGetOrPost:on: AIDASite>>answer:to:on: AIDASite>>answerTo: AIDASite>>helpResolve: URIResolution>>visitResource: [] in URIResolution>>visitChildrenOf:advancing: {[:each |  response := self visitResource: each.  response isNil   ifFalse: [...]} ...etc...
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida