[flexcoders] Refreshing Project

2008-10-20 Thread Guilherme Blanco
Hi,

After more than 4h trying everything I know and researched until page
25 of Google results, I give up and decided to ask here.

I wrote a piece of code that was trying to do something like that:

AsyncToken(RemoteObjectInstance.AsyncTokenMethodName).send.apply(
RemoteObjectInstance, args );

This was crashing inside the send method when it was trying to get
remoteObject.concurrency; reporting my the remoteObject == null;

So I changed my code a bit to work around it and leave this call (send
+ unknown number of arguments) to the right place.
Compiled and... nothing. It was referencing to my previous code (the
one with send.apply).

So I started my attempts:

turned off build automatically

refresh + build
refresh + clean + build
clean + build
clean + refresh + build
refresh + build + build
clean + build + build
delete files from filesystem manually + clean + refresh + build + build

turned on build automatically

all previous attempts


I decided then to reboot my system and try again everything. Nothing.

It lasted my attempt to delete the project and import a new one.
I did it no success. Reboot? Ok...

Deleted project again, rebooted, imported again, compiled and... nothing.

Maybe a fresh checkout and merge of patch? Yeah... let's try it and... nothing.
Reboot again? Oh my God!... Nothing!


Now I'm asking to you HOW CAN I GET THIS REFRESHED??!?!??!?!


Regards,

-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


Re: [flexcoders] clear request parameters httpservice

2008-09-25 Thread Guilherme Blanco
var tabpermissions:HTTPService = new HTTPService ();

var params:Object = new Object();
params.test = 'foo';

tabpermissions.send(params);


tabpermissions.cancel();

var params:Object = new Object();
params.test2 = 'foo';

tabpermissions.send(params);


Does that helps?


On Thu, Sep 25, 2008 at 3:08 PM, Jason B [EMAIL PROTECTED] wrote:
 is there a way to clear an httpservice?

 im defining items as

 tabpermissions = new httpservice();
 tabpermissions.request.test;
 tabpermissions.send();

 tabpermissions = new httpservice();
 tabpermissions.request.test2;
 tabpermissions.send();

 now i keep adding new requests dynamically but i dont want to send
 test since i already sent it until the event is chosen.
 how do i clear request area ?

 example i want to post only the items i need ?

 



-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


Re: [flexcoders] Alex going offline for a while

2008-09-18 Thread Guilherme Blanco
Just take a break and have some fun.

Cya

On Thu, Sep 18, 2008 at 2:04 AM, Josh McDonald [EMAIL PROTECTED] wrote:
 Have fun bro :)

 On Thu, Sep 18, 2008 at 2:02 PM, Alex Harui [EMAIL PROTECTED] wrote:

 Well, the time has come for me to take a break from answering flexcoders
 postings.  I'll be turning off my computer around 9pm PDT Thursday and going
 on sabbatical so I won't be thinking about Flex until October 10 or 20.  The
 last 10 days are vacation so I might check in to start getting my brain in
 gear again.



 In the meantime, I'm sure the community will eventually answer everything
 I would anyway, but just in case, here are some possible responses:



 1)  Search the archives

 2)  Google for examples

 3)  Use the debugger

 4)  Use the profiler

 5)  Post the entire stacktrace using a debug build so you get line
 numbers

 6)  Item renderers recycle

 7)  Read my blog

 8)  Feel free to file a bug or enhancement request

 9)  Yes it is probably possible, but has difficulty rating of ___

 10)   Ask Matt or Gordon.



 See you in October



 -Alex


 --
 Therefore, send not to know For whom the bell tolls. It tolls for thee.

 http://flex.joshmcdonald.info/

 :: Josh 'G-Funk' McDonald
 :: 0437 221 380 :: [EMAIL PROTECTED]
 



-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


[flexcoders] Bindable does not behavior in extended class

2008-09-18 Thread Guilherme Blanco
Hi,

Here is my daily question.
I have a class that handles Form + HTTPService (a subclass called
Service w/ events complete and fail) automatically called ServiceForm.
Since most code is replicated in extended classes if you are editing
one item (another HTTPService subclass that retrieves it and assign to
an XML Bindable variable), I optimized in a subclass of ServiceForm.
The name of this class is ServiceEditForm.
Here is the code:

package core.containers
{
public class ServiceEditForm extends ServiceForm
{
[Bindable] public var item:XML;

public function ServiceEditForm()
{
super();
}

override public function getParamObject(httpFormat:Boolean = 
false):Object
{
var params:Object = super.getParamObject(httpFormat);
params.itemId = item.hasOwnProperty('id') ? 
XML(item.id).toString()
: XMLList([EMAIL PROTECTED]).toString();

return params;
}
}
}


And then I have my classes that build EditForms... like
EditCenterForm, for example:


?xml version=1.0 encoding=utf-8?
ServiceEditForm xmlns=core.containers.*
xmlns:mx=http://www.adobe.com/2006/mxml;
xmlns:parton_controls=parton.controls.*
url={Environment.getInstance().MODULE_URL}Center/Edit
complete=handleFormComplete(event)
mx:Script
![CDATA[

import core.Environment;
import core.events.DynEvent;
import mx.controls.Alert;

protected function 
handleFormComplete(event:DynEvent):void
{
Alert.show(event.result.message.toString(), 
Edit Center);
}

]]
/mx:Script

mx:FormItem label=Company: width=600 direction=horizontal
parton_controls:CompanyComboBox id=company width=100%
selectedId={item.hasOwnProperty('company_id') ?
XML(item.company_id).toString() :
XMLList([EMAIL PROTECTED]).toString()}/
/mx:FormItem  

mx:FormItem label=Name: width=600
mx:TextInput id=centerName width=100%
text={item.hasOwnProperty('name') ? XML(item.name).toString() :
XMLList([EMAIL PROTECTED]).toString()}/
/mx:FormItem
/ServiceEditForm


Sorry for that much code... but it's quite simple.

When I do this and compile code, I get these errors:

Severity and DescriptionPathResourceLocation
Creation Time   Id
Access of undefined property _bindings. [Generated code (use -keep to
save): Path: modules\center\forms\EditCenterForm-generated.as, Line:
420, Column: 21]Parton  Unknown 122177894   17180
Access of undefined property _bindingsBeginWithWord. [Generated code
(use -keep to save): Path:
modules\center\forms\EditCenterForm-generated.as, Line: 432, Column:
21] Parton  Unknown 122177900   17183
Access of undefined property _bindingsByDestination. [Generated code
(use -keep to save): Path:
modules\center\forms\EditCenterForm-generated.as, Line: 428, Column:
21] Parton  Unknown 122177899   17182
Access of undefined property _documentDescriptor_. [Generated code
(use -keep to save): Path:
modules\center\forms\EditCenterForm-generated.as, Line: 91, Column:
13] Parton  Unknown 122177893   17179
Access of undefined property _watchers. [Generated code (use -keep to
save): Path: modules\center\forms\EditCenterForm-generated.as, Line:
424, Column: 21]Parton  Unknown 122177896   17181


Anyone has any ideas about how to solve it?
It seems it's an issue regarding the [Bindable] assignment in my
ServiceEditForm class.


Thanks in advance,

-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


Re: [flexcoders] Bindable does not behavior in extended class

2008-09-18 Thread Guilherme Blanco
Hi this is my hierarchy:

class core.containers.Form extends mx.containers.Form
class core.containers.ServiceForm extends core.containers.Form
class core.containers.ServiceEditForm extends core.containers.ServiceForm

And the last class (that is exploding the issue) is:

class modules.center.forms.EditCenterForm extends
core.containers.ServiceEditForm


Does that help you in something?


Regards,

On Thu, Sep 18, 2008 at 11:55 AM, Michael Schmalle
[EMAIL PROTECTED] wrote:
 Hi,

 This might be stupid but your ServiceForm is an EventDispatcher right?

 I have never seen an error quite like that.

 Mike

 On Thu, Sep 18, 2008 at 10:00 AM, Guilherme Blanco
 [EMAIL PROTECTED] wrote:

 Hi,

 Here is my daily question.
 I have a class that handles Form + HTTPService (a subclass called
 Service w/ events complete and fail) automatically called ServiceForm.
 Since most code is replicated in extended classes if you are editing
 one item (another HTTPService subclass that retrieves it and assign to
 an XML Bindable variable), I optimized in a subclass of ServiceForm.
 The name of this class is ServiceEditForm.
 Here is the code:

 package core.containers
 {
 public class ServiceEditForm extends ServiceForm
 {
 [Bindable] public var item:XML;

 public function ServiceEditForm()
 {
 super();
 }

 override public function getParamObject(httpFormat:Boolean = false):Object
 {
 var params:Object = super.getParamObject(httpFormat);
 params.itemId = item.hasOwnProperty('id') ? XML(item.id).toString()
 : XMLList([EMAIL PROTECTED]).toString();

 return params;
 }
 }
 }

 And then I have my classes that build EditForms... like
 EditCenterForm, for example:

 ?xml version=1.0 encoding=utf-8?
 ServiceEditForm xmlns=core.containers.*
 xmlns:mx=http://www.adobe.com/2006/mxml;
 xmlns:parton_controls=parton.controls.*
 url={Environment.getInstance().MODULE_URL}Center/Edit
 complete=handleFormComplete(event)
 mx:Script
 ![CDATA[

 import core.Environment;
 import core.events.DynEvent;
 import mx.controls.Alert;

 protected function handleFormComplete(event:DynEvent):void
 {
 Alert.show(event.result.message.toString(), Edit Center);
 }

 ]]
 /mx:Script

 mx:FormItem label=Company: width=600 direction=horizontal
 parton_controls:CompanyComboBox id=company width=100%
 selectedId={item.hasOwnProperty('company_id') ?
 XML(item.company_id).toString() :
 XMLList([EMAIL PROTECTED]).toString()}/
 /mx:FormItem

 mx:FormItem label=Name: width=600
 mx:TextInput id=centerName width=100%
 text={item.hasOwnProperty('name') ? XML(item.name).toString() :
 XMLList([EMAIL PROTECTED]).toString()}/
 /mx:FormItem
 /ServiceEditForm

 Sorry for that much code... but it's quite simple.

 When I do this and compile code, I get these errors:

 Severity and Description Path Resource Location Creation Time Id
 Access of undefined property _bindings. [Generated code (use -keep to
 save): Path: modules\center\forms\EditCenterForm-generated.as, Line:
 420, Column: 21] Parton Unknown 122177894 17180
 Access of undefined property _bindingsBeginWithWord. [Generated code
 (use -keep to save): Path:
 modules\center\forms\EditCenterForm-generated.as, Line: 432, Column:
 21] Parton Unknown 122177900 17183
 Access of undefined property _bindingsByDestination. [Generated code
 (use -keep to save): Path:
 modules\center\forms\EditCenterForm-generated.as, Line: 428, Column:
 21] Parton Unknown 122177899 17182
 Access of undefined property _documentDescriptor_. [Generated code
 (use -keep to save): Path:
 modules\center\forms\EditCenterForm-generated.as, Line: 91, Column:
 13] Parton Unknown 122177893 17179
 Access of undefined property _watchers. [Generated code (use -keep to
 save): Path: modules\center\forms\EditCenterForm-generated.as, Line:
 424, Column: 21] Parton Unknown 122177896 17181

 Anyone has any ideas about how to solve it?
 It seems it's an issue regarding the [Bindable] assignment in my
 ServiceEditForm class.

 Thanks in advance,

 --
 Guilherme Blanco - Web Developer
 CBC - Certified Bindows Consultant
 Cell Phone: +55 (16) 9166-6902
 MSN: [EMAIL PROTECTED]
 URL: http://blog.bisna.com
 Rio de Janeiro - RJ/Brazil



 --
 Teoti Graphix, LLC
 http://www.teotigraphix.com

 Teoti Graphix Blog
 http://www.blog.teotigraphix.com

 You can find more by solving the problem then by 'asking the question'.
 



