[flexcoders] Identifying row index relative to node vs. ADG

2008-08-15 Thread Adrian Williams

Hi all,

   I have a challenge

   I am using an ADG in tree mode on a flat array.  Everything looks 
great.  One of the requirements is that whenever a user wants to 
rearrange the order of the rows under a node, I have to store that index 
value (display order). I.E. The 1st node of the ADG is collapsed.  The 
2nd node is expanded.  The 5th row in the 2nd node gets dragged and 
dropped to the 3rd row of the same node.  The 3rd row then becomes the 
4th and the 4th then becomes the 5th. The actual drag and drop functions 
work beautifully.  The problem comes into play when I try to identify 
the begin index and the end index for the row that was manipulated.


   When I use:

   var beginIndex:int = event.currentTarget.selectedIndex;

   it returns the index relative to the entire ADG and not relative to 
the grouping (node). In the example above, the beginning index value of 
the 5th row is actually indicated as index = 6 (the 7th row of the ADG 
which includes the two node rows).


   so, short of having to loop thru my array with the node group label 
and an identifier from the row data, is there another way to determine 
what row index relative to the node?


   Also, how do I identify the endIndex, where the row was dropped?  I 
haven't figured out how to even identify that one and am certain I will 
have the same problem once I do.


Many thanks in advance for your help!!

Adrian




[flexcoders] aspx Wrapper for Flex Build Possible?

2008-08-08 Thread Adrian Williams

Hi all,

   Just a quick question. I know the flex builder tool allows you to 
auto-generate an HTML wrapper on compile.  Has anyone found a way to 
have it create a wrapper in .aspx, possibly using some kind of master 
template?


Thanks,
Adrian


Re: [flexcoders] Alert Box with User Input Possible?

2008-08-01 Thread Adrian Williams

Dimitrios,

   Thank you!! That is exactly what I was looking for!!

Best,
Adrian

Dimitrios Gianninas wrote:


You cannot modify the standard Alert class...well you could, but that 
is not the solution here.
 
What you want to do is make your confirmation window with a couple of 
buttons and a textinput control... basically your component would be a 
TitleWindow at its base and then use the PopUpManager to load it when 
needed.
 
*Dimitrios Gianninas*

*RIA Developer and Team Lead*
*Optimal Payments Inc.*
 



*From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
*On Behalf Of *Adrian Williams

*Sent:* Friday, August 01, 2008 10:24 AM
*To:* flexcoders@yahoogroups.com
*Subject:* [flexcoders] Alert Box with User Input Possible?

Hi All,

Have a weird one here...I need to know if it's possible to have an 
input field on an alert box?  For example, when a user attempts to 
remove a person from the list, I have an alert box that confirms their 
intent to delete...but part of our process here is that the user must 
provide a reason for the delete.  I'd like to be able to have the 
reason for delete in the alert box and be able to capture that reason 
once they hit "ok". 

I've searched thru the web and the flexcoders archives and didn't 
find anything like this.


Thanks!
Adrian

*AVIS IMPORTANT*



*WARNING*

Ce message électronique et ses pièces jointes peuvent contenir des 
renseignements confidentiels, exclusifs ou légalement privilégiés 
destinés au seul usage du destinataire visé. L'expéditeur original ne 
renonce à aucun privilège ou à aucun autre droit si le présent message 
a été transmis involontairement ou s'il est retransmis sans son 
autorisation. Si vous n'êtes pas le destinataire visé du présent 
message ou si vous l'avez reçu par erreur, veuillez cesser 
immédiatement de le lire et le supprimer, ainsi que toutes ses pièces 
jointes, de votre système. La lecture, la distribution, la copie ou 
tout autre usage du présent message ou de ses pièces jointes par des 
personnes autres que le destinataire visé ne sont pas autorisés et 
pourraient être illégaux. Si vous avez reçu ce courrier électronique 
par erreur, veuillez en aviser l'expéditeur.




This electronic message and its attachments may contain confidential, 
proprietary or legally privileged information, which is solely for the 
use of the intended recipient. No privilege or other rights are waived 
by any unintended transmission or unauthorized retransmission of this 
message. If you are not the intended recipient of this message, or if 
you have received it in error, you should immediately stop reading 
this message and delete it and all attachments from your system. The 
reading, distribution, copying or other use of this message or its 
attachments by unintended recipients is unauthorized and may be 
unlawful. If you have received this e-mail in error, please notify the 
sender.


 


