[flexcoders] Can ComboBox display an Image as its LabelField
Hi, I am trying to create a combo box that displays only images. I can get images being displayed in the drop down list. But when I select one of the images the selected label of the combo box is always text. labelField and labelFunction only display Strings. Is there anyway to display the image that they selected from the drop down list in the combo boxes label?
[flexcoders] Change TileList ItemRenderer Programatically
Hi everybody, My current problem involves the need to change how items in my tilelist are being rendered. When a button is clicked I want to switch from one item view to the other. Doesn't seem to hard, my button handler somehow has to reassign the itemRenderer property. Nothing I try succeeds though. Everything I have tried results in an implicit coercion error. I'v tried many different assignments including the obvious: list.itemRenderer = components.ProjectTile; But it spits out this: Implicit coercion of a value of type Class to an unrelated type mx.core:IFactory. Anyone done this before? Or know how I can programmatically change the itemRenderer of a Tile List? Thanks in advance, Adam
[flexcoders] Re: Custom Context Menu in flex app
I think the problem here is that you are using the same name for your menu item as one of the built in menu items. These include forwardAndBack, loop, play, print, quality, rewind, save and zoom. Set the label of your menu item to anything but these and it should work. -Adam --- In flexcoders@yahoogroups.com, vipinck [EMAIL PROTECTED] wrote: I am trying to add a custom context menu in my flex app. I am writing below code in a method which i am calling on applicationComplete event of the main application. // customMenu = new ContextMenu(); var saveItem:ContextMenuItem = new ContextMenuItem(Save,true,true,true); saveItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, doSaveCommand); customMenu.hideBuiltInItems(); customMenu.customItems.push(saveItem); Application.application.contextMenu = customMenu; // I am able to hide the default menu items when using the customMenu.hideBuiltInItems(); code, but the custom 'Save' item is not getting added. What could be wrong? Thnx Vipin
[flexcoders] Re: Custom Context Menu in flex app
I think the problem here is that you are using the same name for your menu item as one of the built in menu items. These include forwardAndBack, loop, play, print, quality, rewind, save and zoom. Set the label of your menu item to anything but these and it should work. -Adam --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: Looks ok to me. Make sure you're right clicking on the app and not something that has its own context menu From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of vipinck Sent: Tuesday, July 29, 2008 3:14 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Custom Context Menu in flex app I am trying to add a custom context menu in my flex app. I am writing below code in a method which i am calling on applicationComplete event of the main application. // customMenu = new ContextMenu(); var saveItem:ContextMenuItem = new ContextMenuItem(Save,true,true,true); saveItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, doSaveCommand); customMenu.hideBuiltInItems(); customMenu.customItems.push(saveItem); Application.application.contextMenu = customMenu; // I am able to hide the default menu items when using the customMenu.hideBuiltInItems(); code, but the custom 'Save' item is not getting added. What could be wrong? Thnx Vipin
[flexcoders] Re: Custom Context Menu in flex app
I think the problem here is that you are using the same name for your menu item as one of the built in menu items. These include forwardAndBack, loop, play, print, quality, rewind, save and zoom. Set the label of your menu items to anything but these and it should work. -Adam --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: Looks ok to me. Make sure you're right clicking on the app and not something that has its own context menu From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of vipinck Sent: Tuesday, July 29, 2008 3:14 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Custom Context Menu in flex app I am trying to add a custom context menu in my flex app. I am writing below code in a method which i am calling on applicationComplete event of the main application. // customMenu = new ContextMenu(); var saveItem:ContextMenuItem = new ContextMenuItem(Save,true,true,true); saveItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, doSaveCommand); customMenu.hideBuiltInItems(); customMenu.customItems.push(saveItem); Application.application.contextMenu = customMenu; // I am able to hide the default menu items when using the customMenu.hideBuiltInItems(); code, but the custom 'Save' item is not getting added. What could be wrong? Thnx Vipin
[flexcoders] Stop execution till Popup is closed
Hi, I am trying to create a button that when clicked shows a popup, the user then enters information into this popup and clicks create. My main application then takes this information creates an object and uses it as a data provider to show a node on a graph. The problem I am having is that when I show the popup code is still executed in the parent, which is not what I would like. I would only like to create and show the object if the user clicked create in the popup and not do anything if he clicks cancel. This is the function called when the user selects new: private function newItem(): void { var item: Item = new Item(); var newProj:newProject = newProject(PopUpManager.createPopUp(this,newProject,true)); PopUpManager.centerPopUp(newProj); //This is where i would like to pause till the user clicks a button in the popup item.data = newProj.project; g.add(item); s.dataProvider = g; } Is there anyway to do this? Should I be using somethin different in my event handlers in my popup then just closing the popup? Any help would be appreciated! -Adam
[flexcoders] Re: Newbie Nested Remote Object Question
Perhaps I should provide a little more detail on my problem, here are three stripped down java classes I am using, public class Project { private String name; private Summary summary; public Project(){ } ...usual get/set methods } public class Summary { private String clientName; private int budget; public Summary(){ } ...usual get/set methods } public ProjectList { private ArrayListProject projects; public ProjectList(){ } public Project[] getProjects() { buildProjects(); return projects.toArray(new Project[0]); } public void buildProjects() { Project project; Summary summary; projects = new ArrayListProject(); for(int i = 0; i10;i++) { project = new Project(); project.setName(Name+i); summary = new Summary(); summary.setBudget(1); summary.setClientName(Client+i); project.setSummary(summary); projects.add(projects); } } Within my flex code I use a remote object to the ProjectList and bind an ArrayCollection to the return value of getProjects(). I then pass the Project elements of this array to a component to display its values. This is where my problem comes in. I can display the name of the project fine in the component by just using {project.name} but I have no idea how to access my Summary object to get its data. I thought I could just do {project.summary.budget} but that doesn't display anything. I really hope someone can help me solve this problem as I'v been stuck on it for some time now. Thanks again, -Adam --Flex Newbie --- In flexcoders@yahoogroups.com, kroghadam [EMAIL PROTECTED] wrote: Hi everybody, I am really enjoying my first look into flex! Unfortunately I have ran into a problem with remote objects to java classes that have compositions of objects in them. In other words my class has an instance variable that is another object whose data i also want to access, preferably through the same remote object. If anyone has some pointers, links to examples or even source code I would really appreciate it. Thanks in advance, -Adam --Flex Newbie
[flexcoders] Re: Newbie Nested Remote Object Question
Sorry I am really new to flex, I'm not sure what you mean by value objects. The three classes I gave are Java Classes that are essentially a facade to further backend persistence code. I remote directly to the ProjectList.java class and return an array of Projects. I cannot do what you suggested in actionscript as I only have the java objects that i am remoting to, and cannot reference those. I am beginning to think I am doing something seriously wrong as I only have one remote object, and am trying to access java objects contained in it. Do I need to have some kind of mapping of action script objects as well? Any articles and tutorials about accessing java objects would be a great help to. Thanks for your patience, Adam --- In flexcoders@yahoogroups.com, valdhor [EMAIL PROTECTED] wrote: Caveat: I use PHP with WebORB but I have done a lot of C++ in the past. So, to get this straight, you have a value object with a property that contains another value object, right? Try... (project.summary as Summary).budget or Summary(project.summary).budget --- In flexcoders@yahoogroups.com, kroghadam akrogh@ wrote: Perhaps I should provide a little more detail on my problem, here are three stripped down java classes I am using, public class Project { private String name; private Summary summary; public Project(){ } ...usual get/set methods } public class Summary { private String clientName; private int budget; public Summary(){ } ...usual get/set methods } public ProjectList { private ArrayListProject projects; public ProjectList(){ } public Project[] getProjects() { buildProjects(); return projects.toArray(new Project[0]); } public void buildProjects() { Project project; Summary summary; projects = new ArrayListProject(); for(int i = 0; i10;i++) { project = new Project(); project.setName(Name+i); summary = new Summary(); summary.setBudget(1); summary.setClientName(Client+i); project.setSummary(summary); projects.add(projects); } } Within my flex code I use a remote object to the ProjectList and bind an ArrayCollection to the return value of getProjects(). I then pass the Project elements of this array to a component to display its values. This is where my problem comes in. I can display the name of the project fine in the component by just using {project.name} but I have no idea how to access my Summary object to get its data. I thought I could just do {project.summary.budget} but that doesn't display anything. I really hope someone can help me solve this problem as I'v been stuck on it for some time now. Thanks again, -Adam --Flex Newbie --- In flexcoders@yahoogroups.com, kroghadam kroghadam@ wrote: Hi everybody, I am really enjoying my first look into flex! Unfortunately I have ran into a problem with remote objects to java classes that have compositions of objects in them. In other words my class has an instance variable that is another object whose data i also want to access, preferably through the same remote object. If anyone has some pointers, links to examples or even source code I would really appreciate it. Thanks in advance, -Adam --Flex Newbie
[flexcoders] Re: Newbie Nested Remote Object Question
Yay, I got something working. I added in a couple actionscript classes that map to my java classes...somehow. One is as follows: package { [RemoteClass(alias=test.summary)] [Bindable] public class Summary { public var clientName:String = ; public var budget:int; public function Summary() { } } } This works, now I can cast the properties that I get in the way you said. Is this the only way of doing it? And if it is, is there a code generation tool that will create these .as files automatically? -Adam --- In flexcoders@yahoogroups.com, kroghadam [EMAIL PROTECTED] wrote: Sorry I am really new to flex, I'm not sure what you mean by value objects. The three classes I gave are Java Classes that are essentially a facade to further backend persistence code. I remote directly to the ProjectList.java class and return an array of Projects. I cannot do what you suggested in actionscript as I only have the java objects that i am remoting to, and cannot reference those. I am beginning to think I am doing something seriously wrong as I only have one remote object, and am trying to access java objects contained in it. Do I need to have some kind of mapping of action script objects as well? Any articles and tutorials about accessing java objects would be a great help to. Thanks for your patience, Adam --- In flexcoders@yahoogroups.com, valdhor stevedepp@ wrote: Caveat: I use PHP with WebORB but I have done a lot of C++ in the past. So, to get this straight, you have a value object with a property that contains another value object, right? Try... (project.summary as Summary).budget or Summary(project.summary).budget --- In flexcoders@yahoogroups.com, kroghadam akrogh@ wrote: Perhaps I should provide a little more detail on my problem, here are three stripped down java classes I am using, public class Project { private String name; private Summary summary; public Project(){ } ...usual get/set methods } public class Summary { private String clientName; private int budget; public Summary(){ } ...usual get/set methods } public ProjectList { private ArrayListProject projects; public ProjectList(){ } public Project[] getProjects() { buildProjects(); return projects.toArray(new Project[0]); } public void buildProjects() { Project project; Summary summary; projects = new ArrayListProject(); for(int i = 0; i10;i++) { project = new Project(); project.setName(Name+i); summary = new Summary(); summary.setBudget(1); summary.setClientName(Client+i); project.setSummary(summary); projects.add(projects); } } Within my flex code I use a remote object to the ProjectList and bind an ArrayCollection to the return value of getProjects(). I then pass the Project elements of this array to a component to display its values. This is where my problem comes in. I can display the name of the project fine in the component by just using {project.name} but I have no idea how to access my Summary object to get its data. I thought I could just do {project.summary.budget} but that doesn't display anything. I really hope someone can help me solve this problem as I'v been stuck on it for some time now. Thanks again, -Adam --Flex Newbie --- In flexcoders@yahoogroups.com, kroghadam kroghadam@ wrote: Hi everybody, I am really enjoying my first look into flex! Unfortunately I have ran into a problem with remote objects to java classes that have compositions of objects in them. In other words my class has an instance variable that is another object whose data i also want to access, preferably through the same remote object. If anyone has some pointers, links to examples or even source code I would really appreciate it. Thanks in advance, -Adam --Flex Newbie
[flexcoders] Newbie Nested Remote Object Question
Hi everybody, I am really enjoying my first look into flex! Unfortunately I have ran into a problem with remote objects to java classes that have compositions of objects in them. In other words my class has an instance variable that is another object whose data i also want to access, preferably through the same remote object. If anyone has some pointers, links to examples or even source code I would really appreciate it. Thanks in advance, -Adam --Flex Newbie