-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


Re: [flexcoders] Bindable does not behavior in extended class

2008-09-18 Thread Guilherme Blanco
I tried 2 different ways, without success.

The first one was:

[Bindable] protected var _item:XML;

public function set item(value:XML):void
{
this._item = value;
}

public function get item():XML
{
return this._item;
}


And the second one was to make the class ServiceEditForm as Bindable.
Both exposed me the same issue.


Another ideas?


Regards,

On Thu, Sep 18, 2008 at 12:10 PM, Michael Schmalle
[EMAIL PROTECTED] wrote:
 No,

 That just means your form is an EventDispatcher, I have no idea. :)

 It could have something to do with the XML (binding) and a bug.

 You might try making the Bindable property and object and test if you get
 the same error.

 If that doesn't work try using a getter-setter (for the bindable XML) with
 bindable and use commitProperties().

 Mike

 On Thu, Sep 18, 2008 at 10:59 AM, Guilherme Blanco
 [EMAIL PROTECTED] wrote:

 Hi this is my hierarchy:

 class core.containers.Form extends mx.containers.Form
 class core.containers.ServiceForm extends core.containers.Form
 class core.containers.ServiceEditForm extends core.containers.ServiceForm

 And the last class (that is exploding the issue) is:

 class modules.center.forms.EditCenterForm extends
 core.containers.ServiceEditForm

 Does that help you in something?

 Regards,

 On Thu, Sep 18, 2008 at 11:55 AM, Michael Schmalle
 [EMAIL PROTECTED] wrote:
  Hi,
 
  This might be stupid but your ServiceForm is an EventDispatcher right?
 
  I have never seen an error quite like that.
 
  Mike
 
  On Thu, Sep 18, 2008 at 10:00 AM, Guilherme Blanco
  [EMAIL PROTECTED] wrote:
 
  Hi,
 
  Here is my daily question.
  I have a class that handles Form + HTTPService (a subclass called
  Service w/ events complete and fail) automatically called ServiceForm.
  Since most code is replicated in extended classes if you are editing
  one item (another HTTPService subclass that retrieves it and assign to
  an XML Bindable variable), I optimized in a subclass of ServiceForm.
  The name of this class is ServiceEditForm.
  Here is the code:
 
  package core.containers
  {
  public class ServiceEditForm extends ServiceForm
  {
  [Bindable] public var item:XML;
 
  public function ServiceEditForm()
  {
  super();
  }
 
  override public function getParamObject(httpFormat:Boolean =
  false):Object
  {
  var params:Object = super.getParamObject(httpFormat);
  params.itemId = item.hasOwnProperty('id') ? XML(item.id).toString()
  : XMLList([EMAIL PROTECTED]).toString();
 
  return params;
  }
  }
  }
 
  And then I have my classes that build EditForms... like
  EditCenterForm, for example:
 
  ?xml version=1.0 encoding=utf-8?
  ServiceEditForm xmlns=core.containers.*
  xmlns:mx=http://www.adobe.com/2006/mxml;
  xmlns:parton_controls=parton.controls.*
  url={Environment.getInstance().MODULE_URL}Center/Edit
  complete=handleFormComplete(event)
  mx:Script
  ![CDATA[
 
  import core.Environment;
  import core.events.DynEvent;
  import mx.controls.Alert;
 
  protected function handleFormComplete(event:DynEvent):void
  {
  Alert.show(event.result.message.toString(), Edit Center);
  }
 
  ]]
  /mx:Script
 
  mx:FormItem label=Company: width=600 direction=horizontal
  parton_controls:CompanyComboBox id=company width=100%
  selectedId={item.hasOwnProperty('company_id') ?
  XML(item.company_id).toString() :
  XMLList([EMAIL PROTECTED]).toString()}/
  /mx:FormItem
 
  mx:FormItem label=Name: width=600
  mx:TextInput id=centerName width=100%
  text={item.hasOwnProperty('name') ? XML(item.name).toString() :
  XMLList([EMAIL PROTECTED]).toString()}/
  /mx:FormItem
  /ServiceEditForm
 
  Sorry for that much code... but it's quite simple.
 
  When I do this and compile code, I get these errors:
 
  Severity and Description Path Resource Location Creation Time Id
  Access of undefined property _bindings. [Generated code (use -keep to
  save): Path: modules\center\forms\EditCenterForm-generated.as, Line:
  420, Column: 21] Parton Unknown 122177894 17180
  Access of undefined property _bindingsBeginWithWord. [Generated code
  (use -keep to save): Path:
  modules\center\forms\EditCenterForm-generated.as, Line: 432, Column:
  21] Parton Unknown 122177900 17183
  Access of undefined property _bindingsByDestination. [Generated code
  (use -keep to save): Path:
  modules\center\forms\EditCenterForm-generated.as, Line: 428, Column:
  21] Parton Unknown 122177899 17182
  Access of undefined property _documentDescriptor_. [Generated code
  (use -keep to save): Path:
  modules\center\forms\EditCenterForm-generated.as, Line: 91, Column:
  13] Parton Unknown 122177893 17179
  Access of undefined property _watchers. [Generated code (use -keep to
  save): Path: modules\center\forms\EditCenterForm-generated.as, Line:
  424, Column: 21] Parton Unknown 122177896 17181
 
  Anyone has any ideas about how to solve it?
  It seems it's an issue regarding the [Bindable] assignment in my
  ServiceEditForm class.
 
  Thanks

Re: [flexcoders] Bindable does not behavior in extended class

2008-09-18 Thread Guilherme Blanco
Nope...

It didn't work.

BUT I know how to remove the errors, but then my component will not work.

My Form is just and extension of mx Form + new methods
The ServiceForm adds a a component (one core.rpc.Service instance) and
adds all methods that relates the children (FormItems) and Service
request.

Later, my ServiceEditForm adds another core.rpc.Service instance,
which is responsable to retrieve the item to be editted + other handy
methods.

If I remove the core.rpc.Service object of ServiceForm, everything works fine.
Both instances do not have the same ID.

It's weird, because I have a lot of classes that was already extending
the Service Form and worked VERY WELL.
Maybe because all other classes were including only FormItems? And
that's the only place that includes something different?


Any ideas are VERY appreciated.



Thanks in advance,

On Thu, Sep 18, 2008 at 12:27 PM, Michael Schmalle
[EMAIL PROTECTED] wrote:
 [Bindable] protected var _item:XML;

 public function set item(value:XML):void
 {
 this._item = value;
 }

 public function get item():XML
 {
 return this._item;
 }

 There is a problem with this;

 The way you have written it makes the protected _item bindable.

 Try this;



 protected var _item:XML;

 [Bindable]
 public function set item(value:XML):void
 {
 this._item = value;
 }

 public function get item():XML
 {
 return this._item;
 }


 Mike


 --
 Teoti Graphix, LLC
 http://www.teotigraphix.com

 Teoti Graphix Blog
 http://www.blog.teotigraphix.com

 You can find more by solving the problem then by 'asking the question'.
 



-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


Re: [flexcoders] Bindable does not behavior in extended class

2008-09-18 Thread Guilherme Blanco
The variable name is exactly named item. Is this the issue!?

Please, give more thought about it. I have already reverted all my
work to the previous state but I have  100 lines replicated code
in at least 20 files.


Regards,