[flexcoders] Alert Box with User Input Possible?

2008-08-01 Thread Adrian Williams

Hi All,

   Have a weird one here...I need to know if it's possible to have an 
input field on an alert box?  For example, when a user attempts to 
remove a person from the list, I have an alert box that confirms their 
intent to delete...but part of our process here is that the user must 
provide a reason for the delete.  I'd like to be able to have the reason 
for delete in the alert box and be able to capture that reason once they 
hit "ok". 

   I've searched thru the web and the flexcoders archives and didn't 
find anything like this.


Thanks!
Adrian


[flexcoders] Custom Date Renderer for AS generated ADG

2008-07-23 Thread Adrian Williams

All,

   I am trying to apply a custom renderer to three ADG columns and am 
having a challenge with it. The details are a bit difficult to explain 
so bear with:


   1.) I have a membership listing that is in an ADG

   2.)  I am generating the ADG via AS as the columns are customizable 
to the users preference and on page load, their prior configuration is 
obtained to determine the last layout they set their listing to.  Three 
of the possible columns in the report are date fields and the user has 
the option to select a format they want dates displayed in (e.g. 
3/20/2008 or 20 Mar 2008).


   3.) Once the listing is complete, the user has the ability change 
the date format via a combobox. Here is the code for that one:


   [Bindable]
   public var dateFormatArray:ArrayCollection;
  
   private var dateFormatTypes:Array =

   [
   {label: "3/20/2008", data: "M/DD/"},
   {label: "03/20/2008", data: "MM/DD/"},
   {label: "3/20/08", data: "M/DD/YY"},
   {label: "03/20/08", data: "MM/DD/YY"},
   {label: "20 Mar 08", data: "DD MMM YY"},
   {label: "20 Mar 2008", data: "DD MMM "},
   {label: "20 March 08", data: "DD  YY"},
   {label: "20 March 2008", data: "DD  "},
   {label: "Mar 20, 2008", data: "MMM DD, "},
   {label: "March 20, 2008", data: " DD, "},
   {label: "20/3/2008", data: "DD/M/"},
   {label: "20/3/08", data: "DD/M/YY"},
   {label: "20.3.2008", data: "DD.M."},
   {label: "20.3.08", data: "DD.M.YY"},
   {label: "2008.03.20", data: ".MM.DD"},
   {label: "2008/03/20", data: "/MM/DD"},
   {label: "2008 Mar 20", data: " MMM DD"}
   ];   


   dateFormatArray = new ArrayCollection(dateFormatTypes);

   editable="false" enabled="true" top="20" right="488" 
dataProvider="{dateFormatArray}" 
change="comboChangeHandler(event)">


   4.)  When the user selects a different data format from the 
