[flexcoders] Re: Could not resolve * to a component implementation.

2010-07-01 Thread turbo_vb
Glad that you were able to resolve the problem.  The AS file IS a class, and if 
it lives in the same package as the mxml component, the compiler will balk; 
because it doesn't know which one to import elsewhere.  Adobe best practice 
would have you use Uppercase for the first letter of all classes.  Renaming the 
script class to something like FooScript.as or FooModel.as might be a better 
way to go.

Cheers,
-TH

--- In flexcoders@yahoogroups.com, "Brian J. Ackermann"  
wrote:
>
> Here's what the problem was.
> 
> I had originally had a file called "Foo.mxml" which contained a lot of
> ActionScript Code.  I decided to create a new ActionScript FILE to contain
> that script code.  I named the file "Foo.as", to indicate the correlation
> with the mxml file.
> 
> Renaming this new as file to "foo.as" (lowercase f), resolves the issue.
> 
> I'm not at all sure why this would have caused a conflict with the compiler,
> since it wasn't a classbut at least I've resolved the issue.
> 
> On Thu, Jul 1, 2010 at 7:57 AM, valdhor  wrote:
> 
> >
> >
> > One other thing to check. Make sure you are not using a reserved name for
> > your component.
> >
> >
> > --- In flexcoders@yahoogroups.com ,
> > "turbo_vb"  wrote:
> > >
> > > A couple things that you can check that might help:
> > >
> > > • Make sure that you have an import statement for the component in the
> > parent class.
> > > • If your component is an AS class, make sure that the package, at the
> > top of the class, is correct.
> > > • If your component is an AS component make sure that the class name,
> > within the component, is correct. If you are using a constructor check that
> > too.
> > >
> > > -TH
> > >
> > > --- In flexcoders@yahoogroups.com , "Brian
> > J. Ackermann"  wrote:
> > > >
> > > > Hi,
> > > >
> > > > I'm a wee bit stuck on this, and was hoping you might have some input
> > to
> > > > help me.
> > > >
> > > > I'm getting the "Could not resolve * to a component implementation."
> > error
> > > > message. However, everything I've read about this via Google hasn't
> > helped
> > > > my case in the slightest. I presume I'm just missing something obvious,
> > but
> > > > maybe its something more serious.
> > > >
> > > > So, to solve this problem, I've tried two things, and both work, as far
> > as
> > > > they take me. First, I added a new component, of the exact same
> > variety,
> > > > and then copied the contents of the erroring component into it. I
> > replace
> > > > the viewstack 'page' with the new component (which as near as I can
> > tell is
> > > > IDENTICAL, but with a different name), and the compiler error goes
> > away.
> > > >
> > > > I can also solve this by simply renaming the original component &
> > letting
> > > > FB4 refactor for me. The error goes away again. But if I then re-rename
> > > > back to the original name, I get the compiler error again.
> > > >
> > > > I've tried to clean the project several times, and that doesn't help.
> > > >
> > > > I'd really like to understand what I've done wrong here. What am I
> > missing?
> > > >
> > > > Thanks much!
> > > >
> > >
> >
> >  
> >
>




[flexcoders] flexTasks.jar for Flex 2.0

2010-07-01 Thread arpan srivastava
Hi All,

Is there a different flexTasks.jar for Flex 2.0 ? I am trying to build my 
project in Flex 2.0 with jar I downloaded 
from http://www.adobe.com/devnet/flex/articles/flex_ant_pt2.html and it is 
giving me error: "Unable to run compc", but runs fine for Flex 3.0 projects.

Thanks
Arpan



Re: [flexcoders] How to remove duplicate objects from an array of objects

2010-07-01 Thread Warren
Yup -- I'm using AMF.  

What you say makes good sense.  Using the bytearray coould be risky especially 
since I can't depend on the property order always being the same.  I haven't 
done much OO yet but I see your point about long term maintenance.  

The valueOf trick reminds me a lot of what I was doing with the 
ObjectUtil.toString().  As long as the objects were simple, I would get a clean 
consistent string.

Hmm -- Maybe using the dict object wasn't such a bad idea after all.  It was 
extremely simple and would probably do the trick in my environment.  I have a 
lot of control over user entry.  I'm using restrict on the input fields and 
doing additional cleanup in the backend as part of my oracle stored procs.  
There won't be odd characters in the data.

This is proving to be a good learning experience.  I haven't had to dig this 
deep into object comparison techniques.  I'm sure glad you have your act 
together and are willing to share.


  - Original Message - 
  From: Oleg Sivokon 
  To: flexcoders@yahoogroups.com 
  Sent: Thursday, July 01, 2010 8:41 PM
  Subject: Re: [flexcoders] How to remove duplicate objects from an array of 
objects




  Well, then my take would be this: since you are sending them from CF, you are 
probably using AMF, and since you do so, you can use strongly typed objects, 
and (again, I'm not sure but...) I think that strongly typed objects are 
written accordingly to their describeType - this means objects are going to be 
consistent when serialized. But, the thing with comparing serialized objects is 
more of a trick, then a really good design. I would go for some kind of 
equals():Boolean method for those objects and implement it in a way it would 
only compare the relevant data.
  Something more like this:


  class BusinessObject {


  public function equals(object:BusinessObject):Boolean {
  if (this.foo != object.foo) return false;
  if (this.bar != object.bar) return false;
  return true;
  }
  }
  This would cover all the cases, like when you want the objects to have only 
some unique properties, but other you don't mind. It will be also easier to 
maintain in the long run. This is an inherent problem of OO languages vs 
rrelational database languages, where the first implies that objects must have 
unique identity and the second believes that the objects that have all the same 
traits are the same. Of course this is not black and white, but it's a known 
problem. The equals-like method is probably the standard kind of solution to 
this problem, unless you can find some more optimized way to do it.
  There are more interesting things, for example, if you implement valueOf() 
method of an object in a way that it returns number or string, the implementors 
may be treated under certain circumstances as being of simple type, so, say and 
you have something like this:


  class BusinessObject {


  public function valueOf():Object {
  return int(this.foo + this.bar);
  }
  }
  Then you can cast BusinessObject to int and compare ints :)


  var bo0:BusinessObject = new BusinessObject(100, 200);
  var bo1:BusinessObject = new BusinessObject(100, 300);


  if (int(bo0) === int(bo1)) // objects are assumed equal. 


  This approach may be more efficient if you cache the valueOf value in the 
BusinessObject so that when called it only returns the value.

  

Re: [flexcoders] How to remove duplicate objects from an array of objects

2010-07-01 Thread Oleg Sivokon
Well, then my take would be this: since you are sending them from CF, you
are probably using AMF, and since you do so, you can use strongly typed
objects, and (again, I'm not sure but...) I think that strongly typed
objects are written accordingly to their describeType - this means objects
are going to be consistent when serialized. But, the thing with comparing
serialized objects is more of a trick, then a really good design. I would go
for some kind of equals():Boolean method for those objects and implement it
in a way it would only compare the relevant data.
Something more like this:

class BusinessObject {

public function equals(object:BusinessObject):Boolean {
if (this.foo != object.foo) return false;
if (this.bar != object.bar) return false;
return true;
}
}
This would cover all the cases, like when you want the objects to have only
some unique properties, but other you don't mind. It will be also easier
to maintain in the long run. This is an inherent problem of OO languages vs
rrelational database languages, where the first implies that objects must
have unique identity and the second believes that the objects that have all
the same traits are the same. Of course this is not black and white, but
it's a known problem. The equals-like method is probably the standard kind
of solution to this problem, unless you can find some more optimized way to
do it.
There are more interesting things, for example, if you implement valueOf()
method of an object in a way that it returns number or string, the
implementors may be treated under certain circumstances as being of simple
type, so, say and you have something like this:

class BusinessObject {

public function valueOf():Object {
return int(this.foo + this.bar);
}
}
Then you can cast BusinessObject to int and compare ints :)