On Thu, Sep 18, 2008 at 9:27 PM, Matt Chotin [EMAIL PROTECTED] wrote:
 Have you turned on -keep to see what the generated binding code looks like
 for the class that's failing? This is probably a bug in the binding codegen.
 You need to look at what's different from the files that worked. Check to
 see if it's due to your bindable property being named item or being typed
 as XML. Change the binding expression to be less complicated perhaps? What
 if you wrote a simple function that did the ternary expressions and just
 passed in a parameter that doesn't do any e4x drilldown?

 matt

 On 9/18/08 8:48 AM, Guilherme Blanco [EMAIL PROTECTED] wrote:

 Nope...

 It didn't work.

 BUT I know how to remove the errors, but then my component will not
 work.

 My Form is just and extension of mx Form + new methods
 The ServiceForm adds a a component (one core.rpc.Service instance) and
 adds all methods that relates the children (FormItems) and Service
 request.

 Later, my ServiceEditForm adds another core.rpc.Service instance,
 which is responsable to retrieve the item to be editted + other handy
 methods.

 If I remove the core.rpc.Service object of ServiceForm, everything works
 fine.
 Both instances do not have the same ID.

 It's weird, because I have a lot of classes that was already extending
 the Service Form and worked VERY WELL.
 Maybe because all other classes were including only FormItems? And
 that's the only place that includes something different?

 Any ideas are VERY appreciated.

 Thanks in advance,

 On Thu, Sep 18, 2008 at 12:27 PM, Michael Schmalle
 [EMAIL PROTECTED] mailto:teoti.graphix%40gmail.com  wrote:
 [Bindable] protected var _item:XML;

 public function set item(value:XML):void
 {
 this._item = value;
 }

 public function get item():XML
 {
 return this._item;
 }

 There is a problem with this;

 The way you have written it makes the protected _item bindable.

 Try this;



 protected var _item:XML;

 [Bindable]
 public function set item(value:XML):void
 {
 this._item = value;
 }

 public function get item():XML
 {
 return this._item;
 }


 Mike


 --
 Teoti Graphix, LLC
 http://www.teotigraphix.com

 Teoti Graphix Blog
 http://www.blog.teotigraphix.com

 You can find more by solving the problem then by 'asking the question'.

 



-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


[flexcoders] Multiple requests to load module do weird behaviors in app

2008-09-17 Thread Guilherme Blanco
Hi,


I'm currently working in an extremely big application written in Flex
+ PHP + Oracle.
It's entirely controlled by modules and events dispatching and
listenings to reduce memory overhead.
Each app piece is a module which is loaded when requested to be viewed
and unloaded when closed.

To support this modules dependency, I have this small class that
controls the Module loading in my application:

http://pastebin.com/f73a59279

Static method Environment.getModuleURLFromPackage does something like:
return module.replace( /\./gi, / ) + .swf;
And I implemented a wrapper to DRY module load calls:


public static function loadModule(module:String, handler:Function,
showProgressInfo:Boolean = false):void
{
// Registry to prevent multiple instances of same module
var m:AdvancedModuleLoader = AdvancedModuleLoader.create(module);

m.showProgressInfo = showProgressInfo;
m.addEventListener(ModuleEvent.READY, handler);
m.load();
}


The code to get it working is really simple:


Environment.loadModule(modules.company.dialogs.CreateCompanyWindow,
function (e:ModuleEvent):void
{
// Dialog creation
var dialog:* = e.module.factory.create();

PopUpManager.addPopUp(dialog, Environment.getApplication(), true);
PopUpManager.centerPopUp(dialog);
}, true);


In this example, it opens a module based TitleWindow, but there're a
lot of other situations, like Canvas based Modules, FormItem based,
etc.
What's the issue here?
If I keep calling this execution (for example click a lot of times in
a button), there're different behaviors:

1- It freezes my application
2- It loads the first one and start to open alert messages SWF is not
loadable (one per click)
3- It never finishes to load the module and fails silently
4- It loads the first one (but not the others), but never removes the
progress bar

The most reproduceable ones are numbers 2 and 4.


Can someone please give me any idea how do I fix this?


Thanks in advance,

Best regards,

-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


Re: [flexcoders] Multiple requests to load module do weird behaviors in app

2008-09-17 Thread Guilherme Blanco
Hi Alex,

I never meant to get a ready to use code, I hate that. We only learn
something by doing things by yourself. I just want ideas, that's what
I asked for.

I don't understand one point and maybe you can highlight me.
In the case I do not have the module loaded and I click twice (for
example), I have 2 requests to me called later (only when module is
ready).

Suppose I decide to stack a method call and the module read event just
instantiate the class and call it each time it was scheduled in pipe.
In this situation, I'll have to instantiate through the class name (ie
var foo:* = new my.ns.ClassFoo();), which schedules module to load it
and the idea of module loading/unloading does not work.

Another idea is to try to avoid the ModuleInfo.load() call.
In this situation, the module ready is never called again, so I'll be
unable to call again. This idea is not acceptable, since I may want to
open 2 tabs for example of the same module (for example... Create
Company tab).

In all situations I've imagined, I still rely on ModuleEvent.READY.
Which means I must have to use the event to be able to not load the
module during compilation (only possible through
e.module.factory.create();).
So, it must call ModuleInfo.load() and also only instantiate instances
through e.module.factory.create().
By adding these restrictions... I cannot imagine any other
implementation except the one I wrote.

What does my idea do?
It only has a single ModuleInfo for each module to be loaded and
attach various READY listeners (once per click) to be called when load
is completed.

Hum maybe looking at source now I can understand my issues.
I always attach my listeners to READY event and at the end of READY
event I dispatch the same event again. Maybe I'm in a recursive loop?

Anyway, I'll try to address that
but if you have any other ideas, please share with me. I do not want
code ready, just the concept behind the code. Leave me to implement
it.
That's how I like to work. =)


Thanks in advance,

On Wed, Sep 17, 2008 at 5:29 PM, Alex Harui [EMAIL PROTECTED] wrote:
 I would try to build some way so you only request a module once



 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Guilherme Blanco
 Sent: Wednesday, September 17, 2008 7:11 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Multiple requests to load module do weird behaviors in
 app



 Hi,

 I'm currently working in an extremely big application written in Flex
 + PHP + Oracle.
 It's entirely controlled by modules and events dispatching and
 listenings to reduce memory overhead.
 Each app piece is a module which is loaded when requested to be viewed
 and unloaded when closed.

 To support this modules dependency, I have this small class that
 controls the Module loading in my application:

 http://pastebin.com/f73a59279

 Static method Environment.getModuleURLFromPackage does something like:
 return module.replace( /\./gi, / ) + .swf;
 And I implemented a wrapper to DRY module load calls:

 public static function loadModule(module:String, handler:Function,
 showProgressInfo:Boolean = false):void
 {
 // Registry to prevent multiple instances of same module
 var m:AdvancedModuleLoader = AdvancedModuleLoader.create(module);

 m.showProgressInfo = showProgressInfo;
 m.addEventListener(ModuleEvent.READY, handler);
 m.load();
 }

 The code to get it working is really simple:

 Environment.loadModule(modules.company.dialogs.CreateCompanyWindow,
 function (e:ModuleEvent):void
 {
 // Dialog creation
 var dialog:* = e.module.factory.create();

 PopUpManager.addPopUp(dialog, Environment.getApplication(), true);
 PopUpManager.centerPopUp(dialog);
 }, true);

 In this example, it opens a module based TitleWindow, but there're a
 lot of other situations, like Canvas based Modules, FormItem based,
 etc.
 What's the issue here?
 If I keep calling this execution (for example click a lot of times in
 a button), there're different behaviors:

 1- It freezes my application
 2- It loads the first one and start to open alert messages SWF is not
 loadable (one per click)
 3- It never finishes to load the module and fails silently
 4- It loads the first one (but not the others), but never removes the
 progress bar

 The most reproduceable ones are numbers 2 and 4.

 Can someone please give me any idea how do I fix this?

 Thanks in advance,

 Best regards,

 --
 Guilherme Blanco - Web Developer
 CBC - Certified Bindows Consultant
 Cell Phone: +55 (16) 9166-6902
 MSN: [EMAIL PROTECTED]
 URL: http://blog.bisna.com
 Rio de Janeiro - RJ/Brazil

 



-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


Re: [flexcoders] Multiple requests to load module do weird behaviors in app

2008-09-17 Thread Guilherme Blanco
Ok.

But how would I instantiate another objects without knowing its name then?

Currently I rely on event.module.factory.create(), which is called on
READY event.
By not calling the load() method, it'll never reach the READY event
again, so I'll be unable to use it.

Hm... maybe storing the Class in the Registry item?


Best regards,


