select tag population / callback..

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

select tag population / callback..

sergio_101
hey, guys.. i am trying to figure this out, but i am missing something here:

i have an array of objects...

i would like to populate a select box so that the options will be
populated with the some text from the object..

when the form is submitted, i want the callback to set some value to
the object pointed to by the select box..

if i do something like this:

        html select
                list: self trackSelect;
                callback: [:value | ?? ].

the box populates correctly, but i can't figure out how to grab a
handle to the object selected..

am i just thinking about this all wrong?

thanks!


--
----
peace,
sergio
photographer, journalist, visionary

http://www.ThoseOptimizeGuys.com
http://www.CodingForHire.com
http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: select tag population / callback..

Paul DeBruicker
Look at the senders of #select for ideas on how it can be done.

In a form just make the callback something like

callback:[:value | self setSelectedValue: value]





On Sep 25, 2012, at 9:51 PM, sergio_101 <[hidden email]> wrote:

> hey, guys.. i am trying to figure this out, but i am missing something here:
>
> i have an array of objects...
>
> i would like to populate a select box so that the options will be
> populated with the some text from the object..
>
> when the form is submitted, i want the callback to set some value to
> the object pointed to by the select box..
>
> if i do something like this:
>
>    html select
>        list: self trackSelect;
>        callback: [:value | ?? ].
>
> the box populates correctly, but i can't figure out how to grab a
> handle to the object selected..
>
> am i just thinking about this all wrong?
>
> thanks!
>
>
> --
> ----
> peace,
> sergio
> photographer, journalist, visionary
>
> http://www.ThoseOptimizeGuys.com
> http://www.CodingForHire.com
> http://www.coffee-black.com
> http://www.painlessfrugality.com
> http://www.twitter.com/sergio_101
> http://www.facebook.com/sergio101
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: select tag population / callback..

sergio_101
> In a form just make the callback something like
>
> callback:[:value | self setSelectedValue: value]

when i do this, i end up setting the value to the value of the option
tag..  what i need to do is point it to the actual object.. i have a
feeling i am not wording this correctly..

what i'd like to do is populate the select tag options with some text
generated by my objects.

when the form is processed, the value in my component would be set to
the object that the select points to..

i hope i am making sense..

--
----
peace,
sergio
photographer, journalist, visionary

http://www.ThoseOptimizeGuys.com
http://www.CodingForHire.com
http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: select tag population / callback..

Boris Popov, DeepCove Labs (SNN)
(html select)
    list: self countries;
    selected: country;
    labels: [:ea | ea label];
    callback: [:obj | country := obj].

where #country is an ivar and #countries is a selector returning a collection of your country objects each of which responds to a #label for its textual representation, for example.

-Boris

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of sergio_101
Sent: Wednesday, September 26, 2012 8:12 AM
To: Seaside - general discussion
Subject: Re: [Seaside] select tag population / callback..

> In a form just make the callback something like
>
> callback:[:value | self setSelectedValue: value]

when i do this, i end up setting the value to the value of the option tag..  what i need to do is point it to the actual object.. i have a feeling i am not wording this correctly..

what i'd like to do is populate the select tag options with some text generated by my objects.

when the form is processed, the value in my component would be set to the object that the select points to..

i hope i am making sense..

--
----
peace,
sergio
photographer, journalist, visionary

http://www.ThoseOptimizeGuys.com
http://www.CodingForHire.com
http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: select tag population / callback..

sergio_101
> (html select)
>     list: self countries;
>     selected: country;
>     labels: [:ea | ea label];
>     callback: [:obj | country := obj].
>
> where #country is an ivar and #countries is a selector returning a collection of your country objects each of which responds to a #label for its textual representation, for example.
>

ah! labels! this is the method i think i was overlooking!

unfortunately, i can't play with this until i get home tonight..

until 5pm.. i am in ruby on rails world..

thanks, boris!

--
----
peace,
sergio
photographer, journalist, visionary

http://www.ThoseOptimizeGuys.com
http://www.CodingForHire.com
http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: select tag population / callback..

Boris Popov, DeepCove Labs (SNN)
Sergio,

You can also implement Country>>renderOn: instead, but #labels: makes more sense generally, because in one list you could be using #shortLabel and in another #longLabel etcetera.

HTH,

-Boris


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of sergio_101
Sent: Wednesday, September 26, 2012 8:39 AM
To: Seaside - general discussion
Subject: Re: [Seaside] select tag population / callback..