var bo0:BusinessObject = new BusinessObject(100, 200);
var bo1:BusinessObject = new BusinessObject(100, 300);

if (int(bo0) === int(bo1)) // objects are assumed equal.

This approach may be more efficient if you cache the valueOf value in
the BusinessObject so that when called it only returns the value.


[flexcoders] getting added values out of a combobox

2010-07-01 Thread Andrew
Hi:
My form has a number of fields, and I use the Change event to trigger event 
handlers to see whether enough fields have been populated that I should enable 
the Submit button.

I am using a combobox for one of the fields, so users can type in a value if I 
have not included it in the list. However, how do I get a typed-in value back 
out again? When the user types in a value rather than selecting an existing 
one, the change handler does not recognize that the combobox's selectedIndex is 
> -1, and there does not seem to be a label field I can check (if != null && != 
''). The example in Tour de Flex is not illuminating, for it only shows adding 
a value to a combo box, not doing anything with the value afterwards.

Thanks in advance for your help.

Andrew



Re: [flexcoders] How to remove duplicate objects from an array of objects

2010-07-01 Thread Warren
well isn't that interesting.  Wonder why that is.  I wish things were 
consistent.

I guess I could normalize things by looping over the array and creating a new 
array array of literal objects.

What I have is an array of objects coming from a cold fusion query so those 
objects will be consistent.  My Flex users will be adding to and subtracting 
objects from it.  .  I'll be creating new objects on the fly so I should be 
able to create the objects the same way (maybe use a simple class) and get 
things right.

I really like the idea of using the bytearray -- i hate the idea of flattening 
the objects into strings.  Too many things can go wrong with that


  - Original Message - 
  From: Oleg Sivokon 
  To: flexcoders@yahoogroups.com 
  Sent: Thursday, July 01, 2010 4:19 PM
  Subject: Re: [flexcoders] How to remove duplicate objects from an array of 
objects




  Woops, sorry, it appears that objects created using new Object syntax are 
sorted differently from objects created using literal...


  var o:Object = new Object();
o.bar = "345";
o.foo = "123";
var result:Array = this.removeDuplicates(
[
{ foo:"123", bar:"345" },
{ foo:"123", bar:"345", foobar:"789" },
{ foo:"123", bar:"347" },
{ foo:"123", bar:345 },
{ bar:"345", foo:"123" }, o
]);


  So, my code won't work in that case... well whoops...

  

[flexcoders] Custom Tree Renderer for ADG in Flex 4

2010-07-01 Thread mregert
Is it possible to override the Advanced Data Grid's tree renderer with a custom 
tree renderer?  I have created a customized tree renderer, and have not found a 
way to override the default tree renderer for the ADG.  This is in Flex 4.



[flexcoders] Use custom tree renderer on ADG

2010-07-01 Thread mregert
I have extended the Flex 4 tree control to add new functionality, components.  
I'd liketo use this new tree inside of an AdvancedDataGrid.  I can get the 
regular tree to render in the ADG, but how do I use my new tree?  I've tried 
setting the ItemRenderer for the ADG to my tree, no luck. I have tried setting 
the item renderer for the AdvancedDataGridColumn I want the tree to render in, 
but no luck.  Any suggestions?





[flexcoders] Re: Is there a way to reach into a skinClass of a component and update a property?

2010-07-01 Thread dorkie dork from dorktown
I think I found the answer in "myComponent.skin". i wish there was a
skin properties object on UIComponents. if i want to set a property in
a skin there's no way to do that without extending the component and
adding the property to the subclass. it's not a far fetched idea. in
HTML there is a style attribute that accepts an object literal, for
example:



normally you would want to separate the view from the model etc but
with skins it's a new type of view. some properties pass from the host
component to the skin. if you're making your own skins you're probably
having to add custom properties.

On Thu, Jul 1, 2010 at 7:34 PM, dorkie dork from dorktown
 wrote:
> I have a RadioButton component that uses a custom skin. This skin has
> a text field on it that contains the number of items that can change
> over time. Is there a way to access this property and update the
> value?
>
> JP
>


[flexcoders] Re: How to remove duplicate objects from an array of objects

2010-07-01 Thread Amy
Both Array (which is the source of the AC) and ArrayCollection have methods 
that allow you to filter based on characteristics.

HTH;

Amy

--- In flexcoders@yahoogroups.com, "Warren"  wrote:
>
> nope -- problem is that indexOf, contains, etc is not matching the object 
> itself.  seems to be matching references which means that everything is 
> "unique"
> 
> 
>   - Original Message - 
>   From: Oleg Sivokon 
>   To: flexcoders@yahoogroups.com 
>   Sent: Thursday, July 01, 2010 2:53 AM
>   Subject: Re: [flexcoders] How to remove duplicate objects from an array of 
> objects
> 
> 
> 
> 
>   var i:int = myArray.length;
>   var obj:Object;
>   while (i--)
>   {
>   obj = myArray[i];
> 
>   if (myArray.indexOf(obj) !== myArray.lastIndexOf(obj))
>   myArray.splice(i, 1);
>   }
>   Anything like this?
>




[flexcoders] Is there a way to reach into a skinClass of a component and update a property?

2010-07-01 Thread dorkie dork from dorktown
I have a RadioButton component that uses a custom skin. This skin has
a text field on it that contains the number of items that can change
over time. Is there a way to access this property and update the
value?

JP


[flexcoders] Re: Issue related to Drag and Drop rows between Datagrid when using ItemRenderer...

2010-07-01 Thread shahjitesh
Help please...

I had datachanged event to capture row# and column#. So I added 
initializeComponent method over there which is invoked by CreateionComplete and 
things are working now.

But now issue is it does exactly same stuff it does when it is rendered for the 
first time that is goes to DB and get the data and uses it to plot the graph. I 
would like to avoid database trip if the InitializeComponent is called from 
dataChanged event. 

How can I acheive this?




Re: [flexcoders] How to remove duplicate objects from an array of objects

2010-07-01 Thread Oleg Sivokon
Woops, sorry, it appears that objects created using new Object syntax are
sorted differently from objects created using literal...

var o:Object = new Object();
o.bar = "345";
o.foo = "123";
var result:Array = this.removeDuplicates(
[
{ foo:"123", bar:"345" },
{ foo:"123", bar:"345", foobar:"789" },
{ foo:"123", bar:"347" },
{ foo:"123", bar:345 },
{ bar:"345", foo:"123" }, o
]);

So, my code won't work in that case... well whoops...


RE: [flexcoders] how to filter our a column in datagrid?

2010-07-01 Thread Scott
You could set the column width to 0...

 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of coder3
Sent: Thursday, July 01, 2010 1:37 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] how to filter our a column in datagrid?

 

  


Hi

it's a little complicated.

i have a datagrid with student info:

name | class | grade

what i want is, if the row has no class and grade data, i want to remove
this row from the datagrade.

I don't want to change the object in the datagrid dataprovider array,
because the array needs to be used some other places. 

how do i do it?

thanks

C.
-- 
View this message in context:
http://old.nabble.com/how-to-filter-our-a-column-in-datagrid--tp29049075
p29049075.html
Sent from the FlexCoders mailing list archive at Nabble.com.




-- 
This message has been scanned for viruses and 
dangerous content by MailScanner  , and is

believed to be clean. 


[flexcoders] Re: data-specific createChildren() question

2010-07-01 Thread djbrown_rotonews
thanks, Alex. 

Those were my initial thoughts, just wasn't sure if there was a best practices 
method that would apply here.