On Wed, Sep 17, 2008 at 8:49 PM, Alex Harui [EMAIL PROTECTED] wrote:
 I looked at your code a bit more.  I guess it makes sense.  The
 ModuleManager should be preventing double load() calls and what not, but I
 would check ModuleInfo.ready and not call load() again if it is ready just
 to be safe.



 Also make sure you aren't unloading a module that isn't fully loaded and
 ready.



 Posting the stack traces you get might also help

 -Alex



 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Guilherme Blanco
 Sent: Wednesday, September 17, 2008 3:57 PM
 To: flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] Multiple requests to load module do weird
 behaviors in app



 Hi Alex,

 I never meant to get a ready to use code, I hate that. We only learn
 something by doing things by yourself. I just want ideas, that's what
 I asked for.

 I don't understand one point and maybe you can highlight me.
 In the case I do not have the module loaded and I click twice (for
 example), I have 2 requests to me called later (only when module is
 ready).

 Suppose I decide to stack a method call and the module read event just
 instantiate the class and call it each time it was scheduled in pipe.
 In this situation, I'll have to instantiate through the class name (ie
 var foo:* = new my.ns.ClassFoo();), which schedules module to load it
 and the idea of module loading/unloading does not work.

 Another idea is to try to avoid the ModuleInfo.load() call.
 In this situation, the module ready is never called again, so I'll be
 unable to call again. This idea is not acceptable, since I may want to
 open 2 tabs for example of the same module (for example... Create
 Company tab).

 In all situations I've imagined, I still rely on ModuleEvent.READY.
 Which means I must have to use the event to be able to not load the
 module during compilation (only possible through
 e.module.factory.create();).
 So, it must call ModuleInfo.load() and also only instantiate instances
 through e.module.factory.create().
 By adding these restrictions... I cannot imagine any other
 implementation except the one I wrote.

 What does my idea do?
 It only has a single ModuleInfo for each module to be loaded and
 attach various READY listeners (once per click) to be called when load
 is completed.

 Hum maybe looking at source now I can understand my issues.
 I always attach my listeners to READY event and at the end of READY
 event I dispatch the same event again. Maybe I'm in a recursive loop?

 Anyway, I'll try to address that
 but if you have any other ideas, please share with me. I do not want
 code ready, just the concept behind the code. Leave me to implement
 it.
 That's how I like to work. =)

 Thanks in advance,

 On Wed, Sep 17, 2008 at 5:29 PM, Alex Harui [EMAIL PROTECTED] wrote:
 I would try to build some way so you only request a module once



 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Guilherme Blanco
 Sent: Wednesday, September 17, 2008 7:11 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Multiple requests to load module do weird behaviors
 in
 app



 Hi,

 I'm currently working in an extremely big application written in Flex
 + PHP + Oracle.
 It's entirely controlled by modules and events dispatching and
 listenings to reduce memory overhead.
 Each app piece is a module which is loaded when requested to be viewed
 and unloaded when closed.

 To support this modules dependency, I have this small class that
 controls the Module loading in my application:

 http://pastebin.com/f73a59279

 Static method Environment.getModuleURLFromPackage does something like:
 return module.replace( /\./gi, / ) + .swf;
 And I implemented a wrapper to DRY module load calls:

 public static function loadModule(module:String, handler:Function,
 showProgressInfo:Boolean = false):void
 {
 // Registry to prevent multiple instances of same module
 var m:AdvancedModuleLoader = AdvancedModuleLoader.create(module);

 m.showProgressInfo = showProgressInfo;
 m.addEventListener(ModuleEvent.READY, handler);
 m.load();
 }

 The code to get it working is really simple:

 Environment.loadModule(modules.company.dialogs.CreateCompanyWindow,
 function (e:ModuleEvent):void
 {
 // Dialog creation
 var dialog:* = e.module.factory.create();

 PopUpManager.addPopUp(dialog, Environment.getApplication(), true);
 PopUpManager.centerPopUp(dialog);
 }, true);

 In this example, it opens a module based TitleWindow, but there're a
 lot of other situations, like Canvas based Modules, FormItem based,
 etc.
 What's the issue here?
 If I keep calling this execution (for example click

Re: [flexcoders] Multiple requests to load module do weird behaviors in app

2008-09-17 Thread Guilherme Blanco
Perfect!

I have enough info to solve everything by myself.


Thanks a lot!

On Wed, Sep 17, 2008 at 9:29 PM, Alex Harui [EMAIL PROTECTED] wrote:
 The ModuleInfo.factory should be valid.



 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Guilherme Blanco
 Sent: Wednesday, September 17, 2008 5:06 PM
 To: flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] Multiple requests to load module do weird
 behaviors in app



 Ok.

 But how would I instantiate another objects without knowing its name then?

 Currently I rely on event.module.factory.create(), which is called on
 READY event.
 By not calling the load() method, it'll never reach the READY event
 again, so I'll be unable to use it.

 Hm... maybe storing the Class in the Registry item?

 Best regards,

 On Wed, Sep 17, 2008 at 8:49 PM, Alex Harui [EMAIL PROTECTED] wrote:
 I looked at your code a bit more. I guess it makes sense. The
 ModuleManager should be preventing double load() calls and what not, but I
 would check ModuleInfo.ready and not call load() again if it is ready just
 to be safe.



 Also make sure you aren't unloading a module that isn't fully loaded and
 ready.



 Posting the stack traces you get might also help

 -Alex



 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Guilherme Blanco
 Sent: Wednesday, September 17, 2008 3:57 PM
 To: flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] Multiple requests to load module do weird
 behaviors in app



 Hi Alex,

 I never meant to get a ready to use code, I hate that. We only learn
 something by doing things by yourself. I just want ideas, that's what
 I asked for.

 I don't understand one point and maybe you can highlight me.
 In the case I do not have the module loaded and I click twice (for
 example), I have 2 requests to me called later (only when module is
 ready).

 Suppose I decide to stack a method call and the module read event just
 instantiate the class and call it each time it was scheduled in pipe.
 In this situation, I'll have to instantiate through the class name (ie
 var foo:* = new my.ns.ClassFoo();), which schedules module to load it
 and the idea of module loading/unloading does not work.

 Another idea is to try to avoid the ModuleInfo.load() call.
 In this situation, the module ready is never called again, so I'll be
 unable to call again. This idea is not acceptable, since I may want to
 open 2 tabs for example of the same module (for example... Create
 Company tab).

 In all situations I've imagined, I still rely on ModuleEvent.READY.
 Which means I must have to use the event to be able to not load the
 module during compilation (only possible through
 e.module.factory.create();).
 So, it must call ModuleInfo.load() and also only instantiate instances
 through e.module.factory.create().
 By adding these restrictions... I cannot imagine any other
 implementation except the one I wrote.

 What does my idea do?
 It only has a single ModuleInfo for each module to be loaded and
 attach various READY listeners (once per click) to be called when load
 is completed.

 Hum maybe looking at source now I can understand my issues.
 I always attach my listeners to READY event and at the end of READY
 event I dispatch the same event again. Maybe I'm in a recursive loop?

 Anyway, I'll try to address that
 but if you have any other ideas, please share with me. I do not want
 code ready, just the concept behind the code. Leave me to implement
 it.
 That's how I like to work. =)

 Thanks in advance,

 On Wed, Sep 17, 2008 at 5:29 PM, Alex Harui [EMAIL PROTECTED] wrote:
 I would try to build some way so you only request a module once



 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Guilherme Blanco
 Sent: Wednesday, September 17, 2008 7:11 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Multiple requests to load module do weird behaviors
 in
 app



 Hi,

 I'm currently working in an extremely big application written in Flex
 + PHP + Oracle.
 It's entirely controlled by modules and events dispatching and
 listenings to reduce memory overhead.
 Each app piece is a module which is loaded when requested to be viewed
 and unloaded when closed.

 To support this modules dependency, I have this small class that
 controls the Module loading in my application:

 http://pastebin.com/f73a59279

 Static method Environment.getModuleURLFromPackage does something like:
 return module.replace( /\./gi, / ) + .swf;
 And I implemented a wrapper to DRY module load calls:

 public static function loadModule(module:String, handler:Function,
 showProgressInfo:Boolean = false):void
 {
 // Registry to prevent multiple instances of same module
 var m:AdvancedModuleLoader = AdvancedModuleLoader.create(module);

 m.showProgressInfo = showProgressInfo;
 m.addEventListener(ModuleEvent.READY, handler);
 m.load();
 }

 The code to get it working is really simple:

 Environment.loadModule

Re: [flexcoders] UI Prototype Tool

2008-09-16 Thread Guilherme Blanco
In my case, Paper + Pen to draw screens =)

On Tue, Sep 16, 2008 at 1:17 PM, Rajan Jain [EMAIL PROTECTED] wrote:
 Hi All



 I just wanted to know which tool do you use to prototyping the application
 before actually start coding in flex?



 Thanks

 Rajan

 



-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


[flexcoders] Reaching subclass constant inside base class (similar to self.CONSTANT)

2008-09-16 Thread Guilherme Blanco
Hi,

I have this implementation in my base class:

BaseSelector.mxml:

public static var MODULE:String = core.dialogs.BaseDialog;

protected function handleSelectClick(event:MouseEvent):void
{
Environment.loadModule(BaseSelector.MODULE, function 
(e:ModuleEvent):void
{
// Dialog creation
var dialog:* = UIComponent(e.module.factory.create());

dialog.multipleSelection = multipleSelection;

assignDialogHandlers(dialog);

PopUpManager.addPopUp(dialog, Environment.getApplication(), 
true);
PopUpManager.centerPopUp(dialog);
}, true);
}


As you may see, I have a constant being defined in base class.
Each subclass defines a new MODULE name, and the handleSelectClick
need to be able to load it and instantiate a new Dialog component
(BaseSelector.MODULE).

So imagine I have a CompanySelector.mxml, which extends from BaseSelector.mxml:

public static var MODULE:String = app.dialogs.CompanyDialog;


And nothing else.
The button event listener (handleSelectClick) should be able to
recognize the MODULE defined in subclass and define the subclass one
to be loaded.
I tried it by several ways to achieve the same thing as self in some
known languages, without success.


Has anyone any ideas how to do that?



Regards,

-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


Re: [flexcoders] Reaching subclass constant inside base class (similar to self.CONSTANT)

2008-09-16 Thread Guilherme Blanco
Because later I use this string in an automate form retriever.
Instead of create a dummy instance just to check its class, I compare strings.

So... no solution regarding this topic?

Regards,

