Re: [flexcoders] Restrictions on non-visual component placement

2008-12-13 Thread Rick Winscot
Tracy / Michael,

The parent/child relationship (post application root) in MXML is constrained
to DisplayObjectContainer and DisplayObject relationships... this rule does
not apply to components within an item renderer.

http://www.adobe.us/livedocs/flex/2/langref/mxml/component.html

So... The question really is ­ what is the inheritance of the DetailPopUp?
Does it trace back to UIComponent? If not... Then that is what is preventing
him from using the component in both contexts. The simple solution would be
to extend UIComponent, mark includeInLayout as false, and make sure his
scripts are all playing nice.

Rick Winscot


On 12/12/08 2:18 PM, "Tracy Spratt"  wrote:

>  
>  
> 
> It IS, or at least was, the case that non-visual components must be at the
> root mxml scope.  I will try to find it documented.
>  
> If the component is non-visual, then it does not matter, functionally
> speaking, where in the DOM it goes.
>  
> Tracy
>  
> 
> 
> From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf
> Of Rick Winscot
> Sent: Friday, December 12, 2008 1:25 PM
> To: flexcoders@yahoogroups.com
> Subject: Re: [flexcoders] Restrictions on non-visual component placement
>  
> 
> It¹s difficult to determine what your problem is without knowing a little more
> about what your DetailPopUp does/is. If you post some code it would be far
> easier to determine why one context works and another doesn¹t. Generally... I
> wouldn¹t recommend mingling non-visual and visual components in mxml.
> 
> Your error basically says that your non-visual component doesn¹t have an
> appropriate interface for the context you are placing it in. e.g. It should be
> a IUIComponent.
> 
> http://livedocs.adobe.com/flex/201/langref/mx/core/IUIComponent.html
> 
> Rick Winscot
> 
> 
> On 12/12/08 12:49 PM, "Michael Prescott"  wrote:
>> 
>> 
>>  
>> 
>> Short version:
>> 
>> I have a non-visual component that I'm trying to declare in a repeater, but
>> it seems that MXML doesn't allow this.  Is this true?  How do you get around
>> this, create a visual component to wrap the non-visual component?
>> 
>> Long version:
>> 
>> I have an ActionScript non-visual component whose declaration looks like
>> this:
>> 
>> public class DetailPopup extends EventDispatcher implements IMXMLObject
>> 
>> I've used this successfully inside an inline, MXML item renderer, like this:
>> 
>>  
>> 
>>   
>> 
>> 
>>   
>> 
>>   
>> 
>> 
>>   
>> 
>>   
>> 
>> 
>> Now that I'm switching from a DataGrid to a Grid, the code ought to look like
>> this:
>> 
>>  
>> 
>> 
>>   
>> 
>> (X)   
>> 
>> 
>>   
>> 
>> ..except that I'm getting an error, "Component declarations are not allowed
>> here. (Note: visual children must implement IUIComponent.)"
>> 
>> After trying out a bunch of scenarios, it looks like non-visual components
>> can only be declared in the outermost scope of a component or application.
>> Is this true?  This is rather awkward, as I need a DetailPopUp for each
>> griditem.
>> 
>> Any tips would be very helpful!
>> 
>> Michael
>>  
>> 
>  
> 



Re: [flexcoders] Restrictions on non-visual component placement

2008-12-12 Thread Michael Prescott
Yes, that's what we did!  Thanks, team!


On Fri, Dec 12, 2008 at 2:55 PM, Alex Harui  wrote:

>In theory, if you take the VBox and its innards and put them in their
> own MXML file it should work.
>
>
>
> *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On
> Behalf Of *Michael Prescott
> *Sent:* Friday, December 12, 2008 11:17 AM
>
> *To:* flexcoders@yahoogroups.com
> *Subject:* Re: [flexcoders] Restrictions on non-visual component placement
>
>
>
> It still seems to be true.
>
> Yes, I can see that before repeaters are involved, but the detail popup
> creates a relationship between a pair of components - so once I get to an
> array of such pairs, it seemed like I'd need a detail popup for each pair.
> It's stateful, and it would get muddled up if one detail popup was trying to
> coordinate multiple pairs of controls.  (Basically, I wanted the repeater to
> manage instances of the detail popup as well.)
>
> Michael
>
> On Fri, Dec 12, 2008 at 2:18 PM, Tracy Spratt 
> wrote:
>
> It IS, or at least was, the case that non-visual components must be at the
> root mxml scope.  I will try to find it documented.
>
>
>
> If the component is non-visual, then it does not matter, functionally
> speaking, where in the DOM it goes.
>
>
>
> Tracy
>
>
>  --
>
> *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On
> Behalf Of *Rick Winscot
> *Sent:* Friday, December 12, 2008 1:25 PM
> *To:* flexcoders@yahoogroups.com
> *Subject:* Re: [flexcoders] Restrictions on non-visual component placement
>
>
>
> It's difficult to determine what your problem is without knowing a little
> more about what your DetailPopUp does/is. If you post some code it would be
> far easier to determine why one context works and another doesn't.
> Generally... I wouldn't recommend mingling non-visual and visual components
> in mxml.
>
> Your error basically says that your non-visual component doesn't have an
> appropriate interface for the context you are placing it in. e.g. It should
> be a IUIComponent.
>
> http://livedocs.adobe.com/flex/201/langref/mx/core/IUIComponent.html
>
> Rick Winscot
>
>
> On 12/12/08 12:49 PM, "Michael Prescott" 
> wrote:
>
>
>
>
> *Short version:
> *
> I have a non-visual component that I'm trying to declare in a repeater, but
> it seems that MXML doesn't allow this.  Is this true?  How do you get around
> this, create a visual component to wrap the non-visual component?
>
> *Long version:
> *
> I have an ActionScript non-visual component whose declaration looks like
> this:
>
> public class DetailPopup extends EventDispatcher implements IMXMLObject
>
> I've used this successfully inside an inline, MXML item renderer, like
> this:
>
>  
> 
>   
> 
>
>   
>
>   
>
> 
>   
> 
>   
>
>
> Now that I'm switching from a DataGrid to a Grid, the code ought to look
> like this:
>
>  
> 
>
>   
>
> (X)   
>
> 
>   
>
> ..except that I'm getting an error, "Component declarations are not allowed
> here. (Note: visual children must implement IUIComponent.)"
>
> After trying out a bunch of scenarios, it looks like non-visual components
> can only be declared in the outermost scope of a component or application.
>  Is this true?  This is rather awkward, as I need a DetailPopUp for each
> griditem.
>
> Any tips would be very helpful!
>
> Michael
>
>
>
>
>
>   
>


RE: [flexcoders] Restrictions on non-visual component placement

2008-12-12 Thread Alex Harui
In theory, if you take the VBox and its innards and put them in their own MXML 
file it should work.

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Michael Prescott
Sent: Friday, December 12, 2008 11:17 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Restrictions on non-visual component placement


It still seems to be true.

Yes, I can see that before repeaters are involved, but the detail popup creates 
a relationship between a pair of components - so once I get to an array of such 
pairs, it seemed like I'd need a detail popup for each pair.  It's stateful, 
and it would get muddled up if one detail popup was trying to coordinate 
multiple pairs of controls.  (Basically, I wanted the repeater to manage 
instances of the detail popup as well.)

Michael
On Fri, Dec 12, 2008 at 2:18 PM, Tracy Spratt 
mailto:tspr...@lariatinc.com>> wrote:

It IS, or at least was, the case that non-visual components must be at the root 
mxml scope.  I will try to find it documented.



If the component is non-visual, then it does not matter, functionally speaking, 
where in the DOM it goes.



Tracy





From: flexcoders@yahoogroups.com<mailto:flexcoders@yahoogroups.com> 
[mailto:flexcoders@yahoogroups.com<mailto:flexcoders@yahoogroups.com>] On 
Behalf Of Rick Winscot
Sent: Friday, December 12, 2008 1:25 PM
To: flexcoders@yahoogroups.com<mailto:flexcoders@yahoogroups.com>
Subject: Re: [flexcoders] Restrictions on non-visual component placement



It's difficult to determine what your problem is without knowing a little more 
about what your DetailPopUp does/is. If you post some code it would be far 
easier to determine why one context works and another doesn't. Generally... I 
wouldn't recommend mingling non-visual and visual components in mxml.

Your error basically says that your non-visual component doesn't have an 
appropriate interface for the context you are placing it in. e.g. It should be 
a IUIComponent.

http://livedocs.adobe.com/flex/201/langref/mx/core/IUIComponent.html

Rick Winscot


On 12/12/08 12:49 PM, "Michael Prescott" 
http://michael.r.presc...@gmail.com>> wrote:



Short version:

I have a non-visual component that I'm trying to declare in a repeater, but it 
seems that MXML doesn't allow this.  Is this true?  How do you get around this, 
create a visual component to wrap the non-visual component?

Long version:

I have an ActionScript non-visual component whose declaration looks like this:

public class DetailPopup extends EventDispatcher implements IMXMLObject

I've used this successfully inside an inline, MXML item renderer, like this:

 

  


  

  


  

  


Now that I'm switching from a DataGrid to a Grid, the code ought to look like 
this:

 


  

(X)   


  

..except that I'm getting an error, "Component declarations are not allowed 
here. (Note: visual children must implement IUIComponent.)"