--- In flexcoders@yahoogroups.com, Alex Harui  wrote:
>
> There is no right answer, it will depend.  If tearing down and building up 
> the other sets in the 5% case is extremely time-consuming, you may wish to 
> just hide them, but if you end up hiding tons of stuff you'll be wasting 
> memory as well.
> 
> The profiler and testing scrolling visually will tell you the right way for 
> your situation.
> 
> 
> On 7/1/10 1:26 PM, "djbrown_rotonews"  wrote:
> 
> 
> 
> 
> 
> 
> I've got a custom item renderer extending UIComponent that can have 3 base 
> 'states' depending on the nature of the data that it is displaying. Each of 
> these states have minor UI tweaks re: the children that are added to the 
> display list etc.. (# of UITextFields, icons etc...)
> 
> Am I better off creating all the possible children in the createChildren() 
> method and hiding them in updateDisplayList() based on the specifics of the 
> data, or creating just those that are needed in set data() (tearing down the 
> children and rebuilding if my renderer isn't being used to display the same 
> 'state'; if it's being recycled to render the same basic state, I don't 
> bother remove/add the children again ) and doing essentially nothing in the 
> createChildren() method?
> 
> If it matters, about 95% of my renderers will be used for one 'state' of the 
> data, with the remaining 5% being split between the other two states.
> 
> 
> 
> 
> 
> 
> --
> Alex Harui
> Flex SDK Team
> Adobe System, Inc.
> http://blogs.adobe.com/aharui
>




Re: [flexcoders] How to remove duplicate objects from an array of objects

2010-07-01 Thread Oleg Sivokon
ObjectUtils sorts them on purpose, that's a bit different ;)


Re: [flexcoders] data-specific createChildren() question

2010-07-01 Thread Alex Harui
There is no right answer, it will depend.  If tearing down and building up the 
other sets in the 5% case is extremely time-consuming, you may wish to just 
hide them, but if you end up hiding tons of stuff you’ll be wasting memory as 
well.

The profiler and testing scrolling visually will tell you the right way for 
your situation.


On 7/1/10 1:26 PM, "djbrown_rotonews"  wrote:






I've got a custom item renderer extending UIComponent that can have 3 base 
'states' depending on the nature of the data that it is displaying. Each of 
these states have minor UI tweaks re: the children that are added to the 
display list etc.. (# of UITextFields, icons etc...)

Am I better off creating all the possible children in the createChildren() 
method and hiding them in updateDisplayList() based on the specifics of the 
data, or creating just those that are needed in set data() (tearing down the 
children and rebuilding if my renderer isn't being used to display the same 
'state'; if it's being recycled to render the same basic state, I don't bother 
remove/add the children again ) and doing essentially nothing in the 
createChildren() method?

If it matters, about 95% of my renderers will be used for one 'state' of the 
data, with the remaining 5% being split between the other two states.






--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui


Re: [flexcoders] Multiple instances of a module with different styles

2010-07-01 Thread Alex Harui
Basicallly, you can’t do exactly that because you are still trying to use type 
selectors (Button is a type selector).  Also, I don’t think you can load two 
CSS style SWFs with the same selector name/path.

One thing you can do is to define class selectors in each style module with a 
computable prefix like:

.style1Button
{
color: red;
}

.style2Button
{
color: green;
}

Then assign the selectors or calculate the styleName property as needed.


On 7/1/10 11:09 AM, "Haykel BEN JEMIA"  wrote:






Hi Alex,

ok it's clear with the factory. But how can I handle the following scenario 
with class selectors :

Module 'MyModule':
* Module has a button with style name 'myButton'
* Module gets a url for a style file from main application and loads it with 
styleManager.loadStyleDeclarations(mystyle)

Application:
* Creates ModuleLoader 1 with url 'MyModule.swf' and pass it style url 
'style1.swf' which defines 'Button.myButton' with text color red
* Creates ModuleLoader 2 with url 'MyModule.swf' and pass it style url 
'style2.swf' which defines 'Button.myButton' with text color green

I want to have one module with red text and the other with green text. What I'm 
getting now is that both use sometimes one color and sometimes the other, I 
think depending on which styles are loaded first.

Thanks,

Haykel Ben Jemia

Allmas
Web & RIA Development
http://www.allmas-tn.com




On Thu, Jul 1, 2010 at 5:58 PM, Alex Harui  wrote:





A module is a factory for multiple instances of a class(es).  Type selectors 
map to a class.

Per-instance styles are often done with class selectors via the styleName 
property



On 7/1/10 9:37 AM, "Haykel BEN JEMIA" http://hayke...@gmail.com> > wrote:






Hi,

I have a Flex 4 application that loads modules dynamically. The modules load 
style files dynamically based on their configuration files, so that every 
module can load different style files. If multiple instances of a module are 
created (with multiple ModuleLoader instances having the same url), everytime 
an instance loads a style file, it gets also applied (partially) to the other 
instances so that all instances end up with mixed styles.

I originally thought that the per-module styles feature of Flex 4 should allow 
every module to apply its own styles, but it seems like it's more a 
"per-module-type style".

Is there any way to load styles "per module instance"?

Thanks,

Haykel Ben Jemia

Allmas
Web & RIA Development
http://www.allmas-tn.com







--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui


[flexcoders] data-specific createChildren() question

2010-07-01 Thread djbrown_rotonews
I've got a custom item renderer extending UIComponent that can have 3 base 
'states' depending on the nature of the data that it is displaying. Each of 
these states have minor UI tweaks re: the children that are added to the 
display list etc.. (# of UITextFields, icons etc...)

Am I better off creating all the possible children in the createChildren() 
method and hiding them in updateDisplayList() based on the specifics of the 
data, or creating just those that are needed in set data() (tearing down the 
children and rebuilding if my renderer isn't being used to display the same 
'state'; if it's being recycled to render the same basic state, I don't bother 
remove/add the children again ) and doing essentially nothing in the 
createChildren() method?


If it matters, about 95% of my renderers will be used for one 'state' of the 
data, with the remaining 5% being split between the other two states.



Re: [flexcoders] How to remove duplicate objects from an array of objects

2010-07-01 Thread Warren
so far everything I've tried indicates properties are written out in a fixed 
order no matter how much i fool around with them.  Same thing with the 
objectUtils stuff.  Always writes out in the same order


  - Original Message - 
  From: Oleg Sivokon 
  To: flexcoders@yahoogroups.com 
  Sent: Thursday, July 01, 2010 2:32 PM
  Subject: Re: [flexcoders] How to remove duplicate objects from an array of 
objects




  Hey, you are welcome so far it works! :) I'm only afraid of the situation 
when properties are not written in the same order. To be honest, I need to read 
up the AMF specs to see if that was by chance, or was that the how AMF is 
supposed to work. (I tried to initialize the properties in different order, and 
delete and declare them again, and it seems like it works, however, who knows, 
it still may be by chance).

  

Re: [flexcoders] How to remove duplicate objects from an array of objects

2010-07-01 Thread Oleg Sivokon
Hey, you are welcome so far it works! :) I'm only afraid of the situation
when properties are not written in the same order. To be honest, I need to
read up the AMF specs to see if that was by chance, or was that the how AMF
is supposed to work. (I tried to initialize the properties in different
order, and delete and declare them again, and it seems like it works,
however, who knows, it still may be by chance).


RE: [flexcoders] Re: datagrid column sorting

2010-07-01 Thread Scott
Ah, I read it wrong then...
 
The problem is that the component/object will be created/completed well before 
the data is populated.  I've also removed the header from the function 
(header="0") and I actually only have one "visible" column in the datagrid.  
I'm using the dataGrid as sort of an advanced list object.
 
Is there a way to sort as items are placed in the arraycollection?



From: flexcoders@yahoogroups.com on behalf of valdhor
Sent: Thu 7/1/2010 8:11 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: datagrid column sorting


  

Are you expecting the datagrid to sort when first shown or when you click on 
the column header? The code you have will only be called when you click on the 
column header.

To sort when first shown you will need a creation complete function where you 
would create a new sort and refresh.

--- In flexcoders@yahoogroups.com  , 
"Scott"  wrote:
>
> Take this scenario:
> 
> 
> 
> .
> 
> 
> 
> [Bindable] public var acAppts:ArrayCollection = new ArrayCollection();
> 
> 
> 
> private function sortDate(itemA:Object, itemB:Object):int 
> 
> {
> 
> return ObjectUtil.dateCompare( itemA.dtCreated,itemB.dtCreated);
> 
> }
> 
> 
> 
> 
> 
> ...
> 
> 
> 
>  headerHeight="0" dataProvider="{acAppts}" wordWrap="true"
> editable="false" disabledColor="#c3c7c7" enabled="{!bDisabled}"
> visible="{!bDisabled}" itemRollOut="deleteToolTip(event)"
> 
> itemRollOver="createToolTip(event)"
> itemClick="ShowReservationDetails();" change="sortArray()" >
> 
> 
> 
>  
> 
>  sortCompareFunction="sortDate" visible="true" />
> 
>  
> 
> 
> 
> 
> 
> 
> 
> I should be sorting on the dtCreated field which is a date. However,
> it's not occurring. If I set a breakpoint on the sortDate function, it
> never gets hit.
> 
> 
> 
> I'm not sure if the reason is because the parent component populates the
> acAppts which doesn't cause a trigger for the dataGrid to run the sort
> function or what. Anyone have an idea on what is going on with this?
>





-- 
This message has been scanned for viruses and 
dangerous content by MailScanner  , and is 
believed to be clean. 
<>

Re: [flexcoders] how to filter our a column in datagrid?

2010-07-01 Thread Bill Sahlas
Filtering a copy of the ArrayCollection and set the dataProvider to that 
filtered copy is one way.


On 7/1/10 2:36 PM, "coder3"  wrote:







Hi

it's a little complicated.

i have a datagrid with student info:

name | class | grade

what i want is, if the row has no class and grade data, i want to remove
this row from the datagrade.

I don't want to change the object in the datagrid dataprovider array,
because the array needs to be used some other places.

how do i do it?

thanks

C.

Thanks,
Bill



[flexcoders] how to filter our a column in datagrid?

2010-07-01 Thread coder3

Hi

it's a little complicated.

i have a datagrid with student info:

name | class | grade


what i want is, if the row has no class and grade data, i want to remove
this row from the datagrade.

I don't want to change the object in the datagrid dataprovider array,
because the array needs to be used some other places. 

how do i do it?

thanks

C.
-- 
View this message in context: 
http://old.nabble.com/how-to-filter-our-a-column-in-datagrid--tp29049075p29049075.html
Sent from the FlexCoders mailing list archive at Nabble.com.



Re: [flexcoders] Multiple instances of a module with different styles

2010-07-01 Thread Haykel BEN JEMIA
Hi Alex,

ok it's clear with the factory. But how can I handle the following scenario
with class selectors :

Module 'MyModule':
* Module has a button with style name 'myButton'
* Module gets a url for a style file from main application and loads it with
styleManager.loadStyleDeclarations(mystyle)

Application:
* Creates ModuleLoader 1 with url 'MyModule.swf' and pass it style url
'style1.swf' which defines 'Button.myButton' with text color red
* Creates ModuleLoader 2 with url 'MyModule.swf' and pass it style url
'style2.swf' which defines 'Button.myButton' with text color green

I want to have one module with red text and the other with green text. What
I'm getting now is that both use sometimes one color and sometimes the
other, I think depending on which styles are loaded first.

Thanks,

Haykel Ben Jemia

Allmas
Web & RIA Development
http://www.allmas-tn.com




On Thu, Jul 1, 2010 at 5:58 PM, Alex Harui  wrote:

>
>
> A module is a factory for multiple instances of a class(es).  Type
> selectors map to a class.
>
> Per-instance styles are often done with class selectors via the styleName
> property
>
>
>
> On 7/1/10 9:37 AM, "Haykel BEN JEMIA"  wrote:
>
>
>
>
>
>
> Hi,
>
> I have a Flex 4 application that loads modules dynamically. The modules
> load style files dynamically based on their configuration files, so that
> every module can load different style files. If multiple instances of a
> module are created (with multiple ModuleLoader instances having the same
> url), everytime an instance loads a style file, it gets also applied
> (partially) to the other instances so that all instances end up with mixed
> styles.
>
> I originally thought that the per-module styles feature of Flex 4 should
> allow every module to apply its own styles, but it seems like it's more a
> "per-module-type style".
>
> Is there any way to load styles "per module instance"?
>
> Thanks,
>
> Haykel Ben Jemia
>
> Allmas
> Web & RIA Development
> http://www.allmas-tn.com
>
>
>
>
>
>
>
> --
> Alex Harui
> Flex SDK Team
> Adobe System, Inc.
> http://blogs.adobe.com/aharui
>  
>


Re: [flexcoders] How to remove duplicate objects from an array of objects

2010-07-01 Thread Warren
This routine is very sweet.  And very clever.  So much better than using the 
objectUtil and Dict concept. 

Oleg, I can't thank you enough.  I never would have went down this path.  I 
really appreciate the code and especially the insight into a different method..

Warren


  - Original Message - 
  From: Oleg Sivokon 
  To: flexcoders@yahoogroups.com 
  Sent: Thursday, July 01, 2010 11:49 AM
  Subject: Re: [flexcoders] How to remove duplicate objects from an array of 
objects




  Actually, here it is:


  package  
  {
import flash.display.Sprite;
import flash.utils.ByteArray;

/**
* ...
* @author wvxvw
*/
public class RemoveDuplicatesThroughByteArray extends Sprite
{
private var _patternA:ByteArray = new ByteArray();
private var _patternB:ByteArray = new ByteArray();

public function RemoveDuplicatesThroughByteArray() 
{
super();
var result:Array = this.removeDuplicates(
[
{ foo:"123", bar:"345" },
{ foo:"123", bar:"345", foobar:"789" },
{ foo:"123", bar:"347" },
{ foo:"123", bar:345 },
{ bar:"345", foo:"123" }
]);
this.dump(result);
}

private function dump(object:Object, depth:int = 0):void
{
var tabs:String = "\t\t\t\t\t\t\t\t\t\t".substr(0, 
depth - 10);
for (var p:String in object)
{
trace(tabs, p, "=", object[p]);
this.dump(object[p], depth + 1);
}
}

private function removeDuplicates(array:Array):Array
{
this._patternB.clear();
this._patternB.length = 0;
// If we write the whole thing ar once, the constants 
(such as strings
// and numbers will be cached)
// It looks like the properties are always written in 
the same 
// (reverse alphabetic) order. If you can prove this is 
wrong, 
// suppose the algorithm is not working!
for each (var o:Object in array)
this._patternB.writeObject(o);
return array.filter(filterHelper);
}

private function filterHelper(object:Object, index:int, 
all:Array):Boolean
{
var bytes:ByteArray;
var pos:int;
var nextPos:int;
var prevPos:int;
var len:int = all.length;

this._patternA.clear();
this._patternA.length = 0;
this._patternA.writeObject(object);
this._patternB.position = 0;
while (pos <= index)
{
this._patternB.readObject();
pos++;
}
prevPos = this._patternB.position;
main: while (pos < len)
{
this._patternB.position = prevPos;
this._patternB.readObject();
nextPos = this._patternB.position;
this._patternB.position = prevPos;
this._patternA.position = 0;
while (this._patternB.position < nextPos)
{
if (this._patternB.readUnsignedByte() 
!== 

this._patternA.readUnsignedByte())
{
prevPos = nextPos;
pos++;
continue main;
}
}
return false;
}
return true;
}
}
  }

  

[flexcoders] transition in child component to trigger transition in parent

2010-07-01 Thread tex_learning_flex
I have an event in a component that triggers a transition.

I now need the same event to initiate a transition in the component's parent.

Any ideas on how to accomplish this?

many thanks,

Tex




[flexcoders] Symbian on Elips

2010-07-01 Thread gabriela.perry
Hi.

First, sorry for posting a not-flex-question, but I thought that maybe here 
there are some elips users.

So: did someone here managed to create self-signed apps for symbian using elips?

Elips seems to create only sis files, which I cant install (i dont own a 
certificate of any kind)

Thanks.



Re: [flexcoders] How to remove duplicate objects from an array of objects

2010-07-01 Thread Warren
wow.  You just impressed the heck out of me and made my head hurt.  I'm going 
to have to chew on this for a bit. 


  - Original Message - 
  From: Oleg Sivokon 
  To: flexcoders@yahoogroups.com 
  Sent: Thursday, July 01, 2010 11:49 AM
  Subject: Re: [flexcoders] How to remove duplicate objects from an array of 
objects




  Actually, here it is:


  package  
  {
import flash.display.Sprite;
import flash.utils.ByteArray;

/**
* ...
* @author wvxvw
*/
public class RemoveDuplicatesThroughByteArray extends Sprite
{
private var _patternA:ByteArray = new ByteArray();
private var _patternB:ByteArray = new ByteArray();

public function RemoveDuplicatesThroughByteArray() 
{
super();
var result:Array = this.removeDuplicates(
[
{ foo:"123", bar:"345" },
{ foo:"123", bar:"345", foobar:"789" },
{ foo:"123", bar:"347" },
{ foo:"123", bar:345 },
{ bar:"345", foo:"123" }
]);
this.dump(result);
}

private function dump(object:Object, depth:int = 0):void
{
var tabs:String = "\t\t\t\t\t\t\t\t\t\t".substr(0, 
depth - 10);
for (var p:String in object)
{
trace(tabs, p, "=", object[p]);
this.dump(object[p], depth + 1);
}
}

private function removeDuplicates(array:Array):Array
{
this._patternB.clear();
this._patternB.length = 0;
// If we write the whole thing ar once, the constants 
(such as strings
// and numbers will be cached)
// It looks like the properties are always written in 
the same 
// (reverse alphabetic) order. If you can prove this is 
wrong, 
// suppose the algorithm is not working!
for each (var o:Object in array)
this._patternB.writeObject(o);
return array.filter(filterHelper);
}

private function filterHelper(object:Object, index:int, 
all:Array):Boolean
{
var bytes:ByteArray;
var pos:int;
var nextPos:int;
var prevPos:int;
var len:int = all.length;

this._patternA.clear();
this._patternA.length = 0;
this._patternA.writeObject(object);
this._patternB.position = 0;
while (pos <= index)
{
this._patternB.readObject();
pos++;
}
prevPos = this._patternB.position;
main: while (pos < len)
{
this._patternB.position = prevPos;
this._patternB.readObject();
nextPos = this._patternB.position;
this._patternB.position = prevPos;
this._patternA.position = 0;
while (this._patternB.position < nextPos)
{
if (this._patternB.readUnsignedByte() 
!== 

this._patternA.readUnsignedByte())
{
prevPos = nextPos;
pos++;
continue main;
}
}
return false;
}
return true;
}
}
  }

  

Re: [flexcoders] Multiple instances of a module with different styles

2010-07-01 Thread Alex Harui
A module is a factory for multiple instances of a class(es).  Type selectors 
map to a class.

Per-instance styles are often done with class selectors via the styleName 
property


On 7/1/10 9:37 AM, "Haykel BEN JEMIA"  wrote:






Hi,

I have a Flex 4 application that loads modules dynamically. The modules load 
style files dynamically based on their configuration files, so that every 
module can load different style files. If multiple instances of a module are 
created (with multiple ModuleLoader instances having the same url), everytime 
an instance loads a style file, it gets also applied (partially) to the other 
instances so that all instances end up with mixed styles.

I originally thought that the per-module styles feature of Flex 4 should allow 
every module to apply its own styles, but it seems like it's more a 
"per-module-type style".

Is there any way to load styles "per module instance"?

Thanks,

Haykel Ben Jemia

Allmas
Web & RIA Development
http://www.allmas-tn.com







--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui


Re: [flexcoders] How to remove duplicate objects from an array of objects

2010-07-01 Thread Oleg Sivokon
Actually, here it is:

package
{
import flash.display.Sprite;
import flash.utils.ByteArray;
 /**
 * ...
 * @author wvxvw
 */
public class RemoveDuplicatesThroughByteArray extends Sprite
{
private var _patternA:ByteArray = new ByteArray();
private var _patternB:ByteArray = new ByteArray();
 public function RemoveDuplicatesThroughByteArray()
{
super();
var result:Array = this.removeDuplicates(
[
{ foo:"123", bar:"345" },
{ foo:"123", bar:"345", foobar:"789" },
{ foo:"123", bar:"347" },
{ foo:"123", bar:345 },
{ bar:"345", foo:"123" }
]);
this.dump(result);
}
 private function dump(object:Object, depth:int = 0):void
{
var tabs:String = "\t\t\t\t\t\t\t\t\t\t".substr(0, depth - 10);
for (var p:String in object)
{
trace(tabs, p, "=", object[p]);
this.dump(object[p], depth + 1);
}
}
 private function removeDuplicates(array:Array):Array
{
this._patternB.clear();
this._patternB.length = 0;
// If we write the whole thing ar once, the constants (such as strings
// and numbers will be cached)
// It looks like the properties are always written in the same
// (reverse alphabetic) order. If you can prove this is wrong,
// suppose the algorithm is not working!
for each (var o:Object in array)
this._patternB.writeObject(o);
return array.filter(filterHelper);
}
 private function filterHelper(object:Object, index:int, all:Array):Boolean
{
var bytes:ByteArray;
var pos:int;
var nextPos:int;
var prevPos:int;
var len:int = all.length;
 this._patternA.clear();
this._patternA.length = 0;
this._patternA.writeObject(object);
this._patternB.position = 0;
while (pos <= index)
{
this._patternB.readObject();
pos++;
}
prevPos = this._patternB.position;
main: while (pos < len)
{
this._patternB.position = prevPos;
this._patternB.readObject();
nextPos = this._patternB.position;
this._patternB.position = prevPos;
this._patternA.position = 0;
while (this._patternB.position < nextPos)
{
if (this._patternB.readUnsignedByte() !==
this._patternA.readUnsignedByte())
{
prevPos = nextPos;
pos++;
continue main;
}
}
return false;
}
return true;
}
}
}


[flexcoders] Multiple instances of a module with different styles

2010-07-01 Thread Haykel BEN JEMIA
Hi,

I have a Flex 4 application that loads modules dynamically. The modules load
style files dynamically based on their configuration files, so that every
module can load different style files. If multiple instances of a module are
created (with multiple ModuleLoader instances having the same url),
everytime an instance loads a style file, it gets also applied (partially)
to the other instances so that all instances end up with mixed styles.

I originally thought that the per-module styles feature of Flex 4 should
allow every module to apply its own styles, but it seems like it's more a
"per-module-type style".

Is there any way to load styles "per module instance"?

Thanks,

Haykel Ben Jemia

Allmas
Web & RIA Development
http://www.allmas-tn.com


Re: [flexcoders] Re: Could not resolve * to a component implementation.

2010-07-01 Thread Brian J. Ackermann
Here's what the problem was.

I had originally had a file called "Foo.mxml" which contained a lot of
ActionScript Code.  I decided to create a new ActionScript FILE to contain
that script code.  I named the file "Foo.as", to indicate the correlation
with the mxml file.

Renaming this new as file to "foo.as" (lowercase f), resolves the issue.

I'm not at all sure why this would have caused a conflict with the compiler,
since it wasn't a classbut at least I've resolved the issue.

On Thu, Jul 1, 2010 at 7:57 AM, valdhor  wrote:

>
>
> One other thing to check. Make sure you are not using a reserved name for
> your component.
>
>
> --- In flexcoders@yahoogroups.com ,
> "turbo_vb"  wrote:
> >
> > A couple things that you can check that might help:
> >
> > • Make sure that you have an import statement for the component in the
> parent class.
> > • If your component is an AS class, make sure that the package, at the
> top of the class, is correct.
> > • If your component is an AS component make sure that the class name,
> within the component, is correct. If you are using a constructor check that
> too.
> >
> > -TH
> >
> > --- In flexcoders@yahoogroups.com , "Brian
> J. Ackermann"  wrote:
> > >
> > > Hi,
> > >
> > > I'm a wee bit stuck on this, and was hoping you might have some input
> to
> > > help me.
> > >
> > > I'm getting the "Could not resolve * to a component implementation."
> error
> > > message. However, everything I've read about this via Google hasn't
> helped
> > > my case in the slightest. I presume I'm just missing something obvious,
> but
> > > maybe its something more serious.
> > >
> > > So, to solve this problem, I've tried two things, and both work, as far
> as
> > > they take me. First, I added a new component, of the exact same
> variety,
> > > and then copied the contents of the erroring component into it. I
> replace
> > > the viewstack 'page' with the new component (which as near as I can
> tell is
> > > IDENTICAL, but with a different name), and the compiler error goes
> away.
> > >
> > > I can also solve this by simply renaming the original component &
> letting
> > > FB4 refactor for me. The error goes away again. But if I then re-rename
> > > back to the original name, I get the compiler error again.
> > >
> > > I've tried to clean the project several times, and that doesn't help.
> > >
> > > I'd really like to understand what I've done wrong here. What am I
> missing?
> > >
> > > Thanks much!
> > >
> >
>
>  
>


Re: [flexcoders] How to remove duplicate objects from an array of objects

2010-07-01 Thread Oleg Sivokon
Duh! Gmail isn't the best place to write the code! :)

var ba0:ByteArray = new ByteArray();
var ba1:ByteArray = new ByteArray();
var len:int;

for ( ... )
{
ba0.writeObject( ... );
ba1.writeObject( ... );
if (ba0.length !== ba1.length) // objects are different
len = (ba0.length >>> 2) << 2;
while (ba0.position < len)
{
if (ba0.readUnsignedInt() !== ba1.readUnsignedInt()) // objects are
different
}
while (ba0.bytesAvailable)
{
if (ba0.readUnsignedByte() !== ba1.readUnsignedByte()) // objects
are different
}
ba0.clear();
ba1.clear();
}

Sorry :)


Re: [flexcoders] How to remove duplicate objects from an array of objects

2010-07-01 Thread Oleg Sivokon
var ba0:ByteArray = new ByteArray();
var ba1:ByteArray = new ByteArray();
var len:int;
var tail:int;

for ( ... )
{
ba0.writeObject( ... );
ba1.writeObject( ... );
if (ba0.length !== ba1.length) // objects are different
len = (ba0.length >>> 2) << 2;
while (ba0.position < len)
{
if (ba0.readUnsignedInt() !== ba1.readUnsignedInt()) // objects are
different
}
while (ba0.bytesAvailable)
{
if (ba0.readUnsignedByte() !== ba0.readUnsignedByte()) // objects
are different
}
ba0.clear();
ba1.clear();
}

Sorry, forgot the important thing :)


Re: [flexcoders] How to remove duplicate objects from an array of objects

2010-07-01 Thread Oleg Sivokon
You can do pretty well with only two ByteArrays,
var ba0:ByteArray = new ByteArray();
var ba1:ByteArray = new ByteArray();
var len:int;
var tail:int;

for ( ... )
{
ba0.writeObject( ... );
ba1.writeObject( ... );
if (ba0.length !== ba1.length) // objects are different
len = (ba0.length >>> 2) << 2;
while (ba0.position < len)
{
if (ba0.readUnsignedInt() !== ba1.readUnsignedInt()) // objects are
different
}
while (ba0.bytesAvailable)
{
if (ba0.readUnsignedByte() !== ba0.readUnsignedByte()) // objects
are different
}
}

Or something along those lines.


Re: [flexcoders] How to remove duplicate objects from an array of objects

2010-07-01 Thread Warren
I haven't messed with ByteArrays.   Are you saying to create a bytearray for 
each object in the array and use it as a key in the dict?


  - Original Message - 
  From: Oleg Sivokon 
  To: flexcoders@yahoogroups.com 
  Sent: Thursday, July 01, 2010 9:50 AM
  Subject: Re: [flexcoders] How to remove duplicate objects from an array of 
objects




  If those are simple dynamic objects you can write them to ByteArray and 
compare them, it will be faster than using ObjectUtils.
  Everything in AS, except for numeric types (but not Date), strings and 
booleans are references, Array.indexOf() uses strict equality (compares 
references), so even if there will be 1 and "1" indexOf will not treat them as 
same. But, most of the time this is what you want :)
  There's also Array.filter method, but it's slower then a simple loop. But may 