On Tue, Sep 16, 2008 at 7:49 PM, Alex Harui [EMAIL PROTECTED] wrote:
 Statics don't override.  Why not make it an instance getter?



 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Guilherme Blanco
 Sent: Tuesday, September 16, 2008 2:18 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Reaching subclass constant inside base class (similar
 to self.CONSTANT)



 Hi,

 I have this implementation in my base class:

 BaseSelector.mxml:

 public static var MODULE:String = core.dialogs.BaseDialog;

 protected function handleSelectClick(event:MouseEvent):void
 {
 Environment.loadModule(BaseSelector.MODULE, function (e:ModuleEvent):void
 {
 // Dialog creation
 var dialog:* = UIComponent(e.module.factory.create());

 dialog.multipleSelection = multipleSelection;

 assignDialogHandlers(dialog);

 PopUpManager.addPopUp(dialog, Environment.getApplication(), true);
 PopUpManager.centerPopUp(dialog);
 }, true);
 }

 As you may see, I have a constant being defined in base class.
 Each subclass defines a new MODULE name, and the handleSelectClick
 need to be able to load it and instantiate a new Dialog component
 (BaseSelector.MODULE).

 So imagine I have a CompanySelector.mxml, which extends from
 BaseSelector.mxml:

 public static var MODULE:String = app.dialogs.CompanyDialog;

 And nothing else.
 The button event listener (handleSelectClick) should be able to
 recognize the MODULE defined in subclass and define the subclass one
 to be loaded.
 I tried it by several ways to achieve the same thing as self in some
 known languages, without success.

 Has anyone any ideas how to do that?

 Regards,

 --
 Guilherme Blanco - Web Developer
 CBC - Certified Bindows Consultant
 Cell Phone: +55 (16) 9166-6902
 MSN: [EMAIL PROTECTED]
 URL: http://blog.bisna.com
 Rio de Janeiro - RJ/Brazil

 



-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


[flexcoders] Dispatching AdvancedDataGrid change event by hand

2008-09-15 Thread Guilherme Blanco
Hi all,


I'm implementing an automate way to select items by passing the id of
rows. The idea is to simple do:

root
  item id=1 /
/root


this.selectedId = 1;

And it'll select the item that has id = 1.


I get everything working as expected, except of events triggering.

When I do a simple this.selectedIndex = i;
If changes the selected row as I want to, but does not trigger the change event.

So I need to manually trigger this event (since I have actions related
to this event).
How to I manually call this event?

I did this for a ComboBox, which had the same issue too... I did that by doing:

this.dispatchEvent(new ListEvent.CHANGE, false, false, 0, i));

But now the component is AdvancedDataGrid. By answering the first
question, I also want to ask about how do I do the same event for
multiple rows selection (when allowMultipleSelection = true).


Thanks in advance,


Best regards,

-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


Re: [flexcoders] Dispatching AdvancedDataGrid change event by hand

2008-09-15 Thread Guilherme Blanco
Hi Tracy,

This is mainly an architectural issue.
The entire code base is based on events dispatching and listening.

I know your suggestion is valid, but that's not the one I'm trying to achieve.


Best regards,

On Mon, Sep 15, 2008 at 6:52 PM, Tracy Spratt [EMAIL PROTECTED] wrote:
 Instead of trying to simulate an itemClick, why not put all of the change
 event actions into a separate function, and call that from both the change
 handler and from the programattic selection function?

 Tracy



 

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Guilherme Blanco
 Sent: Monday, September 15, 2008 4:30 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Dispatching AdvancedDataGrid change event by hand



 Hi all,

 I'm implementing an automate way to select items by passing the id of
 rows. The idea is to simple do:

 root
 item id=1 /
 /root

 this.selectedId = 1;

 And it'll select the item that has id = 1.

 I get everything working as expected, except of events triggering.

 When I do a simple this.selectedIndex = i;
 If changes the selected row as I want to, but does not trigger the change
 event.

 So I need to manually trigger this event (since I have actions related
 to this event).
 How to I manually call this event?

 I did this for a ComboBox, which had the same issue too... I did that by
 doing:

 this.dispatchEvent(new ListEvent.CHANGE, false, false, 0, i));

 But now the component is AdvancedDataGrid. By answering the first
 question, I also want to ask about how do I do the same event for
 multiple rows selection (when allowMultipleSelection = true).

 Thanks in advance,

 Best regards,

 --
 Guilherme Blanco - Web Developer
 CBC - Certified Bindows Consultant
 Cell Phone: +55 (16) 9166-6902
 MSN: [EMAIL PROTECTED]
 URL: http://blog.bisna.com
 Rio de Janeiro - RJ/Brazil

 



-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


Re: [flexcoders] Get xml element name

2008-08-21 Thread Guilherme Blanco
schedules[i].hasOwnProperty('car')

[]s,

On Thu, Aug 21, 2008 at 11:05 AM, markgoldin_2000
[EMAIL PROTECTED] wrote:
 Is there a way to get an xml element name?
 schedule
 train
 100
 /train
 car
 1
 /car
 /schedule

 I want to know if an i element has a name car.

 Thanks

 



-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


Re: [flexcoders] PHP vs. Coldfusion 8 for beginner?

2008-08-20 Thread Guilherme Blanco
It's a bit offtopic, but let's go...

I'd suggest you PHP. Why?
Because it's similar to a lot of languages and the learn path to these
others will be minimized. Learning PHP you'll be able to learn C,
Java, ...
Like if you learn a tab-based language (read as ColdFusion) you'll
have some hard times to move to a structured or object oriented
language.

That's my US$0.02


Cheers,

On Wed, Aug 20, 2008 at 3:46 PM, Howard Fore [EMAIL PROTECTED] wrote:
 I think you could probably do well in either. I've worked in both. I think
 that there's a lot to ColdFusion's Java underpinnings that allow you to take
 advantage of Java libraries in the open source world. Since you mention
 reports, you should know that CFReport/ReportBuilder are based on some
 freely available Java libraries (Jasper and iReport I think). Also the
 cfdocument PDF functionality is iText under the covers. I'm biased towards
 CF as I think the syntax is more readable, but languages are just tools.
 It's what you choose to do with them that counts.

 PS: This is a bit off-topic for flexcoders...

 On Wed, Aug 20, 2008 at 1:38 PM, cox.blair [EMAIL PROTECTED] wrote:

 Okay, so I'm probably going to get a biased response, but which would
 you say would be the best long term strategy for a beginner to learn
 to become proficient with? I'm not looking to learn both, I want to
 pick a combination and stick to it.

 I suspect it is dependant on your background knowledge and what you
 want to do, so, my background is as novice as you get but with
 proficiency to learn. What we are going to do with it is create
 specialized business applications tailored to data analyses and report
 creation.



 --
 Howard Fore, [EMAIL PROTECTED]
 The universe tends toward maximum irony. Don't push it. - Jeff Atwood
 



-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


Re: [flexcoders] PHP vs. Coldfusion 8 for beginner?

2008-08-20 Thread Guilherme Blanco
Pay attention to the way you write your software and you notice what
am I meaning...
Notice to syntax, it's the main reason I said that.

In ColdFusion, to define a variable you do a tag like in HTML: cfset
message=Hello World!
In PHP: $message = (string) Hello World!;
In C#: string message = Hello World!;
In Java: string message = Hello World!;
In C:  String message = Hello World!;
In ActionScript: var message::String = Hello World!;

If you want more, just ask =)

Now pay attention... none of them (except CF) needs a tag. PHP is
loosely typed, so it does not need a cast, I added it just to make the
example more similar.
Now, let's go to a better example IF statement:

CF:
cfif message eq Hi
  !-- Do stuff --
/cfif

PHP:
if ($message == 'Hi') {
// Do stuff
}

C#:
if (message == 'Hi') {
// Do stuff
}

Java:
if (message == 'Hi') {
// Do stuff
}

C:
if (message == 'Hi') {
// Do stuff
}

Which ones are more similar to the rest... PHP or CF?
Of course there're MANY differences between one language and other...
and if you ask me which one is more similar to Java? C#.

So, I'm not telling PHP is like Java or C# or even C. I'm telling you
that the learn path (syntax has less impacts) is minimized if he
decides to learn PHP instead of CF.


Cheers,

On Wed, Aug 20, 2008 at 3:59 PM, Howard Fore [EMAIL PROTECTED] wrote:
 To take this further off-topic, what is it about your PHP experiences that
 have taught you Java and C? What similarities do you find between PHP and
 other languages?

 On Wed, Aug 20, 2008 at 2:53 PM, Guilherme Blanco
 [EMAIL PROTECTED] wrote:

 I'd suggest you PHP. Why?
 Because it's similar to a lot of languages and the learn path to these
 others will be minimized. Learning PHP you'll be able to learn C,
 Java,


 --
 Howard Fore, [EMAIL PROTECTED]
 The universe tends toward maximum irony. Don't push it. - Jeff Atwood
 



-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


Re: [flexcoders] PHP vs. Coldfusion 8 for beginner?

2008-08-20 Thread Guilherme Blanco
Just keep in mind that PHP doesn't do everything.
There're thousands of things PHP can't handle while Java for example
does very well.

BBBUTTT... when PHP isn't able to do, it has bridges to
communicate with someone else that does. What am I talking about?
PHP has an extension to communicate with Java, another with .NET, ...

Short version: When PHP is not able to do something, it has extensions
with someone else that knows how to do that.


Cheers,

