SC ImageView

4 views
Skip to first unread message

Jeffrey ODell

unread,
Aug 23, 2010, 5:04:37 PM8/23/10
to lebowskifw
I'm new to Lebowski/SC but I was wondering if SC.ImageView was going
to be a supported proxy object. I'm trying to interact with one and
am having difficulty.

Thanks for your hard work,

MikeC

unread,
Aug 23, 2010, 5:08:49 PM8/23/10
to lebowskifw
Currently there is no proxy for SC.ImageView. If you try to access
such an object, you'll get back a generic instance of a ProxyObject.
What issue are you having when trying to proxy the image view?

Mike

Jeffrey O'Dell

unread,
Aug 23, 2010, 5:28:07 PM8/23/10
to lebow...@googlegroups.com
Yep, this is where I find myself.  I'm trying to get at something like:

...
      accessoryColumn: SC.View.extend({
        childViews: ['button'],
        layout: { top: 0 },
        button: SC.ImageView.design({
          value: 'foobar',
          ...

and was trying to crawl down the path via something like

App['mainPage.mainView.tableView.accessoryColumn', View]

which gets me stuck at:

Lebowski::Foundation::UnexpectedTypeError: Did not get expected type 'SC.View' for path 'mainPage.mainView.tableView.accessoryColumn'. Instead got class: #<Lebowski::Foundation::ProxyObject:0x102218588>
        from /Users/jodell/.rvm/gems/ruby-1.8.7-p299/gems/lebowski-0.1.1/lib/lebowski/foundation/proxy_object.rb:571:in `handle_type_class'

Maybe I'm making a naive assumption here or need to read through more of the code/docs.  Thanks for any pointers in the right direction.

MikeC

unread,
Aug 23, 2010, 7:14:11 PM8/23/10
to lebowskifw
From the error message, the framework is telling you you're getting a
class instead of an instance of SC.View. Looking at your code snippet,
the view assigned to the accessoryColumn property may still be a class
instead of an instance of SC.View. If you open something like firebug
and try to access that property, what do you get? An instance of
SC.View? Also, are you using the SC.TableView?

On Aug 23, 5:28 pm, "Jeffrey O'Dell" <jeffrey.od...@gmail.com> wrote:
> Yep, this is where I find myself.  I'm trying to get at something like:
>
> ...
>       accessoryColumn: SC.View.extend({
>         childViews: ['button'],
>         layout: { top: 0 },
>         button: SC.ImageView.design({
>           value: 'foobar',
>           ...
>
> and was trying to crawl down the path via something like
>
> App['mainPage.mainView.tableView.accessoryColumn', View]
>
> which gets me stuck at:
>
> Lebowski::Foundation::UnexpectedTypeError: Did not get expected type
> 'SC.View' for path 'mainPage.mainView.tableView.accessoryColumn'. Instead
> got class: #<Lebowski::Foundation::ProxyObject:0x102218588>
>         from
> /Users/jodell/.rvm/gems/ruby-1.8.7-p299/gems/lebowski-0.1.1/lib/lebowski/foundation/proxy_object.rb:571:in
> `handle_type_class'
>
> Maybe I'm making a naive assumption here or need to read through more of the
> code/docs.  Thanks for any pointers in the right direction.
>

Jeffrey ODell

unread,
Sep 2, 2010, 2:34:18 PM9/2/10
to lebowskifw
Yes, you were right. I wasn't correctly accessing the table item
before getting to the ImageView I wanted. Finding the relevant row
and then the button child view was what worked for me:
"app['tableICareAbout'][0].child_views.first.button"

On Aug 23, 6:14 pm, MikeC <michael.lee.co...@gmail.com> wrote:
> From the error message, the framework is telling you you're getting a
> class instead of an instance of SC.View. Looking at your code snippet,
> the view assigned to the accessoryColumn property may still be a class
> instead of an instance of SC.View. If you open something like firebug
> and try to access that property, what do you get? An instance of
> SC.View? Also, are you using the SC.TableView?
>
> On Aug 23, 5:28 pm, "Jeffrey O'Dell" <jeffrey.od...@gmail.com> wrote:
>
>
>
> > Yep, this is where I find myself.  I'm trying to get at something like:
>
> > ...
> >       accessoryColumn: SC.View.extend({
> >         childViews: ['button'],
> >         layout: { top: 0 },
> >         button: SC.ImageView.design({
> >           value: 'foobar',
> >           ...
>
> > and was trying to crawl down the path via something like
>
> > App['mainPage.mainView.tableView.accessoryColumn', View]
>
> > which gets me stuck at:
>
> > Lebowski::Foundation::UnexpectedTypeError: Did not get expected type
> > 'SC.View' for path 'mainPage.mainView.tableView.accessoryColumn'. Instead
> > got class: #<Lebowski::Foundation::ProxyObject:0x102218588>
> >         from
> > /Users/jodell/.rvm/gems/ruby-1.8.7-p299/gems/lebowski-0.1.1/lib/lebowski/fo undation/proxy_object.rb:571:in

MikeC

unread,
Sep 2, 2010, 2:45:05 PM9/2/10
to lebowskifw
Ah, excellent. Glad to hear everything is working for you now.
Reply all
Reply to author
Forward
0 new messages