look somewhat prettier :)

  

Re: [flexcoders] How to remove duplicate objects from an array of objects

2010-07-01 Thread Oleg Sivokon
If those are simple dynamic objects you can write them to ByteArray and
compare them, it will be faster than using ObjectUtils.
Everything in AS, except for numeric types (but not Date), strings and
booleans are references, Array.indexOf() uses strict equality (compares
references), so even if there will be 1 and "1" indexOf will not treat them
as same. But, most of the time this is what you want :)
There's also Array.filter method, but it's slower then a simple loop. But
may look somewhat prettier :)


Re: [flexcoders] How to remove duplicate objects from an array of objects

2010-07-01 Thread Warren
nope -- problem is that indexOf, contains, etc is not matching the object 
itself.  seems to be matching references which means that everything is "unique"


  - Original Message - 
  From: Oleg Sivokon 
  To: flexcoders@yahoogroups.com 
  Sent: Thursday, July 01, 2010 2:53 AM
  Subject: Re: [flexcoders] How to remove duplicate objects from an array of 
objects




  var i:int = myArray.length;
  var obj:Object;
  while (i--)
  {
  obj = myArray[i];

  if (myArray.indexOf(obj) !== myArray.lastIndexOf(obj))
  myArray.splice(i, 1);
  }
  Anything like this?

  