On Wed, Aug 20, 2008 at 4:01 PM, Blair Cox [EMAIL PROTECTED] wrote:
 Thanks Guilherme, we've just come to the same conclusion. Given the cost of
 implementing ColdFusion and the limited number features we are currently
 interested in using, we simply can't justify the switch. PHP appears to be
 able to do everything we want to do and it is rooted deeply in our current
 website technologies (Apache, MySQL, Joomla, Drupal, etc). I say I'm a
 novice, but I do have a working knowledge of PHP, I can at least sit down
 and read through a script and understand what is going on. Best to build on
 that knowledge than to switch to another language, again. Overall though, I
 do find them all to be very similar, so that hasn't been an issue. Biggest
 advantage with PHP is the community and resources behind it.

 I guess I don't find this subject too off-topic because it does seem
 important to know how your Flex application actually communicates with the
 server and database.

 Cheers, great list!

 --
 Blair



 
 From: Guilherme Blanco [EMAIL PROTECTED]
 Reply-To: flexcoders@yahoogroups.com
 Date: Wed, 20 Aug 2008 15:53:25 -0300
 To: flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] PHP vs. Coldfusion 8 for beginner?




 It's a bit offtopic, but let's go...

 I'd suggest you PHP. Why?
 Because it's similar to a lot of languages and the learn path to these
 others will be minimized. Learning PHP you'll be able to learn C,
 Java, ...
 Like if you learn a tab-based language (read as ColdFusion) you'll
 have some hard times to move to a structured or object oriented
 language.

 That's my US$0.02

 Cheers,

 On Wed, Aug 20, 2008 at 3:46 PM, Howard Fore [EMAIL PROTECTED]
 mailto:howard.fore%40hofo.com  wrote:
 I think you could probably do well in either. I've worked in both. I think
 that there's a lot to ColdFusion's Java underpinnings that allow you to
 take
 advantage of Java libraries in the open source world. Since you mention
 reports, you should know that CFReport/ReportBuilder are based on some
 freely available Java libraries (Jasper and iReport I think). Also the
 cfdocument PDF functionality is iText under the covers. I'm biased towards
 CF as I think the syntax is more readable, but languages are just tools.
 It's what you choose to do with them that counts.

 PS: This is a bit off-topic for flexcoders...

 On Wed, Aug 20, 2008 at 1:38 PM, cox.blair [EMAIL PROTECTED]
 mailto:blair.cox%40luminultra.com  wrote:

 Okay, so I'm probably going to get a biased response, but which would
 you say would be the best long term strategy for a beginner to learn
 to become proficient with? I'm not looking to learn both, I want to
 pick a combination and stick to it.

 I suspect it is dependant on your background knowledge and what you
 want to do, so, my background is as novice as you get but with
 proficiency to learn. What we are going to do with it is create
 specialized business applications tailored to data analyses and report
 creation.



 --
 Howard Fore, [EMAIL PROTECTED] mailto:howard.fore%40hofo.com
 The universe tends toward maximum irony. Don't push it. - Jeff Atwood


 --
 Guilherme Blanco - Web Developer
 CBC - Certified Bindows Consultant
 Cell Phone: +55 (16) 9166-6902
 MSN: [EMAIL PROTECTED] mailto:guilhermeblanco%40hotmail.com
 URL: http://blog.bisna.com
 Rio de Janeiro - RJ/Brazil



 



-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


Re: [flexcoders] PHP vs. Coldfusion 8 for beginner?

2008-08-20 Thread Guilherme Blanco
Talking about implementation similarities, you're true.
PHP has almost nothing related to Java.

As an example, I'll show you how to concatenate an array using a
separator in PHP and Java:

PHP:
$myArray = array(1, 2, 3, 4, 5);
$myString = implode(', ', $myArray);
echo $myString; // prints: 1, 2, 3, 4, 5

Java:
int[] myArray = {1, 2, 3, 4, 5};
String myString = ;

for (int i = 0; i  myArray.length; i++) {
if (i!=0) { out += ', '; }
myString += myArray[i].toString();
}

System.out.print(myString); // prints: 1, 2, 3, 4, 5


But as I said... someone that has some knowledg in
structured/object-oriented languages is able to read it and knows
better than CF what's going on.
The similarities are smoother, you're able to read a Java code if you
know PHP, aswell as C# if you know Java... but it's a bit hard to read
a Java code if you only know CF.


Cheers,

On Wed, Aug 20, 2008 at 4:29 PM, Howard Fore [EMAIL PROTECTED] wrote:

 On Wed, Aug 20, 2008 at 3:19 PM, Guilherme Blanco
 [EMAIL PROTECTED] wrote:

 Pay attention to the way you write your software and you notice what
 am I meaning...
 Notice to syntax, it's the main reason I said that.

 You left out cfscript for cf:

 message = Hello world!;

 and

 if (message eq Hi!)
 {
   // Do stuff
 }



 Which ones are more similar to the rest... PHP or CF?
 Of course there're MANY differences between one language and other...
 and if you ask me which one is more similar to Java? C#.

 So, I'm not telling PHP is like Java or C# or even C. I'm telling you
 that the learn path (syntax has less impacts) is minimized if he
 decides to learn PHP instead of CF.

 Interesting. My experience has been that the syntax differences are really a
 minor part of learning a new language. Certainly the most obvious
 difference, but the smallest in terms of real mastery and hurdles to
 overcome. Each language has it's own nuances and particular ways of handling
 the same concepts. In this way, PHP (and CF) is verrry different than
 Java or C.

 --
 Howard Fore, [EMAIL PROTECTED]
 The universe tends toward maximum irony. Don't push it. - Jeff Atwood
 



-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


Re: [flexcoders] Re: Flex Tree having 20000 nodes crashes

2008-08-04 Thread Guilherme Blanco
 = 
event.token.result.data.item as XMLList;

// Check if we are attaching children to root 
or an item
if (itemOpeningArray.length  0)
{
// We need to pick the right item now
for (var i:int = 0, len:uint = 
itemOpeningArray.length; i  len; i++)
{   

if 
(XML(itemOpeningArray[i])[EMAIL PROTECTED] == event.token.params.id)
{
var item:XML = 
itemOpeningArray[i];

itemOpeningArray.removeItemAt(i);

break;
}
}

item.setChildren(treeXMLList);
}
else
{
treeDataProvider = treeXMLList;
}


}


protected function 
handleItemFault(event:FaultEvent):void
{
Alert.show(event.fault.toString(), Error 
processing request);
}


protected function sendRequest(id:uint):void
{
// Create POST params
var params:Object = new Object();
params.id = id;

// Dispathing request
var token:AsyncToken = itemService.send(params);
token.params = params;
}

]]
/mx:Script

mx:HTTPService id=itemService method=POST useProxy=false
resultFormat=e4x
result=handleItemResult(event) 
fault=handleItemFault(event)/
/mx:Tree



If you need more help, just ask.


Cheers,


On Mon, Aug 4, 2008 at 6:24 AM, Johannes Nel [EMAIL PROTECTED] wrote:
 The class you need to look at to load sub nodes on demand is
 the ITreeDataDescriptor and the method you ned to implement is public
 function getChildren(node:Object, model:Object=null):ICollectionView

 On Sun, Aug 3, 2008 at 9:50 AM, profiles_arun [EMAIL PROTECTED]
 wrote:

 Hi Jon,

 Thanks for you response, but basically i have the requirement to
 load the complete tree.
 Since am new, can you give me a snippet of code, which will load the
 sub-nodes of the tree on demand ?

 Thanks in advance.
 arun

 --- In flexcoders@yahoogroups.com, Jon Bradley [EMAIL PROTECTED] wrote:
 
 
  On Aug 2, 2008, at 7:25 AM, profiles_arun wrote:
 
   I have a tree, which has 21000 plus nodes, when i load the .swf
 file
   in IE, it crashes. As such i dont get any error messages, so i
   checked into widows application error log and found this error
  
   Faulting application iexplore.exe, version 7.0.6000.16674,
 faulting
   module fldbg9f.ocx, version 9.0.124.0, fault address 0x00241305.
 
  Your first problem is how much data you are loading into a tree. In
 my
  opinion, there is no reason to be doing that.
 
  Second problem, IE 7. It's the absolute worst browser on the
 planet
  with CPU and memory management. Try this in Firefox. Although you
  might crash, it will probably take longer to crash (unless there's
 a
  bug in the debug flash player).
 
   Below is the snippet of my impl. Please suggest a solution, to
   overcome this issue.
 
  Your solution to overcome the issue is as you already found -
 don't
  try to load that much information into a Tree.
 
  cheers,
 
  jon
 




 --
 j:pn
 \\no comment
 



-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


Re: [flexcoders] Is there no one who could help me with this?

2008-08-04 Thread Guilherme Blanco
Erm...


You can try to mail him... or make a phone call.
Even better... visit him/her.

Or...

Maybe you're not a lucky guy and the author doesn't like you.


=)

On Mon, Aug 4, 2008 at 2:22 PM, Tracy Spratt [EMAIL PROTECTED] wrote:
 Help with what?  Please use a descriptive subject.

 Tracy



 

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of gunnar.ulle
 Sent: Monday, August 04, 2008 3:57 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Is there no one who could help me with this?



 Unfortunately the author does not answer to requests...

 



-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


[flexcoders] Nested property display in ADG

2008-07-25 Thread Guilherme Blanco
Hi all,


I'm interested to display a column in ADG and the field is a nested property.

item
  id1/id
  foo1/foo
  Bar
id2/id
nametest/name
  /Bar
/item


What do I want? I want baz to be displayed... I tried this:

mx:AdvancedDataGridColumn headerText=Bar dataField=Bar.name/


But it only displays the first level items (foo in my example) on screen.
Any ideas how to solve it (I cannot change the XML structure - it's
automatically generated by ORM tool)?



Regards,

-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


Re: [flexcoders] Re: Nested property display in ADG

2008-07-25 Thread Guilherme Blanco
Hi,


Thanks for the quick answer.
I do not like the tree effect... I want a plain grid first (later I'll
use the tree but based on other things).

++--+
| foo| bar  |
++--+
| 1  | test |
++--+

That's what I want... I have around 10 xml nested items and the user
will be able to display all columns if he/she wants to.
So my idea is a nicer solution than labelFunction (which I'd have to
make a switch for all fields).
That's my real structure: http://pastie.org/241033 (each item is the
row I want to display on grid).

Is it better explained now? There must have a nicer solution for this
instead of labelFunction =)


Thanks in advance,

On Fri, Jul 25, 2008 at 11:55 AM, Amy [EMAIL PROTECTED] wrote:
 --- In flexcoders@yahoogroups.com, Guilherme Blanco

 [EMAIL PROTECTED] wrote:

 Hi all,


 I'm interested to display a column in ADG and the field is a nested
 property.

 item
 id1/id
 foo1/foo
 Bar
 id2/id
 nametest/name
 /Bar
 /item


 What do I want? I want baz to be displayed... I tried this:

 mx:AdvancedDataGridColumn headerText=Bar dataField=Bar.name/


 But it only displays the first level items (foo in my example) on
 screen.
 Any ideas how to solve it (I cannot change the XML structure - it's
 automatically generated by ORM tool)?

 Try this inside your ADG MXML:

 mx:dataProvider
 mx:HierarchicalData source={yourXML}
 childrenField=Bar/
 /mx:dataProvider

 Then you can use name in your dataField. Note that this will give
 you a hierarchical (tree-like) effect.

 If that's not what you wanted, you can probably use a labelFunction.

 HTH;

 Amy

 