After trying out a bunch of scenarios, it looks like non-visual components can 
only be declared in the outermost scope of a component or application.  Is this 
true?  This is rather awkward, as I need a DetailPopUp for each griditem.

Any tips would be very helpful!

Michael






Re: [flexcoders] Restrictions on non-visual component placement

2008-12-12 Thread Michael Prescott
It still seems to be true.

Yes, I can see that before repeaters are involved, but the detail popup
creates a relationship between a pair of components - so once I get to an
array of such pairs, it seemed like I'd need a detail popup for each pair.
It's stateful, and it would get muddled up if one detail popup was trying to
coordinate multiple pairs of controls.  (Basically, I wanted the repeater to
manage instances of the detail popup as well.)

Michael

On Fri, Dec 12, 2008 at 2:18 PM, Tracy Spratt  wrote:

>It IS, or at least was, the case that non-visual components must be at
> the root mxml scope.  I will try to find it documented.
>
>
>
> If the component is non-visual, then it does not matter, functionally
> speaking, where in the DOM it goes.
>
>
>
> Tracy
>
>
>  --
>
> *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On
> Behalf Of *Rick Winscot
> *Sent:* Friday, December 12, 2008 1:25 PM
> *To:* flexcoders@yahoogroups.com
> *Subject:* Re: [flexcoders] Restrictions on non-visual component placement
>
>
>
> It's difficult to determine what your problem is without knowing a little
> more about what your DetailPopUp does/is. If you post some code it would be
> far easier to determine why one context works and another doesn't.
> Generally... I wouldn't recommend mingling non-visual and visual components
> in mxml.
>
> Your error basically says that your non-visual component doesn't have an
> appropriate interface for the context you are placing it in. e.g. It should
> be a IUIComponent.
>
> http://livedocs.adobe.com/flex/201/langref/mx/core/IUIComponent.html
>
> Rick Winscot
>
>
> On 12/12/08 12:49 PM, "Michael Prescott" 
> wrote:
>
>
>
>
> *Short version:
> *
> I have a non-visual component that I'm trying to declare in a repeater, but
> it seems that MXML doesn't allow this.  Is this true?  How do you get around
> this, create a visual component to wrap the non-visual component?
>
> *Long version:
> *
> I have an ActionScript non-visual component whose declaration looks like
> this:
>
> public class DetailPopup extends EventDispatcher implements IMXMLObject
>
> I've used this successfully inside an inline, MXML item renderer, like
> this:
>
>  
> 
>   
> 
>
>   
>
>   
>
> 
>   
> 
>   
>
>
> Now that I'm switching from a DataGrid to a Grid, the code ought to look
> like this:
>
>  
> 
>
>   
>
> (X)   
>
> 
>   
>
> ..except that I'm getting an error, "Component declarations are not allowed
> here. (Note: visual children must implement IUIComponent.)"
>
> After trying out a bunch of scenarios, it looks like non-visual components
> can only be declared in the outermost scope of a component or application.
>  Is this true?  This is rather awkward, as I need a DetailPopUp for each
> griditem.
>
> Any tips would be very helpful!
>
> Michael
>
>
>
>   
>


RE: [flexcoders] Restrictions on non-visual component placement

2008-12-12 Thread Tracy Spratt
It IS, or at least was, the case that non-visual components must be at
the root mxml scope.  I will try to find it documented.

 

If the component is non-visual, then it does not matter, functionally
speaking, where in the DOM it goes.

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Rick Winscot
Sent: Friday, December 12, 2008 1:25 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Restrictions on non-visual component placement

 

It's difficult to determine what your problem is without knowing a
little more about what your DetailPopUp does/is. If you post some code
it would be far easier to determine why one context works and another
doesn't. Generally... I wouldn't recommend mingling non-visual and
visual components in mxml. 

Your error basically says that your non-visual component doesn't have an
appropriate interface for the context you are placing it in. e.g. It
should be a IUIComponent.

http://livedocs.adobe.com/flex/201/langref/mx/core/IUIComponent.html
<http://livedocs.adobe.com/flex/201/langref/mx/core/IUIComponent.html> 

Rick Winscot


On 12/12/08 12:49 PM, "Michael Prescott" 
wrote:


 

Short version:

I have a non-visual component that I'm trying to declare in a
repeater, but it seems that MXML doesn't allow this.  Is this true?  How
do you get around this, create a visual component to wrap the non-visual
component?

Long version:

I have an ActionScript non-visual component whose declaration
looks like this:

public class DetailPopup extends EventDispatcher implements
IMXMLObject

I've used this successfully inside an inline, MXML item
renderer, like this:

 

  


  

  


  

  


Now that I'm switching from a DataGrid to a Grid, the code ought
to look like this:

 


  

(X)   


  

..except that I'm getting an error, "Component declarations are
not allowed here. (Note: visual children must implement IUIComponent.)"

After trying out a bunch of scenarios, it looks like non-visual
components can only be declared in the outermost scope of a component or
application.  Is this true?  This is rather awkward, as I need a
DetailPopUp for each griditem.

Any tips would be very helpful!

Michael
 


 



Re: [flexcoders] Restrictions on non-visual component placement

2008-12-12 Thread Michael Prescott
I think that might be a distraction, I was asking a question about the rules
of MXML, rather than asking for debugging help for my non-visual component.

But just for fun, I'll explain!  I was looking for a way to reuse the nice
way that PopUpButton manages its pop-up, so I created a non-visual component
that you could use to orchestrate "popping up" on rollover or on focus.



  



This works really well, and we use it in a few places so we can use ad hoc
detail pop-ups.  We've even used it inside a datagrid item renderer:


  


  


  


When we switched to a grid with a repeater, I discovered the prohibition on
nonvisual components that weren't parent of the root tag.

  
  
  

  
(x)   
   

So the solution appears to be to take the guts and put it in its own
component definition, and then do this:


  


Michael

On Fri, Dec 12, 2008 at 1:25 PM, Rick Winscot wrote:

>It's difficult to determine what your problem is without knowing a
> little more about what your DetailPopUp does/is. If you post some code it
> would be far easier to determine why one context works and another doesn't.
> Generally... I wouldn't recommend mingling non-visual and visual components
> in mxml.
>
> Your error basically says that your non-visual component doesn't have an
> appropriate interface for the context you are placing it in. e.g. It should
> be a IUIComponent.
>
> http://livedocs.adobe.com/flex/201/langref/mx/core/IUIComponent.html
>
> Rick Winscot
>
>
>
> On 12/12/08 12:49 PM, "Michael Prescott" 
> wrote:
>
>
>
>
> *Short version:
> *
> I have a non-visual component that I'm trying to declare in a repeater, but
> it seems that MXML doesn't allow this.  Is this true?  How do you get around
> this, create a visual component to wrap the non-visual component?
>
> *Long version:
> *
> I have an ActionScript non-visual component whose declaration looks like
> this:
>
> public class DetailPopup extends EventDispatcher implements IMXMLObject
>
> I've used this successfully inside an inline, MXML item renderer, like
> this:
>
>   
> 
>   
> 
>
>   
>
>   
>
> 
>   
> 
>   
>
>
> Now that I'm switching from a DataGrid to a Grid, the code ought to look
> like this:
>
>   
> 
>
>   
>
> (X)   
>
> 
>   
>
> ..except that I'm getting an error, "Component declarations are not allowed
> here. (Note: visual children must implement IUIComponent.)"
>
> After trying out a bunch of scenarios, it looks like non-visual components
> can only be declared in the outermost scope of a component or application.
>  Is this true?  This is rather awkward, as I need a DetailPopUp for each
> griditem.
>
> Any tips would be very helpful!
>
> Michael
>
>
>
>  
>


Re: [flexcoders] Restrictions on non-visual component placement

2008-12-12 Thread Rick Winscot
It¹s difficult to determine what your problem is without knowing a little
more about what your DetailPopUp does/is. If you post some code it would be
far easier to determine why one context works and another doesn¹t.
Generally... I wouldn¹t recommend mingling non-visual and visual components
in mxml. 

Your error basically says that your non-visual component doesn¹t have an
appropriate interface for the context you are placing it in. e.g. It should
be a IUIComponent.

http://livedocs.adobe.com/flex/201/langref/mx/core/IUIComponent.html

Rick Winscot


On 12/12/08 12:49 PM, "Michael Prescott" 
wrote:

>  
>  
> 
> Short version:
> 
> I have a non-visual component that I'm trying to declare in a repeater, but it
> seems that MXML doesn't allow this.  Is this true?  How do you get around
> this, create a visual component to wrap the non-visual component?
> 
> Long version:
> 
> I have an ActionScript non-visual component whose declaration looks like this:
> 
> public class DetailPopup extends EventDispatcher implements IMXMLObject
> 
> I've used this successfully inside an inline, MXML item renderer, like this:
> 
>   
> 
>   
> 
> 
>   
> 
>   
> 
> 
>   
> 
>   
> 
> 
> Now that I'm switching from a DataGrid to a Grid, the code ought to look like
> this:
> 
>   
> 
> 
>   
> 
> (X)   
> 
> 
>   
> 
> ..except that I'm getting an error, "Component declarations are not allowed
> here. (Note: visual children must implement IUIComponent.)"
> 
> After trying out a bunch of scenarios, it looks like non-visual components can
> only be declared in the outermost scope of a component or application.  Is
> this true?  This is rather awkward, as I need a DetailPopUp for each griditem.
> 
> Any tips would be very helpful!
> 
> Michael
>  
>