[flexcoders] Re: The grammar of Embed to define Class/Function in CSS?

2010-01-18 Thread xiaoming_w...@ymail.com
Thank you so much.

Is it possible to set Function as a style property? 

--- In flexcoders@yahoogroups.com, Ariel J arielj...@... wrote:

 
 .myStyle {
 rendererClass: ClassReference(com.mycompany.myClass);
 }
 
 --- In flexcoders@yahoogroups.com, xiaoming_wang@ xiaoming_wang@ wrote:
 
  Hi gurus,
  
  I have a component with style definitions like the following:
  
  [Style(name=rendererClass,type=Class,inherit=yes)]
  [Style(name=rendererFunction,type=Function,inherit=yes)]
  
  How to define the vlaue of these 2 styles in a CSS file if the class name 
  and function name are known? I guess Embed works but no idea about how.
  
  background-image:Embed(/style_undefined/assets/general/bg.png);
  
  Thanks in advance.
 





[flexcoders] The grammar of Embed to define Class/Function in CSS?

2010-01-16 Thread xiaoming_w...@ymail.com
Hi gurus,

I have a component with style definitions like the following:

[Style(name=rendererClass,type=Class,inherit=yes)]
[Style(name=rendererFunction,type=Function,inherit=yes)]

How to define the vlaue of these 2 styles in a CSS file if the class name and 
function name are known? I guess Embed works but no idea about how.

background-image:Embed(/style_undefined/assets/general/bg.png);

Thanks in advance.





[flexcoders] Re: Lazy loading of data with HierarchicalCollectionView

2009-12-23 Thread xiaoming_w...@ymail.com
Hi Alex,

Thank you. I got some ideas from one of your blog posts.

http://blogs.adobe.com/aharui/2008/12/tree_and_lazy_or_paged_data_1.html

However, here comes one more question:

Shall I need to re-define a collection inheriting ArrayCollection to support 
lazy-loading of data items? In the redefinition asychronized process is 
triggered to read data when needed. (typically when moveNext() method of an 
view cursor is called)

Thanks.
Xiaoming

--- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote:

 For Tree, you use a custom ITreeDataDescriptor and generally, you don't need 
 to use ItemPendingError.  The key is to return an empty array collection for 
 a set of children, then go to the server, get the children and add them to 
 that empty array collection.
 
 Alex Harui
 Flex SDK Developer
 Adobe Systems Inc.http://www.adobe.com/
 Blog: http://blogs.adobe.com/aharui
 
 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On 
 Behalf Of xiaoming_w...@...
 Sent: Tuesday, December 22, 2009 5:12 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Lazy loading of data with HierarchicalCollectionView
 
 
 
 Hi experts,
 
 I need define a hierarchical data model using a class with field
 children, and then use the hierarchical data model as data provider of
 a tree.
 
 The class may looks like:
 
 class ABCD
 {
 ..
 public function get children():Array;
 public function set children;
 
 public var parent:ABCD;
 
 public var canHaveChildren:Boolean;
 public var hasChildren:Boolean
 
 }
 
 My purposes:
 1. The data model is not fully read from backend at very begining. Only
 one node (object of class ABCD) in the hierarchical data model is read
 to start, with information fields canHaveChildren and hasChildren.
 2. If the node has true value for both canHaveChildren and
 hasChildren field, user may be able to click and open the node in
 tree, or go to upper level of the tree, which means, the parent node is
 displayed as root instead of the old node.
 3. The child nodes of the node will be read from backend only on user
 action. This is an asychronized process and I have to display a progress
 bar to indicate the status.
 4. The tree will be updated after the hierarchical data model is updated
 by asychronized process.
 
 My questions:
 1. To use a object of class ABCD as data provider of a tree, shall I
 need to encapsulate it with class HierarchicalCollectionView?
 2. I heard of that an ItemPendingError should be thrown when the
 asychronized process is not finished, when and how to throw the error? I
 didn't find any document/examples in Flex 3 documentations. Please
 kindly tell me if any examples existed.
 3. In the code of flex framework, I see usually the ItemPendingError is
 thrown when calling method moveNext() of a IViewCursor. I guess the
 original place throwing the error should be in the implementation of
 function get children() of class ABCD in my example, am I right?
 4. Any other hints about the architecture of lazy loading hierarchical
 data of flex 3?
 
 Thanks a lot.
 
 Regards,
 Xiaoming





[flexcoders] Lazy loading of data with HierarchicalCollectionView

2009-12-22 Thread xiaoming_w...@ymail.com
Hi experts,

I need define a hierarchical data model using a class with field
children, and then use the hierarchical data model as data provider of
a tree.

The class may looks like:

class ABCD
{
 ..
 public function get children():Array;
 public function set children;

 public var parent:ABCD;

 public var canHaveChildren:Boolean;
 public var hasChildren:Boolean

}

My purposes:
1. The data model is not fully read from backend at very begining. Only
one node (object of class ABCD) in the hierarchical data model is read
to start, with information fields canHaveChildren and hasChildren.
2.  If the node has true value for both canHaveChildren and
hasChildren field, user may be able to click and open the node in
tree, or go to upper level of the tree, which means, the parent node is
displayed as root instead of the old node.
3. The child nodes of the node will be read from backend only on user
action. This is an asychronized process and I have to display a progress
bar to indicate the status.
4. The tree will be updated after the hierarchical data model is updated
by asychronized process.

My questions:
1.  To use a object of class ABCD as data provider of a tree, shall I
need to encapsulate it with class HierarchicalCollectionView?
2. I heard of that an ItemPendingError should be thrown when the
asychronized process is not finished, when and how to throw the error? I
didn't find any document/examples in Flex 3 documentations. Please
kindly tell me if any examples existed.
3. In the code of flex framework, I see usually the ItemPendingError is
thrown when calling method moveNext() of a IViewCursor. I guess the
original place throwing the error should be in the implementation of
function get children() of class ABCD in my example, am I right?
4. Any other hints about the architecture of lazy loading hierarchical
data of flex 3?

Thanks a lot.

Regards,
Xiaoming