Re: [flexcoders] How to remove duplicate objects from an array of objects

2010-07-01 Thread Warren
two or more separate instances with the same property values.

I did get it to work using ObjectUtils.toString as the key for the dict object 
but i'm still not sure this is the best way...



  - Original Message - 
  From: Alex Harui 
  To: flexcoders@yahoogroups.com 
  Sent: Thursday, July 01, 2010 12:30 AM
  Subject: Re: [flexcoders] How to remove duplicate objects from an array of 
objects



  Are you trying to find the duplicate references to the same object or two 
separate instances with the same property values?

  You may not get what you want with toString() and is not needed if checking 
for duplicate references.


  On 6/30/10 2:19 PM, "Warren"  wrote:




 
 
   

I have an array of simple objects from which I need to remove the 
duplicates.  I'm thinking about creating a dictionary using as a key the 
toString value of each object.  I'll feed the dictionary by looping through the 
array, then loop over the dictionary and push the items into a new array.

I'm looking for a sanity check.  Is this a decent idea? Has anyone done it 
already and maybe more efficiently?

Thanks!

Warren

   




  -- 
  Alex Harui
  Flex SDK Team
  Adobe System, Inc.
  http://blogs.adobe.com/aharui


  

[flexcoders] Arraycollections

2010-07-01 Thread b.martinelli
Hi,

