[flexcoders] Styling Alert box default button

2009-01-11 Thread achegedus
I have a custom styled alert box with two buttons (ok and cancel), I'm
trying to make the default button look slightly different, but I can't
figure out how to do this.  Does anyone know?  The default style can
achieve this.



[flexcoders] Reclaiming memory from removed viewstack children

2008-11-03 Thread achegedus
I have a fairly simple app that I made as a test, confirming what I've
read elsewhere.  It seems that when a layer is removed from a
viewstack using removeChild or removeAllChildren the memory is not
garbage collected. 

In this example i have a simple viewstack that adds a few layers of a
component with a chart on it (using anychart).  When I create the
layers, it's fine, but when I delete them, the memory stays up and the
instances of the chart don't decrease... do this enough times, and
it'll crash your browser.

Does anyone know how I can really delete a child layer?

Here's some code:
http://pastebin.com/faf14977

Thanks!
Adam




[flexcoders] get an object with a name

2008-10-14 Thread achegedus
I have some custom validation and now I have a problem.. I'm creating
validations dynamically as part of the actionscript that I use to
create the numberValidator I have this line:

thisValid.addEventListener(ValidationResultEvent.INVALID,
handleInvalidEvent);


In the handleInvalidEvent method i need to get the object that is
being validated.  in this case it's a textbox.  There is a field
property for the ValidationResultEvent event, but now I need to get
the actual object.  is there a way to get the object from the name?

Thanks,
Adam



[flexcoders] linkbar removeAllChildren error in safari.... ???

2008-10-07 Thread achegedus
I have a strange error... I have a linkbar that is being dynamically populated. 
 I need to be 
able to refresh the link bar.  So I have this code:

http://pastebin.com/m78e78eb0

When I click the clear button which calls removeAllChildren() for the linkbar, 
I get this 
error:

TypeError: Error #2007: Parameter child must be non-null.
at flash.display::DisplayObjectContainer/getChildIndex()
at 
mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::rawChildren_getChildI
ndex()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\core\Container.as:3879]
at 
mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::rawChildren_removeC
hild()[E:\dev\3.1.0\frameworks\projects\framework\src\mx\core\Container.as:3813]
at 
mx.core::ContainerRawChildrenList/removeChild()[E:\dev\3.1.0\frameworks\projects\fra
mework\src\mx\core\ContainerRawChildrenList.as:157]
at 
mx.controls::LinkBar/childRemoveHandler()[E:\dev\3.1.0\frameworks\projects\framework
\src\mx\controls\LinkBar.as:560]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()

etc, etc...

What's really weird is that I only get this error when using safari.  If I look 
at the same 
code using firefox, I get no error. 

Does anyone have any clue what I'm doing wrong?  I really need to be able to do 
this, and I 
can't seem to find a solution.

Thanks!!

Adam



[flexcoders] Re: tree event using cairngorm

2007-05-21 Thread achegedus
Thanks Tom! 
I was able to pass the tree into the events and it worked as I had hoped.  I 
ran into another 
problem, and I thought I'd ask you about it.

In my original tree code, i have a method that calls the webservice and looks 
like this:

var token:Object = facility.folderService.send(parameters);
token.expandIDs = expandIDs;
token.parent = list[0];
token.eventType = (expandIDs.length  1) ? init : change;

where I'm setting some items asyncronously ( i think! )

Now if I have in my command the webservice call:

var parameters:Object = {folderID:[EMAIL PROTECTED];
var event:GetTreeXMLEvent = new GetTreeXMLEvent(model.user.token, _Tree);

I don't know how to pass items like parent, etc.  Any suggestions?  I really 
appreciate the 
help.

Thanks,
A



--- In flexcoders@yahoogroups.com, Tom Chiverton [EMAIL PROTECTED] wrote:

 On Thursday 17 May 2007, achegedus wrote:
  How do I call a method for a flex tree from a cairngorm command?
 
 We pass the tree into the Event, and save a copy of this in the Command 
 before 
 calling the Delegate.
 When it returns, you've got the tree to hand then.
 
 -- 
 Tom Chiverton
 Helping to simultaneously optimize network m-commerce
 on: http://thefalken.livejournal.com
 
 
 
 This email is sent for and on behalf of Halliwells LLP.
 
 Halliwells LLP is a limited liability partnership registered in England and 
 Wales under 
registered number OC307980 whose registered office address is at St James's 
Court Brown 
Street Manchester M2 2JF.  A list of members is available for inspection at the 
registered 
office. Any reference to a partner in relation to Halliwells LLP means a member 
of 
Halliwells LLP. Regulated by the Law Society.
 
 CONFIDENTIALITY
 
 This email is intended only for the use of the addressee named above and may 
 be 
confidential or legally privileged.  If you are not the addressee you must not 
read it and 
must not use any information contained in nor copy it nor inform any person 
other than 
Halliwells LLP or the addressee of its existence or contents.  If you have 
received this email 
in error please delete it and notify Halliwells LLP IT Department on 0870 365 
8008.
 
 For more information about Halliwells LLP visit www.halliwells.com.





[flexcoders] tree event using cairngorm

2007-05-17 Thread achegedus
Hi Everyone!

I'm trying to write a dynamic tree using cairngorm, and I ran into a problem.  
I want to be 
able to expand a node, have it go to my webservice, return the xml and open the 
node.  In 
the command that is handling the response to the webservice, i need to call the 
expandItem 
method of the tree.  And there's the trouble...

How do I call a method for a flex tree from a cairngorm command?

Any suggestions??

Thanks,
Adam



[flexcoders] Cairngorm Dynamic Tree

2007-05-09 Thread achegedus
I currently have a tree that will hit a webservice when you click to expand a 
node.  It works 
great!  My problem is that I'm trying to implement this in an app using the 
Cairngorm 
framework and I'm hitting a road block... I want to write a method that will 
search the tree 
for a node.  Keeping in mind that the tree is not all there since I build it 
dynamically, my 
webservice for the search returns the nodes that have to be expanded to find 
the item.  So 
i need to call the method to expand the tree from within the framework and I 
don't know 
how to do this.  Here's some code:

here's the code from the view with the tree:

mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; width=100% 
height=100% xmlns:component=com.testapp.web.component.* 
creationComplete=initApp(); xmlns:facility=com.testapp.web.view.facility.*
mx:Script
![CDATA[
import 
com.adobe.cairngorm.control.CairngormEventDispatcher;
import com.testapp.web.model.AppModelLocator;
import mx.events.TreeEvent;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.controls.Alert;

import 
com.testapp.web.component.FacilityTreeDataDescriptor;

[Bindable]
public var model:AppModelLocator = 
AppModelLocator.getInstance();


/**
 * Handles the creationComplete event for the 
application.
 *
 * Expects a comma-separated list of folder IDs 
representing the
 * initial expansion path for the explorer.
 **/
private function initApp():void {
var token:Object = 
facility.getTreeXML.send(model.user.token, 
model.user.rootnode, model.user.display);
}


/**
 * Handles the itemOpening event (clicking the expand 
arrow next to a
 * directory) for the explorer tree.
 *
 * Initiates retrieval of a list of subdirectories from 
the server and
 * cancels immediate opening if user is selecting this 
directory for
 * the first time.  The explorer then opens the 
directory after
 * receiving the server response and adding the 
subdirectories to the
 * tree.
 **/
private function loadChildFolders(e:TreeEvent):void {
var node:XML = e.item as XML;

if (! loadChildFolderNode(node, e.type)) {
  e.stopPropagation();
  e.preventDefault()
}
}


/** 
 * Checks if a tree node is loaded and initiates 
retrieval if not.
 **/
private function loadChildFolderNode(node:XML, 
eventType:String):Boolean 
{
  if ([EMAIL PROTECTED]  node.children().length() == 
0) {
var parameters:Object = {folderID:[EMAIL PROTECTED];
var token:Object = 
facility.getTreeXML.send(model.user.token, 
[EMAIL PROTECTED], model.user.display);
token.parent = node;
token.eventType = eventType;
return false;
  } else {
return true;
  }
}


/**
 * Handles the result event for folderService by 
inserting
 * subdirectories into the tree under the parent node 
and then
 * expanding the tree to display the newly inserted 
nodes.
 *
 * Initiates retrieval of the next level in the 
starting expansion
 * path if appropriate.
 **/
private function addFolders(e:ResultEvent):void 
{
var node:XML = XML(e.result..result);
var parent:XML = e.token.parent;

if (! parent) {
// insert root node here to work around 
apparent problem 

[flexcoders] Custom Data Descriptor

2007-04-24 Thread achegedus
I'm trying to use a specific XML fill to fill a tree and I'm assuming
I need to use a custom data descriptor, but i can't figure out how to
do that.  Does anyone know of any samples?  or could point me in the
right direction?

the xml looks like this:

result success=True expired=False
Places
row
placeid1637/placeid
placetypeid2/placetypeid
contactid[NULL]/contactid
addressid3137/addressid
placecode30157/placecode
placeinfoTest/placeinfo
stationid[NULL]/stationid
builddate1899-12-30 00:00:00.00/builddate
active1/active
parentid1025/parentid
createdby1/createdby
createddate2007-03-06 12:49:22.22/createddate
modifiedby1/modifiedby
modifieddate2007-03-06 12:49:22.22/modifieddate
apid1637/apid
subplace0/subplace
bpid[NULL]/bpid
needplus[NULL]/needplus
placetypeid2/placetypeid
/row
row
placeid1638/placeid
placetypeid2/placetypeid
contactid[NULL]/contactid
addressid3138/addressid
placecode30158/placecode
placeinfoTest2/placeinfo
stationid[NULL]/stationid
builddate1899-12-30 00:00:00.00/builddate
active1/active
parentid1025/parentid
createdby1/createdby
createddate2007-03-06 12:49:22.22/createddate
modifiedby1/modifiedby
modifieddate2007-03-06 12:49:22.22/modifieddate
apid1637/apid
subplace0/subplace
bpid[NULL]/bpid
needplus[NULL]/needplus
placetypeid2/placetypeid
/row
/Places
/result

I'm really only interested in the placeid and placeinfo and then
subplace determines if it has children.

Any help would be greatly appreciated!

Thanks,
A




[flexcoders] Cairngorm app with HTTPService

2007-03-10 Thread achegedus
I'm having a hard time learning Cairngorm, but I'm determined to
figure it out!!  My current problem is with my HTTPService.  In my
Delegate, I'm calling the service like this:

public class ContactListDelegate
{
  private var responder : IResponder;
  private var service : Object;
 
  public function ContactListDelegate(responder:IResponder)
  {
this.service =
ServiceLocator.getInstance().getHTTPService(ListContactsHS) as
HTTPService;
this.responder = responder
  }

  public function list():void
  {
var token : AsyncToken = service.list();
token.resultHandler = responder.result;
token.faultHandler = responder.fault;
  }

  public function listResult():void 
  {
responder.result(responder);
  }
}

and then in my services.mxml i have this:

mx:HTTPService id=ListContactsHS
url=http://localhost:3004/webservice/list; 
useProxy=false 
method=GET 
makeObjectsBindable=false 
result=event.token.resultHandler(event) 
fault=event.token.resultHandler(event) /

(the service is written in Rails and on the local machine)

When I call the event to get the data from service though, I get this
error:

Error: C0008E: HTTPService not found for ListContactsHS
at com.adobe.cairngorm.business::HTTPServices/getService()
at com.adobe.cairngorm.business::ServiceLocator/getHTTPService()
at com.adamhegedus.contactmanager.business::ContactListDelegate$iinit()
at
com.adamhegedus.contactmanager.command::GetContactListCommand/execute()
at
com.adobe.cairngorm.control::FrontController/com.adobe.cairngorm.control:FrontController::executeCommand()
at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.adobe.cairngorm.control::CairngormEventDispatcher/dispatchEvent()
at 
com.adamhegedus.contactmanager.view.screens::ContactManager/initFunc()
at
com.adamhegedus.contactmanager.view.screens::ContactManager/___VBox1_creationComplete()
at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()
at mx.core::UIComponent/set initialized()
at mx.managers::LayoutManager/::doPhasedInstantiation()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/::callLaterDispatcher2()
at mx.core::UIComponent/::callLaterDispatcher()

I looked through a bunch of samples, but I can't get passed this
one... Anyone have any suggestions?

Thanks,
Adam




[flexcoders] Cairngorm web service not getting results

2007-01-23 Thread achegedus
I have a small login app that is calling a web service to determine if
the login is valid.  The web service currently only returns a string.

Here is the code:

in Services.mxml
mx:WebService id=Service
wsdl=http://localhost/GSSData/service.asmx?WSDL;
showBusyCursor=true
useProxy=false
makeObjectsBindable=false
/mx:WebService

in LoginDelegate.as:

public function login (loginVO:LoginVO):void{
service.loadWSDL();

DebugWindow.debug(service.wsdl:  + service.wsdl.toString());
var token:AsyncToken = service.login(loginVO.username,
loginVO.password);
DebugWindow.debug(After login: + 
token.result.toString());
token.addResponder(responder);
}


My problem is that I am seeing the web service get called and the
response is returned, but it doesn't seem like my app is taking the
response.  When I try to view the response in my debug window i get an
error:  

TypeError: Error #1009: Cannot access a property or method of a null
object reference.

as though the web service isn't returning a value.  I'm totally at a
loss here, I'm trying to learn Cairngorm, but i'm really struggling. 
I basically am trying to rework this sample app: 

http://www.alex-uhlmann.de/flash/adobe/blog/cairngormlogin/CairngormLogin.html

to use a web service and I having little to no success.  can anyone
see what I'm doing wrong?

Thanks,
A