dropdown, the "comboChangeHandler(event)" is fired, which is currently 
setup to go thru the 3 columns, call the custom renderer and render the 
new format to the columns. This is the code for the function:


   private function comboChangeHandler(event:ListEvent) : void
   {
   var dateRenderer:LoginDateFormatRenderer = new 
LoginDateFormatRenderer();

   dateRenderer.Format = dateFormat.selectedItem.data;
  
   for (var i:int=0; i
   {
   var col:AdvancedDataGridColumn = 
AdvancedDataGridColumn(dateColumns[i]);


   col.itemRenderer = dateRenderer;   
   }

   //ArrayCollection(memberRpt.dataProvider).refresh();
   memberRpt.validateNow();
   }

And this is the code for the custom renderer for one of the columns:


http://www.adobe.com/2006/mxml"; 
implements="mx.core.IFactory">

   
   
   
   
  

  

   Ok, now that all the details are out of the way, here is the 
problem.  When the dropdown is changed, the event fires normally, the 
codes gets into the custom renderer and the new format is clearly passed 
in (watched in debug).  However, two things are occurring.  1st, the 
overridden set data function never gets hit.  2nd, the new format is not 
applied to the column. 

   Anyone have any ideas either what I am missing or if there is a 
better way to do this? I've scoured the web for answers and it seems 
that not many folks have done this.


Thanks!
Adrian


[flexcoders] Progress Bar For ADG Load

2008-07-23 Thread Adrian Williams

Hi All,

   I am trying to use the built-in ProgressBar component to display the 
progress of an AdvancedDataGrid load.  This grid holds a lot of data and 
can take a bit of time to load and as such, I don't want the user to sit 
there and think the program is "broken".  However, all of the examples I 
have seen tie the progressbar into either image/file uploads or the 
actual swf loadtime, which doesn't do me much good.  I have added the 
following code to my program:


   source="memberRpt" horizontalCenter="0"/>


   As you see, I have tied the source to the id of my ADG but it 
doesn't pick up the load time.  I am still learning my way thru Flex and 
AS and would appreciate any help anyone can give on a good method to do 
this.


Thanks!
Adrian


[flexcoders] PrintAdvancedDataGrid Infuriation!! - More Information

2008-07-22 Thread Adrian Williams

Some additional information:

Just for shiggles, I pulled the example data source and panel creation 
into my program using the same function and the print of the example ADG 
worked fine.  The only difference between their data and mine is that 
they are using an ArrayCollection while I am using XML.  I've even 
changed it to an XMLListCollection and the print still gives me a gray 
box. 


Here is my data creation:

   [Bindable]
   private var memberReportDataFeed:XMLListCollection;
   private function reportDataFeedResult(event:ResultEvent):void
   {
   memberRpt.dataProvider = event.result;
   }

Clearly the problem is not in the function but rather a conflict in data 
types or so it seems.  I have to use the XML as its data coming from our 
.net side via a web service. 


Any ideas here would be greatly appreciated.

Adrian



Folks,

  I have a strange one here.  I am attempting to use the 
PrintAdvancedDataGrid control to print my grid.  When I copy and run the 
entire example on adobe's website 
(http://livedocs.adobe.com/flex/3/html/help.html?content=printing_5.html) 
and run it locally...then print...it works fine.  But when I paste the 
function into my own code, tie it to my ADG and print, I get a gray 
box.  The only difference I can see between their example and my code is 
that they are using an array for their data source while I have an 
XMLList. 

   Anyone have ANY idea what the heck is going on here?  I found a 
posting on the web where someone else ran into this problem but there 
was no resolution.


Thanks,
Adrian



[flexcoders] PrintAdvancedDataGrid Infuriation!!

2008-07-22 Thread Adrian Williams

Folks,

  I have a strange one here.  I am attempting to use the 
PrintAdvancedDataGrid control to print my grid.  When I copy and run the 
entire example on adobe's website 
(http://livedocs.adobe.com/flex/3/html/help.html?content=printing_5.html) 
and run it locally...then print...it works fine.  But when I paste the 
function into my own code, tie it to my ADG and print, I get a gray 
box.  The only difference I can see between their example and my code is 
that they are using an array for their data source while I have an 
XMLList. 

   Anyone have ANY idea what the heck is going on here?  I found a 
posting on the web where someone else ran into this problem but there 
was no resolution.


Thanks,
Adrian


[flexcoders] Changing Header Text Color on ADG

2008-07-15 Thread Adrian Williams

Hi Folks,

   Have an infuriating one here. I am using color pickers to allow the 
user to change the colors on the headers of an ADG. The background 
picker works beautifully using:


   AdvancedDataGrid.headerColors="{[columnHeaderBackPckr.selectedColor, 
'#FF']}"


   However I am about shove a fork in my eye trying to get the header 
text color changer working.  It's set (how I haven't been able to 
discover) to an off-sea green color and no matter what I do to change 
the color of the text, it's not working.  I have tried:


   AdvancedDataGrid.color="{columnHeaderTextPckr.selectedColor}"

   and on the color picker itself:
  
   ColorPicker.change="setReportHeaderTextColor(event)"


   which uses a simple method of:

   private function 
setReportHeaderTextColor(evt:ColorPickerEvent):void

   {
   memberRptConfig.setStyle("color",evt.color);
   memberRpt.setStyle("color",evt.color);
   }

   Ironically, both the color= and the change= works perfectly on a 
standard dataGrid but the ADG is just ignoring it.  Any ideas??  I have 
googled about everything I can find without much success.



Thanks in advance for the help!!
Adrian
  


Re: [flexcoders] Re: Undefined Method Error

2008-07-08 Thread Adrian Williams

Hi All,

   Thanks for the info!  The outerDocument.methodName worked perfectly 
and the link that was provided was excellent.


   Quick question Amy, forgive my nubeness, what do you mean by "Why 
not make this a method on the VO that you're using for your data property?"


Thanks,
Adrian

Amy wrote:


--- In flexcoders@yahoogroups.com 
<mailto:flexcoders%40yahoogroups.com>, Adrian Williams <[EMAIL PROTECTED]>

wrote:
>
> Y'all,
>
> Here's a frustrating oneI have this function defined:
>
> public function convertEmailToMailto
(emailAddy:String):String
> {
> var mailtoEmailAddy:String ;
> mailtoEmailAddy = ''
> + emailAddy + '';
> return mailtoEmailAddy;
> }
>
> And am referencing it like this:
>
> 
> 
>  htmlText="{convertEmailToMailto(data.emailAddress)}"/>
> 
>
> And am getting the error "Call to a possibly undefined method
> convertEmailToMailto". It's probably something stupidly simple,
but I
> can't seem to see the forest for the trees. Help anyone?

Why not make this a method on the VO that you're using for your data
property?

HTH;

Amy

 


[flexcoders] Undefined Method Error

2008-07-08 Thread Adrian Williams

Y'all,

   Here's a frustrating oneI have this function defined:

   public function convertEmailToMailto(emailAddy:String):String
   {
   var mailtoEmailAddy:String ;
   mailtoEmailAddy = '' 
+ emailAddy + '';

   return mailtoEmailAddy;
   }

   And am referencing it like this:

   
   
   htmlText="{convertEmailToMailto(data.emailAddress)}"/>

   

   And am getting the error "Call to a possibly undefined method 
convertEmailToMailto".  It's probably something stupidly simple, but I 
can't seem to see the forest for the trees.  Help anyone?


Thanks,
Adrian


Re: [flexcoders] Creating a hyperlink mailto in advanced data grid

2008-07-07 Thread Adrian Williams

Tracy,

   Thanks for the help!!  I have some additional questions on this.  I 
am very new to flex/as and am stuck on a couple items.


   I found some examples on how to setup the renderer and have 
implemented this.  I created a function to create the actual mailto 
string and have hit these snags:


   Here is the code for the function:

   private function convertEmailToMailto(emailAddy:String):String
   {
   var mailtoEmailAddy:String ;
   mailtoEmailAddy = '' 
+ emailAddy + '';

   return mailtoEmailAddy;
   }

   And here is the renderer code:

   
   
   htmlText="{convertEmailToMailto(data.emailAddress)}"/>

   


   The first problem I have is that I am getting "call to possibly 
undefined method convertEmailToMailto" error and am not sure what the 
problem is. 

   The next is that I am confused about the bubbling.I am assuming 
I will need to add a 'click=""' in the  line and I see in the 
properties for TextEvent to do a TextEvent:LINK but I am not having a 
lot of luck seeing how to implement this.


   Help?

Thanks,
Adrian  


Tracy Spratt wrote:


There are several ways to do this.  One way is to create an 
itemRenderer using htmlText. htmlText can include an  
tag.  You can have the click dispatch a bubbling TextEvent, and in the 
handler, access the dataProvider item via the event.currentTarget 
property, and use the url to build your mailto url, and navigateToURL 
to laouch the browser.


 


There will be examples of all of this if you look a bit.

 


Tracy

 




*From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
*On Behalf Of *Adrian Williams

*Sent:* Monday, July 07, 2008 1:04 PM
*To:* flexcoders@yahoogroups.com
*Subject:* [flexcoders] Creating a hyperlink mailto in advanced data grid

 


Hi All,

I am using an advanced data grid to display a variety of data, one 
of which is a users email address.  I'd like to be able to set it up 
so that for any given row in the report, the email addresses are 
actually hyperlinks to open a mailto: that address.  How do I do this?


Thanks,
Adrian

 


[flexcoders] Creating a hyperlink mailto in advanced data grid

2008-07-07 Thread Adrian Williams

Hi All,

   I am using an advanced data grid to display a variety of data, one 
of which is a users email address.  I'd like to be able to set it up so 
that for any given row in the report, the email addresses are actually 
hyperlinks to open a mailto: that address.  How do I do this?


Thanks,
Adrian


[flexcoders] Manipulating child panels of a tabnavigator

2008-07-03 Thread Adrian Williams
Hi guys,

   Am having a doozy of a time figuring this out.  I am using the
flexlib SuperTabNavigator to create tabbed containers.  Then I am
creating individual SuperPanelPlus panels within the containers for
each tab. Basically creating a dashboard with the tabs acting as the
switch to change from on dashboard to another.  The panels are widgets
that while they can be duplicated between the tabs, the data contained
in the widget is unique to the tab.  

   Put another way, the dashboard is for a PM who has a project. If a
PM has multiple projects, they have multiple tabs.  Each tab contains
widgets that allow the PM to manipulate data specific to the project.

   The problem I am having is in controlling the properties, layout
and constraints of the panels.  The controls that are available to the
panel if I code it in the "body" of the page are not available if I
script them out in the mx:Script section.  They are valid attributes
for the container but are being unrecognized.  

   In case you aren't familiar with the flexlib, SuperTabNavigator
extends TabNavigator which extends ViewStack.  SuperPanelPlus extends
CollapsiblePanel (a custom conatiner) which extends TitleWindow.  

   Keep in mind that when I code it straight out in the body, it works
beautifully.  The challenge is in scripting it.

   Here is the code as it works in the "body":




   Because the tab creation is dynamic, I have to add the panels in
the script section. Here is the code that creates the tabbed navigator:

private function initTabs():void 
{
addTab("Project1", nav, "Project1 Administrator Dashboard", "Click to
swith to Project1", home_icon);
addTab("Project2", nav, "Project2 Administrator Dashboard", "Click to
swith to Project2");
addTab("Project3", nav, "Project3 Administrator Dashboard", "Click to
swith to Project3");
}

   Here is the code for the addTab() method. It is within this method
that I am trying to create the panels using the same arguments/options
as I have available in the "body" code.  

private function addTab(lbl:String, navigator:SuperTabNavigator,
contentString:String=null, toolTip:String=null, icon:Class=null):void 
{
if(lbl=="") lbl = "(Untitled)";

var curNum:Number = nav.numChildren + 1;

var child:VBox = new VBox();
child.setStyle("closable", false);
child.label = lbl;
child.toolTip = toolTip;

// determine which icon to place on the tab
if(icon) {
child.icon = icon;
}
else {
child.icon = document_icon;
}

//layout the quicklinks above the panels, but for each tab
var tabCanvas:Canvas = new Canvas();
child.addChild(tabCanvas);
tabCanvas.percentWidth = 100;
tabCanvas.height = 35;

var label:Label = new Label();
label.text = contentString + " - Index Number: " + curNum ;
tabCanvas.addChild(label);

// main container to hold the vboxes and panels
var mainBox:HBox = new HBox();
child.addChild(mainBox);
mainBox.percentWidth = 100;
mainBox.percentHeight = 100;

// configure column 1
var column1:VBox = new VBox();
mainBox.addChild(column1);
column1.percentWidth = 33;
column1.percentHeight = 100;
var panelCalendar:SuperPanelPlus = new SuperPanelPlus();
column1.addChild(panelCalendar);
panelCalendar.id = "calendar";
panelCalendar.title = "Calendar " + curNum;
panelCalendar.percentWidth = 98;
panelCalendar.percentHeight = 30;
panelCalendar.setStyle("fontfamily","Arial");
panelCalendar.setStyle("fontSize",14);
panelCalendar.setStyle("left",10);
panelCalendar.setStyle("color",0xB8E569);
panelCalendar.showControls = true;
panelCalendar.resizeHeightEnabled = true;

   Now the problems that I am encountering are:

   1.)  The setStyle commands are not working at all. 
   2.)  Some of the attributes that work cleanly in the "body" coding
are not available in the script.  For example dragEnter and
dragComplete.  These are just two of the many that are not available.
  Using Flex Builder, using the intellisense, when I type
"panelCalendar." these properties are not shown in the list of
possible actions.  

   I would GREATLY appreciate any help I can get with this...it's got
me stumped.

Thanks,
Adrian



<    1   2