-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


[flexcoders] Covering XML possibilities for automate object building

2008-07-24 Thread Guilherme Blanco
Hi all,

I have an automate script that converts a Form to params in both ways:
HTTP or Flex.
So, if you want to pick information from Form to be used in the Flex
application, you simply do var params:Object = form1.getParamObject();
Also, I optimized it to work ok in HTTPServices, do it becomes enabled
to automatically send POST params:
service.send(form1.getParamObject(true)); // the argument is
httpFormat? (default=false)

Maybe there's an easier way to do it without having to define the
mx:request params by hand, and I'm interested to listen your
solution regarding this.

By now, my application has two possible implementations in a ComboBox:

item id=1 label=foo/

or

item
  id1/id
  labelfoo/label
/item


There's no restriction to this yet.
So, my automate script needs to cover both situations. I tried this:

var selection:XML = formItem.selectedItem as XML;
params[formItem.id] = (httpFormat) ? XMLList(selection.id ||
[EMAIL PROTECTED]).toString() : selection;

Without success.

I'm interested to know how to achieve it in a simpler way.


Can you help me with this one?
Thanks in advance


Cheers,

-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


[flexcoders] Re: Covering XML possibilities for automate object building

2008-07-24 Thread Guilherme Blanco
I fixed myself.

That was easy... I just need another eye to not do stupid questions and things.

Solution:

var selection:XML = formItem.selectedItem as XML;
params[formItem.id] = (httpFormat)
? (selection.hasOwnProperty('id')
? XML(selection.id).toString()
: XMLList([EMAIL PROTECTED]).toString())
: selection;



Thanks anyway!


On Thu, Jul 24, 2008 at 11:20 AM, Guilherme Blanco
[EMAIL PROTECTED] wrote:
 Hi all,

 I have an automate script that converts a Form to params in both ways:
 HTTP or Flex.
 So, if you want to pick information from Form to be used in the Flex
 application, you simply do var params:Object = form1.getParamObject();
 Also, I optimized it to work ok in HTTPServices, do it becomes enabled
 to automatically send POST params:
 service.send(form1.getParamObject(true)); // the argument is
 httpFormat? (default=false)

 Maybe there's an easier way to do it without having to define the
 mx:request params by hand, and I'm interested to listen your
 solution regarding this.

 By now, my application has two possible implementations in a ComboBox:

 item id=1 label=foo/

 or

 item
  id1/id
  labelfoo/label
 /item


 There's no restriction to this yet.
 So, my automate script needs to cover both situations. I tried this:

 var selection:XML = formItem.selectedItem as XML;
 params[formItem.id] = (httpFormat) ? XMLList(selection.id ||
 [EMAIL PROTECTED]).toString() : selection;

 Without success.

 I'm interested to know how to achieve it in a simpler way.


 Can you help me with this one?
 Thanks in advance


 Cheers,

 --
 Guilherme Blanco - Web Developer
 CBC - Certified Bindows Consultant
 Cell Phone: +55 (16) 9166-6902
 MSN: [EMAIL PROTECTED]
 URL: http://blog.bisna.com
 Rio de Janeiro - RJ/Brazil




-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


Re: [flexcoders] Construct simple http request header

2008-07-23 Thread Guilherme Blanco
var params:Object = new Object();
params.name = foo;
params.value = bar;

service.send(params);



Cheers,

On Wed, Jul 23, 2008 at 5:04 PM, ron_mori [EMAIL PROTECTED] wrote:
 How to add headers to httpService request?

 Goal - add request header name:val of 'foo: bar'

 Tried: var hdr:Array = [{name:foo, value:bar}];
 Header has: [object object]

 Tried: var hdr:Array = [foo, bar];
 Header has: [0]:foo, [1]:bar

 ideas?

 thanks in advance.

 



-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


[flexcoders] Real Multicolumn Form in Flex

2008-07-22 Thread Guilherme Blanco
Hi all,


Does anyone have already implemented a multicolumn form in Flex?

Before you point me to Google (GIYF), I already tried all solutions
available, including the most known ones:
- 
http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetailsproductId=2postId=9644
- http://jc.pontaza.com/wp/?p=77
- My own

Let me first describe the each ones:

Adobe's: It plays really nice, until you need to define an item that
occupies more than a single row. There's no colSpan (as in HTML), but
there's rowSpan for column.

Potanza's: Weird, really weird solution. It only accepts column
organization if you use its FormGroup class. Inspecting source, you'll
see that FormGroup extends Form, and the entire idea behind a single
Form is down.
My automate script pick each FormItem (or any other class that I
define) and incorporate all children picking its value depending on
children class instance. Sounds big and yes, it is.
The issue is that this automation ignores other Forms. So if you
define a nested form inside the one you're calling, all fields
internally defined are ignored.

Mine: I used a simple HBox and made Box children inside. It did
everything I wanted, except label spacing. The form inputs does not
left align to the higher one, and becomes horrible.
I switched then to Grid, and the same issue happened again.


Now, I ask the same question again does anyone have already
implemented a *real* multicolumn form in Flex?
If possible could you share the source or swc file?


Thanks in advance,


Best regards,

-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


[flexcoders] Re: Real Multicolumn Form in Flex

2008-07-22 Thread Guilherme Blanco
Also, I forgot to mention that Adobe's solution does not respect the
width of each column. In my test, the first column width around 60%
and the second column 40%.

Regards,

On Tue, Jul 22, 2008 at 2:02 PM, Guilherme Blanco
[EMAIL PROTECTED] wrote:
 Hi all,


 Does anyone have already implemented a multicolumn form in Flex?

 Before you point me to Google (GIYF), I already tried all solutions
 available, including the most known ones:
 - 
 http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetailsproductId=2postId=9644
 - http://jc.pontaza.com/wp/?p=77
 - My own

 Let me first describe the each ones:

 Adobe's: It plays really nice, until you need to define an item that
 occupies more than a single row. There's no colSpan (as in HTML), but
 there's rowSpan for column.

 Potanza's: Weird, really weird solution. It only accepts column
 organization if you use its FormGroup class. Inspecting source, you'll
 see that FormGroup extends Form, and the entire idea behind a single
 Form is down.
 My automate script pick each FormItem (or any other class that I
 define) and incorporate all children picking its value depending on
 children class instance. Sounds big and yes, it is.
 The issue is that this automation ignores other Forms. So if you
 define a nested form inside the one you're calling, all fields
 internally defined are ignored.

 Mine: I used a simple HBox and made Box children inside. It did
 everything I wanted, except label spacing. The form inputs does not
 left align to the higher one, and becomes horrible.
 I switched then to Grid, and the same issue happened again.


 Now, I ask the same question again does anyone have already
 implemented a *real* multicolumn form in Flex?
 If possible could you share the source or swc file?


 Thanks in advance,


 Best regards,

 --
 Guilherme Blanco - Web Developer
 CBC - Certified Bindows Consultant
 Cell Phone: +55 (16) 9166-6902
 MSN: [EMAIL PROTECTED]
 URL: http://blog.bisna.com
 Rio de Janeiro - RJ/Brazil




-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


Re: [flexcoders] Error #1034: Type Coercion failed.... how to solve?

2008-07-17 Thread Guilherme Blanco
Thanks!!!

It did the job. =)
I refactored my application a little and incorporated your code into
it... now it works smoother.

Thanks for the help!


Cheers,

On Thu, Jul 17, 2008 at 2:50 AM, Alex Harui [EMAIL PROTECTED] wrote:
 The modules presentation describes appdoms and shared code problems.



 

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Guilherme Blanco
 Sent: Wednesday, July 16, 2008 7:40 AM
 To: flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] Error #1034: Type Coercion failed how to
 solve?



 Could you please point me to the right post?

 I've looked at this page (after researched Google for your blog), and
 could not find it... http://blogs.adobe.com/aharui/

 Thanks in advance,

 On Wed, Jul 16, 2008 at 11:33 AM, Alex Harui [EMAIL PROTECTED] wrote:
 Shared code problem. See my blog



 

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Guilherme Blanco
 Sent: Wednesday, July 16, 2008 7:19 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Error #1034: Type Coercion failed how to solve?



 Hi all,

 I'm in troubles here... researching the internet furiously while post it
 here.
 I have in my application that loads a module and instantiate it inside
 an instance of class core.controls.ModalDialog, class that I wrote
 extended from TitleWindow.

 The source is really simple... here is the implementation of module load
 event:

 protected function handleCreateCompanyModuleLoad(event:ModuleEvent):void
 {
 var dialog:ModalDialog =
 ModalDialog(PopUpManager.createPopUp(Application(Application.application),
 ModalDialog, true));

 // Dialog customization
 dialog.title = Create Company;
 dialog.width = 450;
 dialog.height = 270;
 dialog.showCloseButton = true;

 // Dialog content customization
 var ui:* = event.module.factory.create();
 dialog.addChild(ui);
 }

 One of the buttons inside the module closes the ModalDialog, which
 should be accessible through this.parent or this.owner. Since I know
 I'm always inside of it, I cast the property to prevent Flex from
 popping my errors...

 mx:Button label=Cancel click=close();/

 protected function close():void
 {
 //ModalDialog(parent).close();
 ModalDialog(owner).close();
 }

 Everytime I execute the code and click in the Cancel button... it
 throws this runtime error:

 TypeError: Error #1034: Type Coercion failed: cannot convert
 core.controls::[EMAIL PROTECTED] to core.controls.ModalDialog.

 Any ideas how do I solve this?

 PS: Inside the application module (it's 100% modular) I already
 imported the ModalDialog and inside the module too researching the
 internet I saw someone telling that missing this might be a problem
 (solved the requester' issue), but didn't have any effect for me...

 []s,

 --
 Guilherme Blanco - Web Developer
 CBC - Certified Bindows Consultant
 Cell Phone: +55 (16) 9166-6902
 MSN: [EMAIL PROTECTED]
 URL: http://blog.bisna.com
 Rio de Janeiro - RJ/Brazil



 --
 Guilherme Blanco - Web Developer
 CBC - Certified Bindows Consultant
 Cell Phone: +55 (16) 9166-6902
 MSN: [EMAIL PROTECTED]
 URL: http://blog.bisna.com
 Rio de Janeiro - RJ/Brazil

 



-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


[flexcoders] HTTPService receiving an array as parameter

2008-07-17 Thread Guilherme Blanco
Hi guys,


I'm interested if it's possible to send an array as a parameter when
doing an HTTP request.
Curretly, we can directly do it:

foo[]=1foo[]=2foo[]=3

Most server side languages understand this as

foo = Array(
  [0] = 1,
  [1] = 2,
  [2] = 3
)

I tried the same in Flex:

var params:Object = new Object();

params.foo = new Array();
params.foo.push(1);
params.foo.push(2);
params.foo.push(3);

service.send(params);

But it doesn't work... I'm curious how can this be achieved in Flex


Thanks in advance,


Regards,

-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


Re: [flexcoders] Re: HTTPService receiving an array as parameter

2008-07-17 Thread Guilherme Blanco
There's one thing you missed here

I have this:

var params:Object = new Object();
params.viewId = _viewId;

itemService.send(params);


And it works ok...


But If I try this:

var params:Object = new Object();

params.viewId = _viewId;

params.foo = new Array();
params.foo.push(1);
params.foo.push(2);
params.foo.push(3);

service.send(params);


It doesn't work.
Currently I do like this:

var params:Object = new Object();

params.viewId = _viewId;

params.foo_0 = 1;
params.foo_1 = 2;
params.foo_2 = 3;

service.send(params);


To be able to get it working... so... my question is if it's possible
to send an array through service.


[]s,


On Thu, Jul 17, 2008 at 3:36 PM, pbrendanc [EMAIL PROTECTED] wrote:
 Guilherme,
 I'm also testing this and have passed a parameter object as part of my
 HTTP request as follows:

 httpSvc.send(testVO);

 However I'm not seeing the parameter values in the HTTP request when I
 debug on the server side. However they do show up when I look at the
 request using the Web development helper tool (very useful tool/plugin
 to monitor request/responses - here's a link):

 http://projects.nikhilk.net/WebDevHelper/

 I'm not even sure if this is supposed to work (the docs here might be
 wrong/misleading as they show that a parameter arg for send method -
 however the Flex examples I've seen never populate the parameter object
 ). Like you I also want to pass an array via HTTP (my data is not bound
 to a form field so I don't want to use mxml).

 I may be missing something really obvious here - can't think what .
 Perhaps it depends on the server side implementation of the httpRequest
 Object but i thought that was pretty standard.

 If anyone can jump in here with sample working code that would really
 help.

 Patrick

 --- In flexcoders@yahoogroups.com, Guilherme Blanco

 [EMAIL PROTECTED] wrote:

 Hi guys,


 I'm interested if it's possible to send an array as a parameter when
 doing an HTTP request.
 Curretly, we can directly do it:

 foo[]=1foo[]=2foo[]=3

 Most server side languages understand this as

 foo = Array(
 [0] = 1,
 [1] = 2,
 [2] = 3
 )

 I tried the same in Flex:

 var params:Object = new Object();

 params.foo = new Array();
 params.foo.push(1);
 params.foo.push(2);
 params.foo.push(3);

 service.send(params);

 But it doesn't work... I'm curious how can this be achieved in Flex


 Thanks in advance,


 Regards,

 --
 Guilherme Blanco - Web Developer
 CBC - Certified Bindows Consultant
 Cell Phone: +55 (16) 9166-6902
 MSN: [EMAIL PROTECTED]
 URL: http://blog.bisna.com
 Rio de Janeiro - RJ/Brazil


 



-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


Re: [flexcoders] Problem with showing dynamic combobox

2008-07-17 Thread Guilherme Blanco
try the labelField as label
and put the please select as prompt.

Cheers,

On Thu, Jul 17, 2008 at 5:07 PM, timgerr [EMAIL PROTECTED] wrote:
 Hello all,
 I an running into a problem, when I create a Actionscript ComboBox
 like this:

 [Bindable]
 public var respArray: Array = [
 {label:},{label:Yes},{label:No},{label:N/A},{label:No
 Responce}];

 var cb1:ComboBox = new ComboBox();
 cb1.id = 'cb1me';
 cb1.dataProvider = respArray;
 addChild(cb1);

 All is displayed correctly

 But when I add the labelField like this
 var cb1:ComboBox = new ComboBox();
 cb1.id = 'cb1me';
 cb1.dataProvider = respArray;
 cb1.labelField = 'Please Select';
 addChild(cb1);

 When this is displayed the ComboBox displays:
 [Object Object]
 [Object Object]
 [Object Object]
 [Object Object]

 Why is the labelField messing up my array?

 Thanks,
 timgerr

 



-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


[flexcoders] Error #1034: Type Coercion failed.... how to solve?

2008-07-16 Thread Guilherme Blanco
Hi all,


I'm in troubles here... researching the internet furiously while post it here.
I have in my application that loads a module and instantiate it inside
an instance of class core.controls.ModalDialog, class that I wrote
extended from TitleWindow.

The source is really simple... here is the implementation of module load event:

protected function handleCreateCompanyModuleLoad(event:ModuleEvent):void
{
   var dialog:ModalDialog =
ModalDialog(PopUpManager.createPopUp(Application(Application.application),
ModalDialog, true));

   // Dialog customization
   dialog.title = Create Company;
   dialog.width = 450;
   dialog.height = 270;
   dialog.showCloseButton = true;

   // Dialog content customization
   var ui:* = event.module.factory.create();
   dialog.addChild(ui);
}


One of the buttons inside the module closes the ModalDialog, which
should be accessible through this.parent or this.owner. Since I know
I'm always inside of it, I cast the property to prevent Flex from
popping my errors...

mx:Button label=Cancel click=close();/


protected function close():void
{
   //ModalDialog(parent).close();
   ModalDialog(owner).close();
}


Everytime I execute the code and click in the Cancel button... it
throws this runtime error:

TypeError: Error #1034: Type Coercion failed: cannot convert
core.controls::[EMAIL PROTECTED] to core.controls.ModalDialog.


Any ideas how do I solve this?


PS: Inside the application module (it's 100% modular) I already
imported the ModalDialog and inside the module too researching the
internet I saw someone telling that missing this might be a problem
(solved the requester' issue), but didn't have any effect for me...


[]s,

-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil


Re: [flexcoders] Error #1034: Type Coercion failed.... how to solve?

2008-07-16 Thread Guilherme Blanco
Could you please point me to the right post?

I've looked at this page (after researched Google for your blog), and
could not find it... http://blogs.adobe.com/aharui/

Thanks in advance,

On Wed, Jul 16, 2008 at 11:33 AM, Alex Harui [EMAIL PROTECTED] wrote:
 Shared code problem.  See my blog



 

 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Guilherme Blanco
 Sent: Wednesday, July 16, 2008 7:19 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Error #1034: Type Coercion failed how to solve?



 Hi all,

 I'm in troubles here... researching the internet furiously while post it
 here.
 I have in my application that loads a module and instantiate it inside
 an instance of class core.controls.ModalDialog, class that I wrote
 extended from TitleWindow.

 The source is really simple... here is the implementation of module load
 event:

 protected function handleCreateCompanyModuleLoad(event:ModuleEvent):void
 {
 var dialog:ModalDialog =
 ModalDialog(PopUpManager.createPopUp(Application(Application.application),
 ModalDialog, true));

 // Dialog customization
 dialog.title = Create Company;
 dialog.width = 450;
 dialog.height = 270;
 dialog.showCloseButton = true;

 // Dialog content customization
 var ui:* = event.module.factory.create();
 dialog.addChild(ui);
 }

 One of the buttons inside the module closes the ModalDialog, which
 should be accessible through this.parent or this.owner. Since I know
 I'm always inside of it, I cast the property to prevent Flex from
 popping my errors...

 mx:Button label=Cancel click=close();/

 protected function close():void
 {
 //ModalDialog(parent).close();
 ModalDialog(owner).close();
 }

 Everytime I execute the code and click in the Cancel button... it
 throws this runtime error:

 TypeError: Error #1034: Type Coercion failed: cannot convert
 core.controls::[EMAIL PROTECTED] to core.controls.ModalDialog.

 Any ideas how do I solve this?

 PS: Inside the application module (it's 100% modular) I already
 imported the ModalDialog and inside the module too researching the
 internet I saw someone telling that missing this might be a problem
 (solved the requester' issue), but didn't have any effect for me...

 []s,

 --
 Guilherme Blanco - Web Developer
 CBC - Certified Bindows Consultant
 Cell Phone: +55 (16) 9166-6902
 MSN: [EMAIL PROTECTED]
 URL: http://blog.bisna.com
 Rio de Janeiro - RJ/Brazil

 



-- 
Guilherme Blanco - Web Developer
CBC - Certified Bindows Consultant
Cell Phone: +55 (16) 9166-6902
MSN: [EMAIL PROTECTED]
URL: http://blog.bisna.com
Rio de Janeiro - RJ/Brazil