> (html select)
>     list: self countries;
>     selected: country;
>     labels: [:ea | ea label];
>     callback: [:obj | country := obj].
>
> where #country is an ivar and #countries is a selector returning a collection of your country objects each of which responds to a #label for its textual representation, for example.
>

ah! labels! this is the method i think i was overlooking!

unfortunately, i can't play with this until i get home tonight..

until 5pm.. i am in ruby on rails world..

thanks, boris!

--
----
peace,
sergio
photographer, journalist, visionary

http://www.ThoseOptimizeGuys.com
http://www.CodingForHire.com
http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: select tag population / callback..

sergio_101
hey guys..

this worked perfectly..

thanks!

working on a facebook app right now..

in the process, i am publishing a smalltalk API wrapper for facebook,
spotify, and grooveshark.. please let me know if i am duplicating any
efforts..

also, i will be documenting the development process on my blog, so
others can build such projects..

thanks!



--
----
peace,
sergio
photographer, journalist, visionary

http://www.ThoseOptimizeGuys.com
http://www.CodingForHire.com
http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: select tag population / callback..

Gastón Dall' Oglio
Hello. Great! What is your blog?

2012/9/27 sergio_101 <[hidden email]>
hey guys..

this worked perfectly..

thanks!

working on a facebook app right now..

in the process, i am publishing a smalltalk API wrapper for facebook,
spotify, and grooveshark.. please let me know if i am duplicating any
efforts..

also, i will be documenting the development process on my blog, so
others can build such projects..

thanks!


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: select tag population / callback..

sergio_101
On Thu, Sep 27, 2012 at 7:58 AM, Gastón Dall' Oglio
<[hidden email]> wrote:
> Hello. Great! What is your blog?
>

i will be posting at www.codingforhire.com

thanks!

--
----
peace,
sergio
photographer, journalist, visionary

http://www.ThoseOptimizeGuys.com
http://www.CodingForHire.com
http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: select tag population / callback..

Gastón Dall' Oglio
ok thanks, bookmarked :)

2012/9/27 sergio_101 <[hidden email]>
On Thu, Sep 27, 2012 at 7:58 AM, Gastón Dall' Oglio
<[hidden email]> wrote:
> Hello. Great! What is your blog?
>

i will be posting at www.codingforhire.com


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: select tag population / callback..

sergio_101
i'll announce to the list how this goes..

if everything works out with this little project, i am going to do my
next big production project in seaside..

On Thu, Sep 27, 2012 at 8:18 AM, Gastón Dall' Oglio
<[hidden email]> wrote:

> ok thanks, bookmarked :)
>
> 2012/9/27 sergio_101 <[hidden email]>
>>
>> On Thu, Sep 27, 2012 at 7:58 AM, Gastón Dall' Oglio
>> <[hidden email]> wrote:
>> > Hello. Great! What is your blog?
>> >
>>
>> i will be posting at www.codingforhire.com
>>
>> thanks!
>>
>> --
>> ----
>> peace,
>> sergio
>> photographer, journalist, visionary
>>
>> http://www.ThoseOptimizeGuys.com
>> http://www.CodingForHire.com
>> http://www.coffee-black.com
>> http://www.painlessfrugality.com
>> http://www.twitter.com/sergio_101
>> http://www.facebook.com/sergio101
>> _______________________________________________
>> seaside mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>



--
----
peace,
sergio
photographer, journalist, visionary

http://www.ThoseOptimizeGuys.com
http://www.CodingForHire.com
http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: select tag population / callback..

Intrader Intrader
In reply to this post by sergio_101
sergio_101 <sergio.rrd <at> gmail.com> writes:

I like " My goal for the next few years? Learn to write code like a world class
chef, rather than the grill jockey at the local burger joint."

There is a lot to review and reassess in TDD; and a lot of value.


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: select tag population / callback..

sergio_101
> I like " My goal for the next few years? Learn to write code like a world class
> chef, rather than the grill jockey at the local burger joint."
>
> There is a lot to review and reassess in TDD; and a lot of value.

thanks!

it's interesting in that i wrote that more than a year ago.. and i
have evolved even more over time.. i have once again thrown over IDEs.
this time, i am using vim for all my non smalltalk things.

believe it or not, i have learned most about the art of software
development through my side adventures with smalltalk..

it has changed the way i have approached OOP in every way..

i feel like in other languages, i am playing with objects at 50,000
feet.. with smalltalk, i feel like the objects are my friends and
neighbors..

--
----
peace,
sergio
photographer, journalist, visionary

http://www.ThoseOptimizeGuys.com
http://www.CodingForHire.com
http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside