Custom Components and Properties in Flex Builder Design View
How do I create a custom component with custom properties
that renders well in Flex Builder design view?
This is a simple HelloWorld example of what I am trying
below. Here is the HelloWorld.mxml file:
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="
http://www.adobe.com/2006/mxml"
width="500" height="500">
<mx:Script><![CDATA[
[Bindable]
public var message:String;
]]></mx:Script>
<mx:Label x="100" y="100" text="{message}" />
</mx:Canvas>
And then when I use it in another mxml file, the design view
does not show the label with the 'Hello World' value - instead it
just shows {message} in design view where the label is located.
When I run it as a compiled app in flash, the 'Hello World' is
displayed correctly:
-- HelloWorldTest.mxml --
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="
http://www.adobe.com/2006/mxml"
xmlns:views="mypackage.*" width="500" height="500">
<views:SimpleLine message="Hello World."/>
</mx:Canvas>
design view does not do any variable assignments or function
evaluations, so you won't be able to see it even if you don't use a
custom component.
Similar Messages
-
Flex Builder Design View programmatic skinning
I am writing programmatic skins, by extending
ProgrammaticSkin class. If i apply these skins to mx:Button, i can
see the skin in Flex Builder design view. But when i style my
custom component with programmatic skins, Flex Builder design view
does not show the skin, though the skin is applied when i run the
application. Is there a way for me to write my custom classes
(class Node extends UIComponent), and apply skins, so that i can
see the skins in Flex Builder design view.Actually I found the answer to my question. You can find it
in my blog.
programmatic
skinning in Flex Builder Design view -
I have a component like the following and it completely crashes the design view in flex builder
I have a component like the following and it completely crashes the design view in flex builder.I can see anything in the layout. Everything compliles fine and looks normal in the outline view. Any ideas whats wrong. If I remove the AdvancedDataGridColumnGroup's all looks fine
<?xml version="1.0" encoding="utf-8"?>
<mx:Panel x="353" y="34" width="1159" height="505.7" maxWidth="663" allowDrag="true" allowResize="true" allowClose="true" allowMaximize="true" allowMinimize="true" resizeEffect="Resize" moveEffect="Move" close="parent.removeChild(this)" maxHeight="680" layout="absolute" title="Back office list" xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:AdvancedDataGrid id="deals" displayItemsExpanded="true" dataProvider="{tradesResult}" width="100%" height="373" sortExpertMode="true" variableRowHeight="true" headerStyleName="smallHeader" editable="false" fontWeight="normal">
<mx:columns>
<mx:AdvancedDataGridColumn width="75">
</mx:AdvancedDataGridColumn>
<mx:AdvancedDataGridColumnGroup headerText="Client side">
<mx:AdvancedDataGridColumn dataField="Reference" headerText="Mon Ref" width="60" editable="true" wordWrap="true" showDataTips="true" textAlign="center"/>
<mx:AdvancedDataGridColumn dataField="clientside" headerText="MC Pr" textAlign="center" wordWrap="true" width="70">
</mx:AdvancedDataGridColumn>
</mx:AdvancedDataGridColumnGroup>
<mx:AdvancedDataGridColumnGroup headerText="Bank side">
<mx:AdvancedDataGridColumn dataField="bankDealRef" headerText="Bank Ref" width="70" editable="true" wordWrap="true" dataTipFunction="dataTipFuncNotes" showDataTips="true" textAlign="center"/>
<mx:AdvancedDataGridColumn dataField="Premium2" headerText="Bank Pr" width="55" editable="true" wordWrap="true" showDataTips="true" textAlign="center"/>
</mx:AdvancedDataGridColumnGroup>
</mx:columns>
</mx:AdvancedDataGrid>
</mx:Panel>Nikos,
When using grouped columns you should change the <mx:columns> to <mx:groupedColumns>, I ran this example in a sandbox app and it works fine.
EXAMPLE:
<mx:AdvancedDataGrid id="deals" displayItemsExpanded="true" dataProvider="{flatData}" width="100%" height="373"
sortExpertMode="true" variableRowHeight="true" headerStyleName="smallHeader" editable="false" fontWeight="normal">
<mx:groupedColumns>
<mx:AdvancedDataGridColumn width="75">
</mx:AdvancedDataGridColumn>
<mx:AdvancedDataGridColumnGroup headerText="Client side">
<mx:AdvancedDataGridColumn dataField="customer" headerText="Mon Ref" width="60" editable="true" wordWrap="true" showDataTips="true" textAlign="center"/>
<mx:AdvancedDataGridColumn dataField="product" headerText="MC Pr" textAlign="center" wordWrap="true" width="70">
</mx:AdvancedDataGridColumn>
</mx:AdvancedDataGridColumnGroup>
<mx:AdvancedDataGridColumnGroup headerText="Bank side">
<mx:AdvancedDataGridColumn dataField="revenue" headerText="Bank Ref" width="70" editable="true" wordWrap="true"
showDataTips="true" textAlign="center"/>
<mx:AdvancedDataGridColumn dataField="cost" headerText="Bank Pr" width="55" editable="true" wordWrap="true" showDataTips="true" textAlign="center"/>
</mx:AdvancedDataGridColumnGroup>
</mx:groupedColumns>
</mx:AdvancedDataGrid>
HTH,
Kenny Yates -
Sometimes the Flex Builder design window crashes
Sometimes the Flex Builder design window crashes in that when
you click on components, you don't see the usual outline transform
box out side the component you clicked on. Also things like the
toggle button bar doesn't switch the viewstack. I have no errors or
warnings in the problems windows.
Any ways round this?Actually I found the answer to my question. You can find it
in my blog.
programmatic
skinning in Flex Builder Design view -
Order of Installation of Flex Builder, SVG Viewer, XML Parser
Hello VC Experts,
I am beginner. I need to create Reports in VC using BW Queries. I am Facing Flex application error while deploying the model. Is there any specific order of Installation of Flex Builder, SVG Viewer, XML Parser?
Kindly help me to *** up this pblm.
Regards,
GeetaHi Geeta,
please do not open twice threads for the same issue.
I close your first thread here:
Error in compiling Flex application (1). Consult log file for details.
But first enable the flex error log in VC, then you can post us the error message.
Best Regards,
Marcel -
Custom Components and passing arguments
This afternoon i got a great answer regarding the use of custom MXML components and calling a function back in the main application file. I can accomplish this now by using parentDocument BUT I need to pass the name of a function(for filtering) as a parameter of the function call in the custom component. Below are the two code fragments.
Custom Component Code
<mx:LinkButton label="10% off or more" click="parentDocument.filterFunction(showTenPercent)" />
Main App Code
public function filterFunction(functionName:Function):void {
merchantDG.visible=true;
merchantData.filterFunction=functionName;
merchantData.refresh();
public function showTenPercent(item:Object):Boolean {
return (item.merchantOfferCategory=="10%");
The filterFunction in the main App is called by multiple components so I believe I need to keep in centralized in the main app. There is probably another way to do this but I am building my Flex skills slowly and need to understand how to do this. As the code is now, I get an error about functions and strings.I believe instead of calling the function from inside the custom component you need to do this from inside your main application whenever you're initiating the custom component.
for ex.
<custom:LinkBtnCustom label="10% off or more" click="filterFunction(showTenPercent)"/>
this way you don't need the parentDocument prefix. -
Osmf sample with flex builder-design puzzle
Good Day,everyone!
It is my first time here.^_^
My puzzle:
I'm going to modify the design stytle of the OSMF example code with the flex builder 3,
but the former design frame cann't be viewed with the "design" tools. The warning indicates that
"Design mode:cann't load MediaPlayer.swc(reason:Error:Load Verify).It may require classes(such as Adobe AIR components)that are not supported by design mode."
I have checked everyting I can, and attampted so many ways,but it doesn't work.
Expecting for your suggestion!
Thanks a lot!
Good Luck!
xiaohuiThanks for your immediate responding!
I have focused on the DynamicStreamingSample.
I am using the osmf_source_6.
My Flex Builder version is the latest, and the sdk is 3.4.
When I imported the project, I have recompiled the MediaFramework and MediaPlayer project. Meantime, I added the new .swc file in
the BuildPath. Is everything all right?
Excuse me?When I unzip the zip file of the source, I find the MediaFramework.swc in the directory the same as other directores such as
apps,docs,frame and so on.
Why is the MediaFramework.swc file here? Is it different from the .swc which is compiled with the MediaFramework project?
Expecting for your news!
Good day! -
Hi,
Is there a way to access the mx version of components in Design View (Flash Builder Burrito), for those components that have both a Spark and a Halo/MX version, e.g. DataGrid?
Thanks... I know I can go to Source View and type in part of it, and switch to design view, however I'm doing a bunch of tutorials where the mx components are used, where one is simply dropping data services onto the components, apparently not supported yet on the newer Spark components?
-
hi, i am having this problem of not able to use the design
tab anymore :(
i have created a few mxml, with codes, visual components such
as textarea etc. I used to be able to use the design tab to
visually design the layout, but suddenly i cant anymore.
the error given was.. "flex this component is based on
application, which is not a visual component. switch to source mode
to edit it."
how can i make use of the design tab again??what i last did was to update the flex sdk. anyway i 'solved'
the problem by reinstalling flex builder... -
Set PC date and time in Flex builder 3
Hi,
Is there a way to set date and time of the PC in a desktop application developped with flex builder 3.
Regards,Flex Builder 3? I no longer remember if it supports Adobe AIR and what version. I would think newer versions of Adobe AIR can do it via NativeExtensions.
-
Upgrading packages from 2005 to 2012 : Custom components and delyavalidation woes
Hey folks
I've two specific cases with upgrading SSIS 2005 to 2012
1st : most annoying
I have a custom transformation written in c# 2005. It references sql server 2005 dlls such as from
Microsoft.SQLServer.DTSRuntimeWrap
Microsoft.SQLServer.ManagedDTS
Microsoft.SqlServer.PipelineHost
Those are stored under
C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies
The requirement is to upgrade the package to 2012 and the code as well. Since 2005 was not installed on new server , I copied the referenced dlls from old server , added them back to C# project and rebuilt the Custom components dlls then added to GAC
When I open the packages , they complain about the version
Error 2
Validation error. : The component metadata for "My_Comonents, clsid {874F7595-FB5F-40FF-96AF-FBFF8250E3EF}" could not be upgraded to the newer version of the component. The PerformUpgrade method failed.
So I thought , I can add the dll to the toolbox and add it again. WHen I try this , I get this error
"Could not load file or assembly Microsoft.SqlServer.PipelineHost ,version = 9.0.242.0"
Now I assume this is because I don't have 2005 components installed.
Before getting things messy , what should be the right approach :
a- Should I just leave the custom components dlls as they are and add them to GAC ? but they will still need 2005 dlls , should I install 2005 client components ?
b- I can not change the code of the c# project to use new SQL 2012 components , it's a lot of work. so what should be right approach here ?
That was the important part
2- Validation
Even for disabled tasks , like data flow task , setting delyavalidate= True still doesn't help against them being validated and raising error. removing them will help but I do not want , any workaround ?
ThanksThanks a lot Joost , appreciate the feedback
This is what I thought too.
I came to the blog you mentioned , but I wasn't sure how it should be related to my problem. Now I think I'll need to make the code changes.
Indeed , I see some declarations of *****90
public void CreateExternalMetaDataColumn(IDTSOutput90 output, int outputColumnID)
IDTSOutputColumn90 oColumn = output.OutputColumnCollection.GetObjectByID(outputColumnID);
IDTSExternalMetadataColumn90 eColumn = output.ExternalMetadataColumnCollection.New();
public override DTSValidationStatus Validate() {
IDTSVariables90 variables = null;
public override void SetOutputColumnDataTypeProperties(int outputID, int outputColumnID, Microsoft.SqlServer.Dts.Runtime.Wrapper.DataType dataType, int length, int precision, int scale, int codePage) {
IDTSOutputCollection90 outputColl = this.ComponentMetaData.OutputCollection;
IDTSOutput90 output = outputColl.GetObjectByID(outputID);
IDTSOutputColumnCollection90 columnColl = output.OutputColumnCollection;
IDTSOutputColumn90 column = columnColl.GetObjectByID(outputColumnID);
SO I should use 2012 references and start migrating this code over ? is it as easy as so ?
Thanks -
I have recently downloaded Flex Builder 3 for a trial. I have
been happily exploring and building simple apps and suddenly I
can't see the design view in any project or application. When I
click the "Design" tab I see a grey blank area with no visible
components.I unistalled/reinstalled the product but the problem
remains. Am i overlooking something simple being a newbie or has
anyone else had or is havin tghe same problem.try window --> perspective--> flex development
-
Flash Builder - Design View - can't resize/move objects anymore.
So, I've downloaded the 60 day trial of Flash Builder 4. I've been working with it for about 2 days and everything has been going fine. However, for some unknown reason, my design view panel just suddenly stopped working properly. I see the components (and the gray outlines of my containers) I'm working with, but when I try to click on them, I do not get that blue resizing outline with the handles. I see the properties panel change when I click different components, but I get no outline. So, I can no longer resize in this view. I also can't move components/containers around. I can only click on them and watch the properties panel change. I do not believe I've hit any sort of option in the menus. I closed the application and started it up again with the same result. I even rebooted my machine and tried again. As of right now, this problem seems to be permanent. Any ideas? Thanks for your time.
I would recommend you post on the Flash Builder forum: http://forums.adobe.com/community/flash_builder
-
Hi all,
I have also an issue when trying to view a component in the Flash Builder 4 Design View (running on Eclipse 3.5 SP-2).
The design view does not open and I get an error message. When I look into the Eclipse "Error Log" view I see the following stack trace and session data as shown below...
I appreciate any hint what is going wrong here...
Thanks!
Paul
java.lang.NullPointerException
at com.adobe.flexbuilder.mxml.editor.design.internal.MXMLDesignView4Commander.getDesignSurfa ce(MXMLDesignView4Commander.java:61)
at com.adobe.flexbuilder.mxml.editor.design.internal.MXMLDesignView4Commander.setFrameRate(M XMLDesignView4Commander.java:124)
at com.adobe.flexbuilder.designview.DesignViewPart$DesignShellListener.shellActivated(Design ViewPart.java:353)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:82)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1008)
at org.eclipse.swt.widgets.Decorations.WM_ACTIVATE(Decorations.java:1615)
at org.eclipse.swt.widgets.Shell.WM_ACTIVATE(Shell.java:2086)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3943)
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:342)
at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1578)
at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2010)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4619)
at org.eclipse.swt.internal.win32.OS.MessageBoxW(Native Method)
at org.eclipse.swt.internal.win32.OS.MessageBox(OS.java:2892)
at org.eclipse.swt.widgets.MessageBox.open(MessageBox.java:207)
at com.adobe.flexbuilder.mxml.editor.design.MXMLDesignPart.startDesignView(MXMLDesignPart.ja va:208)
at com.adobe.flexbuilder.mxml.editor.design.MXMLDesignPart.<init>(MXMLDesignPart.java:68)
at com.adobe.flexbuilder.mxml.editor.design.MXMLDesignEditor.initializePlayer(MXMLDesignEdit or.java:1411)
at com.adobe.flexbuilder.mxml.editor.design.MXMLDesignEditor.initializeDesignView(MXMLDesign Editor.java:1576)
at com.adobe.flexbuilder.mxml.editor.design.MXMLDesignEditor.setFocus(MXMLDesignEditor.java: 1736)
at org.eclipse.ui.part.MultiPageEditorPart.setFocus(MultiPageEditorPart.java:1119)
at org.eclipse.ui.part.MultiPageEditorPart.setFocus(MultiPageEditorPart.java:1101)
at com.adobe.flexbuilder.mxml.editor.MXMLEditor.setFocusIfActive(MXMLEditor.java:674)
at com.adobe.flexbuilder.mxml.editor.MXMLEditor.activateDesignEditor(MXMLEditor.java:638)
at com.adobe.flexbuilder.mxml.editor.MXMLEditor.activateDesignEditor(MXMLEditor.java:621)
at com.adobe.flexbuilder.mxml.editor.MXMLEditor.pageChange(MXMLEditor.java:489)
at com.adobe.flexbuilder.editorcore.editor.CodeAndDesignEditor.setActivePage(CodeAndDesignEd itor.java:684)
at com.adobe.flexbuilder.mxml.editor.MXMLEditor.setActivePage(MXMLEditor.java:544)
at com.adobe.flexbuilder.editorcore.editor.CodeAndDesignEditor$1.clicked(CodeAndDesignEditor .java:454)
at com.adobe.flexide.editorcore.ui.controls.ButtonBar.clicked(ButtonBar.java:289)
at com.adobe.flexide.editorcore.ui.controls.AbstractButton.sendClickEvent(AbstractButton.jav a:41)
at com.adobe.flexide.editorcore.ui.controls.ToggleButton.handleChange(ToggleButton.java:79)
at com.adobe.flexide.editorcore.ui.controls.ToggleButton.mouseDown(ToggleButton.java:66)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:179)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3910)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3503)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLau ncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.jav a:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
Session Data:
eclipse.buildId=unknown
java.version=1.6.0_16
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.productI have the same problem, and can not get answer.
Today I try to use a standalone version, it‘s running good.
So, it may tell us that the problem may be only happen in the situation that using a plugin version FB4 and running on win 7.
If you just need flex and do not use j2ee, I suggest you using a standalone FB. -
Images and styles not showing in Design view on CS3
Hi all,
I am playing around with a CSS website template that I downloaded and
opened in DW-CS3. I am just using this to learn and play around with. It
came with the style sheet, jpg images etc.
I just noticed that when in Design view for the index page, that the images
and styles, menus are not displaying, only the html text is visible in Design view.
When I preview the site with a browser like IE or FF, it displays fine along with
any changes I have made.
Does anyone have any ideas?
Regards,
danoIn DW, View > Style Rendering > Display Styles on?
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
http://alt-web.com/
http://twitter.com/altweb
Maybe you are looking for
-
Adding an S/MIME certificate to an existing contact in Outlook 2013
In previous versions of Outlook (e.g. 2010) when you received an S/MIME signed certificate from an external party you could right click on their name in the message and select "Add to Outlook Contacts". This would then store the cert in a contact for
-
Photoshop CS4 stopped launching, no error message. Mac os 10.5.8 on PPC
Hi all, I´m using Photoshop CS4 on this computer (Powerbook G4 PPC with OS 10.5.8, 10 GB HD free, 1.5 Gb Ram) without problems since 3 years ago. 2 days ago it stopped suddently working. It just doesn´t launch, without error message. On that days I w
-
Vendor wise payment term or po wise payment term with details
Dear All,, Please provide us detail of payment terms from PO Sr. No. 5500000839 to 5500001284 . any sap standard report of any sap standard tcode or vendor wise payment term or po wise payment term with details with warm regards pritpal
-
Keep getting Error Code 12 while attempting to use VXI-8360 ExpressCard
Using Dell XPS M1530 laptop running Win XP SP3. Everything ran great with same hardware back in September 08. Now I am getting Error Code 12, "This device cannot find enough free resources that is can use. (Code 12)". I have tried disabling other
-
Sync outlook calender through scalix server????
Can anyone help sync my outlook calender to my iphone. We use Saclix webmail which I read through outlook. Email & contacts syncs fine but calender doesn't.