Custom Card Container

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

Custom Card Container

Sebastián Sastre
Hi all,

    I'm using aCustomItem that responds to >>descripcion and to >>icon

    That's for use as arrangement on a card container, so I can have my own
icons and descriptions in the tabs. The problem is when I want to add
another container on the ViewComposer. When I do that the arrangement of the
new presenter is an integer that DNU description, so it can't be added. I've
tried to modify that on the fly (with the debugger) to put there aCustomItem
but then the view was saved corrupted (lukily I saved it by another name :P)

    any clue?

    regards,

--
Sebastián Sastre
[hidden email]
www.seaswork.com.ar


Reply | Threaded
Open this post in threaded view
|

Re: Custom Card Container

Chris Uppal-3
Sebastián Sastre wrote:

>     I'm using aCustomItem that responds to >>descripcion and to >>icon
>
>     That's for use as arrangement on a card container, so I can have my
> own icons and descriptions in the tabs. The problem is when I want to add
> another container on the ViewComposer. When I do that the arrangement of
> the new presenter is an integer that DNU description, so it can't be
> added.

I'd probably do one of three things:

a) Change CustomItem to use its description as its #displayString, and then
refer to #displayString instead of #description in whatever code it is that is
giving you problems.

b) Add #description to Number.

c) Use a custom subclass of CardContainer that overrode #onSubViewAdded: to use
a different default arrangement.


> I've tried to modify that on the fly (with the debugger) to put
> there aCustomItem but then the view was saved corrupted (lukily I saved
> it by another name :P)

That should have worked OK, I think.  I have done similar things often enough.
If you try it again and it still fails then you may have some other problem
that this is exposing.

    -- chris


Reply | Threaded
Open this post in threaded view
|

Re: Custom Card Container

Sebastián Sastre
Dear Chris,

    I've used the B option you mention, but I think the most elegant is C
wich I'll implement in the next "iteration".

    thanks,

--
Sebastián Sastre
[hidden email]
www.seaswork.com.ar



"Chris Uppal" <[hidden email]> escribió en el
mensaje news:[hidden email]...
> Sebastián Sastre wrote:
>
> >     I'm using aCustomItem that responds to >>descripcion and to >>icon
> >
> >     That's for use as arrangement on a card container, so I can have my
> > own icons and descriptions in the tabs. The problem is when I want to
add
> > another container on the ViewComposer. When I do that the arrangement of
> > the new presenter is an integer that DNU description, so it can't be
> > added.
>
> I'd probably do one of three things:
>
> a) Change CustomItem to use its description as its #displayString, and
then
> refer to #displayString instead of #description in whatever code it is
that is
> giving you problems.
>
> b) Add #description to Number.
>
> c) Use a custom subclass of CardContainer that overrode #onSubViewAdded:
to use
> a different default arrangement.
>
>
> > I've tried to modify that on the fly (with the debugger) to put
> > there aCustomItem but then the view was saved corrupted (lukily I saved
> > it by another name :P)
>
> That should have worked OK, I think.  I have done similar things often
enough.
> If you try it again and it still fails then you may have some other
problem
> that this is exposing.
>
>     -- chris
>
>