I looking for informations about extraction data from an arraycollection name 
{myTotals}. Data in arraycollection come from MySQL Database with ZendAMF.

For example : 

   

I want something like that


Thanks



[flexcoders] Re: Insert Record directly from dataGrid

2010-07-01 Thread flexcoderpt

Perhaps you should be a little more specific, but if i understand
correctly, you should check Adobe references on item editors and
renderers.
   Taht should give you a start into what you need (i think).



--- In flexcoders@yahoogroups.com, "mr hank"  wrote:
>
> Hi All,
> I want to ask a question,
> how to input record directly from dataGrid?
>
> please help me..
>



[flexcoders] Re: datagrid column sorting

2010-07-01 Thread valdhor
Are you expecting the datagrid to sort when first shown or when you click on 
the column header? The code you have will only be called when you click on the 
column header.

To sort when first shown you will need a creation complete function where you 
would create a new sort and refresh.

--- In flexcoders@yahoogroups.com, "Scott"  wrote:
>
> Take this scenario:
> 
>  
> 
> .
> 
>  
> 
> [Bindable] public var acAppts:ArrayCollection = new ArrayCollection();
> 
>  
> 
> private function sortDate(itemA:Object, itemB:Object):int 
> 
> {
> 
> return ObjectUtil.dateCompare( itemA.dtCreated,itemB.dtCreated);
> 
> }
> 
>  
> 
>  
> 
> ...
> 
>  
> 
>  headerHeight="0" dataProvider="{acAppts}" wordWrap="true"
> editable="false" disabledColor="#c3c7c7" enabled="{!bDisabled}"
> visible="{!bDisabled}" itemRollOut="deleteToolTip(event)"
> 
>   itemRollOver="createToolTip(event)"
> itemClick="ShowReservationDetails();" change="sortArray()" >
> 
>   
> 
>   
> 
>  sortCompareFunction="sortDate" visible="true" />
> 
>
> 
> 
> 
>  
> 
>  
> 
> I should be sorting on the dtCreated field which is a date.  However,
> it's not occurring.  If I set a breakpoint on the sortDate function, it
> never gets hit.
> 
>  
> 
> I'm not sure if the reason is because the parent component populates the
> acAppts which doesn't cause a trigger for the dataGrid to run the sort
> function or what.  Anyone have an idea on what is going on with this?
>




[flexcoders] Re: flashlog.txt on Mac?

2010-07-01 Thread mitchgrrt
Thanks, copying mm.cfg to home directory does seem to work.  It's not what's 
documented.

- Mitch


--- In flexcoders@yahoogroups.com, Peter Coppens  wrote:
>
> I have mm.cfg (also) in my home dir. Seems to work fine.
> 
> 
> Peter
> 
> On 30 Jun 2010, at 16:57, mitchgrrt wrote:
> 
> > How do I set it up so log messages appear here? And where will the file be?
> > 
> > I've created the file:
> > /Library/Application Support/Macromedia/mm.cfg
> > 
> > and set these lines:
> > TraceOutputFileEnable=1
> > ErrorReportingEnable=1
> > 
> > But I'm not finding a flashlog.txt file. The place I'm looking for it is 
> > here:
> > /Users/mitch/Library/Preferences/Macromedia/Flash Player/Logs/flashlog.txt
> > 
> > Does anybody know how to set it up, and where it will be? (Yes I'm running 
> > the debug version of Flash). Thanks.
> > 
> >
>




[flexcoders] Re: Could not resolve * to a component implementation.

2010-07-01 Thread valdhor
One other thing to check. Make sure you are not using a reserved name for your 
component.

--- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
>
> A couple things that you can check that might help:
> 
>   •   Make sure that you have an import statement for the component 
> in the parent class.
>   •   If your component is an AS class, make sure that the package, 
> at the top of the class, is correct.
>   •   If your component is an AS component make sure that the class 
> name, within the component, is correct.  If you are using a constructor check 
> that too.
> 
> -TH
> 
> --- In flexcoders@yahoogroups.com, "Brian J. Ackermann"  
> wrote:
> >
> > Hi,
> > 
> > I'm a wee bit stuck on this, and was hoping you might have some input to
> > help me.
> > 
> > I'm getting the "Could not resolve * to a component implementation." error
> > message.  However, everything I've read about this via Google hasn't helped
> > my case in the slightest.  I presume I'm just missing something obvious, but
> > maybe its something more serious.
> > 
> > So, to solve this problem, I've tried two things, and both work, as far as
> > they take me.  First, I added a new component, of the exact same variety,
> > and then copied the contents of the erroring component into it.  I replace
> > the viewstack 'page' with the new component (which as near as I can tell is
> > IDENTICAL, but with a different name), and the compiler error goes away.
> > 
> > I can also solve this by simply renaming the original component & letting
> > FB4 refactor for me.  The error goes away again.  But if I then re-rename
> > back to the original name, I get the compiler error again.
> > 
> > I've tried to clean the project several times, and that doesn't help.
> > 
> > I'd really like to understand what I've done wrong here.  What am I missing?
> > 
> > Thanks much!
> >
>




[flexcoders] datagrid column sorting

2010-07-01 Thread Scott
Take this scenario:

 

.

 

[Bindable] public var acAppts:ArrayCollection = new ArrayCollection();

 

private function sortDate(itemA:Object, itemB:Object):int 

{

return ObjectUtil.dateCompare( itemA.dtCreated,itemB.dtCreated);

}

 

 

...

 



  

  



   



 

 

I should be sorting on the dtCreated field which is a date.  However,
it's not occurring.  If I set a breakpoint on the sortDate function, it
never gets hit.

 

I'm not sure if the reason is because the parent component populates the
acAppts which doesn't cause a trigger for the dataGrid to run the sort
function or what.  Anyone have an idea on what is going on with this?



Re: [flexcoders] Re: datagrid checkbox selection

2010-07-01 Thread Akshar Kaul
i guess using the folowing renderer you can achieve you thing.










Akshar Kaul


On Thu, Jul 1, 2010 at 16:15, sunfast_kid  wrote:

>
>
> Thanks Akshar, but don't I need a click event on the checkbox to update the
> dataprovider? The problem is adding a click event to a dynamic checkbox in
> the datagrid.
>
> Richard
>
>
> --- In flexcoders@yahoogroups.com , Akshar
> Kaul  wrote:
> >
> > add a boolean field to the data provider and link it to the check box.
> when
> > you want to find out which rows are selected you can iterate over the
> data
> > provider and check this boolean field.
> >
> > Akshar Kaul
> >
> >
> > On Wed, Jun 30, 2010 at 19:39, sunfast_kid  wrote:
> >
> > >
> > >
> > > Hi
> > >
> > > I have a flex/php program that gets report data from a database with
> php in
> > > xml format and the flex/air frontend displays the data in a datagrid.
> > > Different reports can return different columns which are passed to the
> > > frontend along with the results.
> > >
> > > I then use the xml list of columns to create the datagrid.
> > >
> > > I use this code to add the columns...
> > >
> > > var dgc:DataGridColumn;
> > > var cols:Array = new Array();
> > >
> > > var cb:ClassFactory = new ClassFactory(mx.controls.CheckBox);
> > > cb.properties = {selected: true};
> > >
> > > dgc = new DataGridColumn();
> > > dgc.width = 10;
> > > dgc.itemRenderer = cb;
> > > cols.push(dgc);
> > >
> > > for (var i:int = 0; i > > {
> > > dgc = new
> DataGridColumn(event.result.dataSet.columns.column[i].display);
> > > dgc.dataField = event.result.dataSet.columns.column[i].field;
> > > dgc.width = event.result.dataSet.columns.column[i].width;
> > > cols.push(dgc);
> > > }
> > >
> > > resultGrid.columns = cols;
> > >
> > > I want to be able to choose rows using a checkbox. I can add a column
> with
> > > the checkbox fine, but the normal route would be to link the checkbox
> to the
> > > dataprovider. The problem is, I can't figure out how to add a click
> event to
> > > the dynamic checkbox, nor can I iterate through the datagrid itself to
> find
> > > the state of the checkbox.
> > >
> > > Can anybody help with any suggestions?
> > >
> > > TIA
> > >
> > >
> > >
> >
>
>  
>


[flexcoders] Re: datagrid checkbox selection

2010-07-01 Thread sunfast_kid
Thanks Akshar, but don't I need a click event on the checkbox to update the 
dataprovider? The problem is adding a click event to a dynamic checkbox in the 
datagrid.

Richard

--- In flexcoders@yahoogroups.com, Akshar Kaul  wrote:
>
> add a boolean field to the  data provider and link it to the check box. when
> you want to find out which rows are selected you can iterate over the data
> provider and check this boolean field.
> 
> Akshar Kaul
> 
> 
> On Wed, Jun 30, 2010 at 19:39, sunfast_kid  wrote:
> 
> >
> >
> > Hi
> >
> > I have a flex/php program that gets report data from a database with php in
> > xml format and the flex/air frontend displays the data in a datagrid.
> > Different reports can return different columns which are passed to the
> > frontend along with the results.
> >
> > I then use the xml list of columns to create the datagrid.
> >
> > I use this code to add the columns...
> >
> > var dgc:DataGridColumn;
> > var cols:Array = new Array();
> >
> > var cb:ClassFactory = new ClassFactory(mx.controls.CheckBox);
> > cb.properties = {selected: true};
> >
> > dgc = new DataGridColumn();
> > dgc.width = 10;
> > dgc.itemRenderer = cb;
> > cols.push(dgc);
> >
> > for (var i:int = 0; i > {
> > dgc = new DataGridColumn(event.result.dataSet.columns.column[i].display);
> > dgc.dataField = event.result.dataSet.columns.column[i].field;
> > dgc.width = event.result.dataSet.columns.column[i].width;
> > cols.push(dgc);
> > }
> >
> > resultGrid.columns = cols;
> >
> > I want to be able to choose rows using a checkbox. I can add a column with
> > the checkbox fine, but the normal route would be to link the checkbox to the
> > dataprovider. The problem is, I can't figure out how to add a click event to
> > the dynamic checkbox, nor can I iterate through the datagrid itself to find
> > the state of the checkbox.
> >
> > Can anybody help with any suggestions?
> >
> > TIA
> >
> >  
> >
>




Re: [flexcoders] Re: httpservice.lastresult completes but theres no data.

2010-07-01 Thread Oleg Sivokon
E4X always reduces the  kind of nodes to  because first is
redundant and ambiguous. It is not clear whether the first kind is in fact
two nodes - an element node with a child text node with the value of empty
string, or is it a single element node. It is also longer than needed, if it
is meant to be a single node.

Well, the result was not missing, it's just that the way you printed it out
was not good. XML.toString() prints the value of the node, not the
structure. The value of the self closing node is "". However, toString()
makes an exception if the node to be printed is the root node, it will print
the structure of the node. I don't know what is the reason behind it.


Re: [flexcoders] Re: httpservice.lastresult completes but theres no data.

2010-07-01 Thread Clark Stevenson
Thanks for your help Oleg, Appreciated.

I think your solution makes sense although i think i also may have been
uneducated with the root node.

The server returns  as 

And since data is the root node, it appears to be ignored (or an empty
string like you say).



 



will turn into





And this solved the problem of the missing lastresult.

Clark.


On 1 July 2010 09:27, Oleg Sivokon  wrote:

>
>
> E4X prints the content of self closing nodes as an empty string (if it's
> not the root node). You may want to use toXMLString() to print the structure
> of the node.
>  
>


[flexcoders] New Datagrid announced...

2010-07-01 Thread Gregor Kiddie
Deepa announced that the Spark version of the Datagrid would be in Hero.

 

Are we talking a direct replacement for the MX Datagrid, or the ADG?

 

Let's hope it's more a direct replacement rather than redoing the ADG...
that really was rubbish.

 

Saying that, what additional feature are people looking for in a new
version of the Datagrid?

 

Gk.



RE: [flexcoders] TimeZone issue

2010-07-01 Thread Keith Reinfeld
Ivan, 

 

> Is there any way we can get the Timezone selected by the user in the
operating system from running Flex application? 

The short answer is no.

 

> 720 minutes after UTC can mean "Auckland, Wellington" or "Fiji" 

 

The above is only true when "Auckland, Wellington" is not on Daylight Saving
Time (DST,) -- since "Fiji" does not observe DST, and that, I suspect, is
the real issue. 

You can use getTimezoneOffset() to calculate many of the DST details of the
client machine. For example: 

 

 

*/

// Test for local DST

public function hasLocalDST():Boolean{

var y:Number = new
Date().getFullYear();

var s:Number = new Date(y,
0).getTimezoneOffset();

var e:Number = new Date(y,
5).getTimezoneOffset();

if(s != e){

// DST is
observed

return true;

}else{

// DST is
not observed

return
false;

}

}

 

Similarly, for locales that observe DST, you can work out exactly when DST
starts and ends, whether the locale is in the Northern or Southern
hemisphere, and whether the locale is currently on DST. All assuming, of
course, that the client machine's time settings are correct for the locale. 

 

Regards,

 

Keith Reinfeld
Home Page:  
http://keithreinfeld.home.comcast.net

 

 



Re: [flexcoders] Re: httpservice.lastresult completes but theres no data.

2010-07-01 Thread Oleg Sivokon
E4X prints the content of self closing nodes as an empty string (if it's not
the root node). You may want to use toXMLString() to print the structure of
the node.


[flexcoders] Re: httpservice.lastresult completes but theres no data.

2010-07-01 Thread Clark Stevenson
It seems e4x is the problem.

If i change the httpservice class to "xml"

The lastResult property is shown.

There must be some special rule where this isnt acceptably in e4x:



It only shows under the xml format.

Why is this?

Clark.

On 1 July 2010 00:23, Clark Stevenson  wrote:

>
> Hi everyone.
>
> I have a nightmare problem.
>
> I am using httpservice with e4x.
>
>
> If i was to retrieve an XML file from the server in this simple format:
>
> 
> 
> 
>
>
> If i looked at my httpservice.lastResult i would see the above xml. This
> works perfect.
>
>
> However, in my case, the data may contain no items.
>
> 
> 
>
>
> Now my last result, loads without error, even charles tells me the page
> size etc. However, when i try to look at the result i see nothing... No data
> at all.
>
>
> I have ran out of ideas on what else to test. Is there anything obvious
> which i am missing? Maybe some rule where  is converted
> to  and flex simply does not like this format?
>
>
> Thanks for reading.
>
> Clark.
>


Re: [flexcoders] How to remove duplicate objects from an array of objects

2010-07-01 Thread Oleg Sivokon
var i:int = myArray.length;
var obj:Object;
while (i--)
{
obj = myArray[i];
if (myArray.indexOf(obj) !== myArray.lastIndexOf(obj))
myArray.splice(i, 1);
}
Anything like this?


[flexcoders] Re: Issue related to Drag and Drop rows between Datagrid when using ItemRenderer...

2010-07-01 Thread shahjitesh
I really appreciate for your response. At least I see some hope to get the 
issue resolved. I saw very interesting articles on your blog but i would 
appreciate, if you can direct me to look at specific example related to my 
issue.

I just changed creationComplete to dataChange and immediately started seeing 
lot of null object reference issue as it refers to TextInput which is 
initialized by {data.col1} and that value is used thruout the application for 
various other processing.

Thanx and Regards
--
Jitesh Shah

--- In flexcoders@yahoogroups.com, Alex Harui  wrote:
>
> Renderers are recycled, so using creationComplete isn�t going to work.  See 
> the item renderer category on my blog for more details.  Try using dataChange 
> event instead.
> 
> --
> Alex Harui
> Flex SDK Team
> Adobe System, Inc.
> http://blogs.adobe.com/aharui