Custom component Help

Hello

I'm trying to pass a variable to a custom component that I did. Here is my list of import for the script AS:

Import mx.controls.Image;
Import mx.controls.Label;
Import mx.containers.HBox;
Import mx.containers.VBox;
Import mx.containers.Panel;
Import mx.containers.Canvas;
Import mx.events.FlexEvent;
import flash.events.Event;

The script essentially make a picture of a thermometer and then I pass a value and it increases the level of 'mercury '. Here's my .mxml script that works fine:

< mx:Canvas label = "Test" width = "140" height = "268" y = "10" >

< custom id: thermometer = "thermo" y = "10" x = "10" Temperature = "27".
high value = relax "50" = "0" title = "Office" width = "116" height = "245" / >

< / mx:Canvas >

That is why a photo of the thermometer exactly as it should. My problem is that when I moved the component a varaible like {pSrv.lastResult.data.current.RH_OFFICE_CURR} it doesn't work anymore! I have no idea why, and I hope that someone has had this problem before. Why can't I send these data to my component?

Here is the solution discussed:

package components
{
Import mx.containers.Canvas;
Import mx.containers.VBox;
Import mx.controls.Image;

Thermometer/public class extends Canvas
{
/ * Variables for the child components * /.
protected var canvas: VBox;
protected var top_img:Image;
protected var bottom_img:Image;

/ * Flex calls the createChildren() method when
* the components are added. This is the right place
* implement control. Any final design, etc..,.
* occurs in updateDisplayList * /.
override protected function createChildren() (): void
{
super.createChildren ();
If (! canvas)
{
canvas = new VBox();
canvas.setStyle ("verticalGap", 0);
addChild (canvas);
}

Create and initialize the top image.
If (! top_img)
{
top_img = new Image();
canvas.addChild (top_img);
}

If (! bottom_img)
{
bottom_img = new Image();
canvas.addChild (bottom_img);
}
}

/ * Set the picture styles * /.
override protected function commitProperties (): void
{
super.commitProperties ();
top_img.source = ' img/blue.png;
bottom_img.source = ' img/red.png ';
}

/ * updateDisplayList positions, sizes and draw something it takes * /.
override the updateDisplayList(unscaledWidth:Number,_unscaledHeight:Number):void function
{
super.updateDisplayList (unscaledWidth, unscaledHeight);

TODO: use the unscaledHeight property to determine the
good scaling for the control.
top_img. ScaleY = 20;
bottom_img. ScaleY = _temp;
}

override protected function measure (): void
{
Super.Measure ();
measuredWidth is measuredMinWidth = 75;.
measuredHeight is MaxHeight = 200;.
}

public void Thermometer()
{
Super();
}

[Inspectable (defaultValue = 1)]
private var _temp:uint = 1;

[Bindable (event = "tempChange")]
public function get time (): uint
{
Return _temp;
}

public function set time (value: uint): void
{
_temp = value;
invalidateDisplayList();
}
}
}

Tags: Flex

Similar Questions

  • Helps the creation of a custom component.

    Hello. I created a very simple custom component called myComp. It's a simple canvas 100 pixels x 100 Basic with a component of Image control.
    < mx:Canvas >
    < mx:Image id = "image1" >
    < / mx:Canvas >

    After the instantiation of the component in Main.mxml for example. var pic1:myComp = new myComp(); I'm having a problem setting the source property of the Image element.

    "image1" is the id of the mx:Image in the custom compoenent, then I tried pic1.image1.source = ' assets/ball.jpg' but I get a runtime error ' Error #1009: cannot access a property or method of a null object reference.

    Don't really know what I'm doing wrong.

    Any help please!


    In your custom component, try adding a public var bindable that contains the path to your image. In addition, the value the image.source this var.
    In your main application, set the var within the tags in the custom component. Since this is a public var, it will appear in the indication of the code. You can also now change the var of the image of the main application whenever you like using ActionScript code.

  • Puzzled with a custom component. Can anyone help?

    I'm working on something that I would have 3 levels of dream limbo.

    Oh, wait, sorry... I mixed. Although I think my problem is just as artificial and frustrating time to wrap the head around.

    diagram.jpg

    What I REALLY want, is to do a custom component which has 3 levels, and I have problems with the passage of the mouse. My goal is to have a menu of several objects, each custom component. When you click on a component, it "opens" in a similar menu of additional components, which in turn can be hovered over to display an image. This seems to be the easy part.

    I created each element of second level (blue), which, after passage of the mouse displays an image (green). I combined all the people in a single component (red), personalized and individual States for the comprehensive component that 1) shows ONLY the red button and 2) displays the blue components with the red component disabled.

    What I can't figure out is how to make ONLY the (red) item appear for the passage of the mouse, then click on to the up state. What is happening now is that, as far as the browser is concerned, the entire component is the area of mousing. It is therefore impossible to put several (red) elements next to each other.

    I tried to do the (blue) and (green) components hidden or disabled, but it doesn't seem to affect the problem. I can't do these things not 'accept mouseover' because the elements (blue) are supposed to turn to be buttons to view the end frame (green).

    Anyone know what I can do to fix this? I hope that I was able to describe the situation pretty well. Like I said... it's kind of silly and artificial.

    WELL. After you type that on the whole, I think I have found the solution myself, and it of ridiculously simple and did me the same thing for not immediately understand.

    Like everything else in the catalyst, mouse events 'accept' can be changed to the same object in different States. So what you do is uncheck the box "accept...". "while in the top condition for each item and check once more in the lower States. In addition, the "Transparency accepts a mouse" must be unchecked.

    Simple.

  • Getting the list of Custom Component ListView

    Hello

    I'm trying to figure out how to get the 'checked' property of a custom component of QML.

    Basically, it's the same as the first example on https://developer.blackberry.com/cascades/documentation/ui/custom_components/index.html

    This is a list, with a listItemComponents, whose type: "item" contains a check box and the label.

    I have an ActionItem whose job is to take all elements that are enabled and do something.

    The ActionItem triggers a C++ code that should get this list.

    Problem is, I can't figure out how to get the selected items. I tried the selected() function but it returns empty.

    I have to turn this into a multiple selection?

    I got so far is the back of GroupModel, after selection, but this does not include anything other than what I fed in the first place. Which makes sense.

    There are a lot of similarities between this issue and the other. Should help to my code and comments in this post, I think: http://supportforums.blackberry.com/t5/Cascades-Development/LstItemComponent-doesn-t-track-the-model...

  • Is it possible to "build" a custom component using a command line script?

    Hi all

    From time to time to replicate our environment in instances of development/sandbox sandbox, we need the current generation of custom components production.

    What we do in general is - Component Wizard allows you to "build" each component one & then download the ZIPs. \

    I wonder if there is some sort of command line to "build" a custom component?

    That would allow me to write a script to quickly create all my custom components in a go, whenever necessary.

    Kind regards
    Prateek

    To answer the original question, Yes, there is a command line tool to build, activate, deactivate and install the components (even with the preferences), her right here:

    / Data/Oracle/user_projects/Domains/my_domain/UCM/CS/bin/ComponentTool

    Usage: ComponentTool [v |-vv] [t trace_section]--enable |-disable name

    ComponentTool [v |-vv] [t trace_section]... - sync

    ComponentTool [v |-vv] [t trace_section]... [- Install] path.hda: path.zip [-path.hda Preferences]

    ComponentTool [v |-vv] [t trace_section]--check-depends name

    ComponentTool [v |-vv] [t trace_section]... - name of the package

    ComponentTool [v |-vv] [trace_section]...--list-enabled|--list-disabled|--list|--interact|--help t

    The only thing is to compile the Java classes for you. For this you will need to an ANT script or something.

  • Need to include classes in the custom component

    Dear Experts,

    I have created custom components, for custom components, I used some different classes and jars and libs and now I want to include these pots, the lib and classes in the generation of custom component file.

    Please advise me how can I add these files in the component so that when I create the zip file included in the zip file.

    Please send me a link where I can get this information.

    Any help will be really appreciated.

    Kind regards

    Elena

    See the tutorial Services Intradoc

  • Using Custom Component error MEssage display

    Hello

    I built the custom component to validate the size of the file and the file Extension.

    That is, user should be able to check in the document if the size is less than 5 MB and the file extension is one of the "png", "tiff", "doc", "Pdf".

    Here, whenever validation files I'm throwing the exception "Type of file file size exceeds the limit or not valid.

    I am able to get the custom component of work according to the validation. And is alsi recording the error in the log file.

    But I need to show the error message when the click the user on the button control on the page of the Complutense University of MADRID.

    From now on, it shows a generic error saying "cannot perform the function validateStandard and service CHECKIN_NEW_SUB.
    The error was caused by a problem generated internally. The error was logged.

    Any help on this is much appreciated.

    Kind regards
    Helen Shetty.

    Hello

    You can throw a ServiceException in your filter with the message you want to display.

    Roman.

  • Impossible to uninstall our custom component.

    Hello

    Version of the Complutense University of MADRID: 11 GR 1 material - 11.1.1.6.0 - idcprod1 - 111219 T 111403 (Build: 7.3.3.183)

    We created a custom component that we tested and it works 100% in the DEV environment, but we cannot even activate, open or remove.

    The component has been downloaded DEV via the advanced Component Manager. We then installed the file generated in the TEST, and

    Here is a list of the warnings, we get:
    1 cannot open a single component of reading"- what happens when you try to open it.
    2. "can not uninstall a component in the Home Directory of the ECM" - this happens when we try to uninstall. We checked into the ECM Home Dir and the component is not listed in there.

    We checked the dir home ECM and the component is not yet there...

    How did this happen to a custom component and how can we overcome this problem or he avoid in the future?

    We must go beyond this issue, please help.

    Thank you

    Yes, he does. That's what I asked earlier on "tags". I don't see that the component tags had file, which is odd - given that tags aren't there, he shouldn't complain. I bet that the file idccs_components.hda in the target system is partially damaged.

    You may need to manually remove the component in the target environment and remove the section in the file "/ucm/cs/data/components/idccs_components.hda"in the target system that designates the component custom. (MAKE A BACKUP OF THIS FILE BEFORE MAKING ANY CHANGES.)

    Open Components Wizard in the dev environment of work (not the web INTERFACE, but the applet), then make sure you generate the component successfully in the development environment. Build it and then take the version rebuilt to import environmental target.

  • Custom component gR 10, 3 of the Complutense University of MADRID

    We have an obligation to build a custom, component in order to change enamel teample for 'Notice of expiry'. From now on, we have a component inside the 'custom' folder called "CS10gR35CoreUpdate" that has the file "query_notification_mail.htm" inside the folder teamplate and many other model. Now I will create a new custom component of the based on the existing "CS10gR35CoreUpdate" and edit the required file 'query_notification_mail.htm' and will allow this component of the Components Wizard and restarts the UCM.

    My Question is: how I'll make sure that new custom component is called when an email is sent for documents to be expired? What abt the existing one?

    Please help me as soon as possible, because I provide the soultion. Thank you!!

    Our custom component is not any file of defination resouce, and I do not see the loadorder in defination of resource. Where can I configure the order of loading on the custom component?

    Yes, that's what I meant (in the .hda folder).

    I have another Q? Is it safe to manually change model "query_notification_mail.htm" who that is on the inside:
    Install dir\custom\CS10gR35CoreUpdate\core\templates\query_notification_mail.htm, I ask this question because I have to make changes only in query_notification_mail.htm, so instead of creating the new component based on exit, if I change the file manually?

    What do you mean by "safe"? Of course, if change you it on a hard drive, it will work (ie. in this particular system, the change will apply). You should be careful when you implementCS10gRXCoreUpdate in the future (a global patch will replace most likely your changes). In general, the change of standard resources is not considered to be a very good practice (quick and dirty), but if it is a change in one system, you can probably live with that.

  • 11g Custom Component with SQL IN (val1, val2,..., valN) query

    Hello

    I want to use a query with a parameter of varchar entry into a custom component. The query definition is like this:

    < b >
    QWhereIsAdministrator < td > < table >
    < td > SELECT DISTINCT * FROM FWMTSITE WHERE ADMINISTRATOR IN (?) < table >
    varchar < td > UserRoleList < table >
    < /tr >

    I can't pass the value correct settings at the request of IdocScript
    I tried the following:

    < $UserRoleList = $ "" valA1","valA2"" >
    < $executeService ("SITES_WHERE_IS_ADMINISTRATOR") $ >

    < $UserRoleList = "\'valB1\',\'valB2\'"$ > ".
    < $executeService ("SITES_WHERE_IS_ADMINISTRATOR") $ >

    < $UserRoleList = $ js ("' valC1', 'valC2'") >
    < $executeService ("SITES_WHERE_IS_ADMINISTRATOR") $ >

    < $UserRoleList = $ xml ("' valD1', 'valD2'") >
    < $executeService ("SITES_WHERE_IS_ADMINISTRATOR") $ >

    < $UserRoleList = $ url ("' valE1', 'valE2'") >
    < $executeService ("SITES_WHERE_IS_ADMINISTRATOR") $ >

    < $UserRoleList = $ urlEscape7Bit ("' valF1', 'valF2'") >
    < $executeService ("SITES_WHERE_IS_ADMINISTRATOR") $ >

    No result found, the syntax of the request for enforcement is not correct. Here is the REQUEST trace output:

    SELECT DISTINCT * FROM FWMTSITE WHERE ADMINISTRATOR IN ("'valA1","valA2" ') [executed. [Return line (s): false]
    SELECT DISTINCT * FROM FWMTSITE WHERE ADMINISTRATOR IN ("'valB1","valB2" ') [executed. [Return line (s): false]
    SELECT DISTINCT * FROM FWMTSITE WHERE ADMINISTRATOR IN ('-"valC1\"-"valC2\" ') [executed. [Return line (s): false]
    SELECT DISTINCT * FROM FWMTSITE WHERE ADMINISTRATOR IN (' & #002339; valD1 & #002339; & #002339; valD2 & #002339;) ") [Executed." [Return line (s): false]
    SELECT DISTINCT * FROM FWMTSITE WHERE the ADMINISTRATOR IN ('% 27valE1% 27 %2 c % 27valE2% 27') [executed. [Return line (s): false]
    SELECT DISTINCT * FROM FWMTSITE WHERE the ADMINISTRATOR IN ('% 27valF1% 27% 27valF2% 27') [executed. [Return line (s): false]




    Thank you for your help.

    Change the type parameter of varchar to varchar.in in your definition of the query. Like this:

    
    QWhereIsAdministrator
    SELECT DISTINCT * FROM FWMTSITE WHERE ADMINISTRATOR IN ( ? )
    UserRoleList varchar.in
    
    

    In your workbook, put a list separated by commas in param UserRoleList. In java, you can use:

    final List someListOfStrings = ...; // your list of strings
    final String yourUserRoleListParam = StringUtils.createStringSimple( someListOfStrings );
    m_binder.putLocal( "UserRoleList", yourUserRoleListParam );
    

    In your case

    <$UserRoleList = "val1,val2,...,valN"$>
    

    should do the job.

    Kind regards
    Fabian

    Published by: fscherpe on March 24, 2011 07:45 (added iDoc variable saw you want to begin the application of the model, not Java)

  • Label is not posting on custom component when I am in him passing through actionScript

    Hi all

    I created a custom component that extends from Panel. I added a LinkButton on title bar on this component. I'm passing the linkbutton through a property named label1 label.

    Now in my main mxml I call this component like this:

    < comp: MyPanel label1 = "Click Me" / >

    This works perfectly well and I am able to see the child with lable.

    But when I use the following 2 ways that label does not appear on the child. Child appears on the title, but without all the tags bar:

    1. [Bindable]

    myLab;

    init()

    {

    myLabb = "test";

    }

    < comp: MyPanel label1 = "{myLab}" / >

    2 < comp: MyPanel id = mypan / >

    init (): void

    {

    mypan. Label1 = "test";

    }

    Please help me!

    I'm glad to hear it. Please mark as completed

  • Use the custom component to retrieve form data

    Hi, I'm creating a custom component that can extract data from form for a task, when I run the component in the workflow, it will throw an exception:

    "com.adobe.idp.taskmanager.dsc.client.task.TaskImpl cannot be cast to com.adobe.idp.taskmanager.dsc.client.task.TaskInfo.

    on line:

    ' TaskInfo tinfo = taskManager.getTaskInfo (taskId);

    If I put the same code on a java console app to test it, it works fine.

    I tried Google but offer nothing for TaskImpl.

    Thank you

    hkho

    These links should help:

    http://help.Adobe.com/en_US/LiveCycle/9.0/componentXMLRef/webframe.html

    http://help.Adobe.com/en_US/LiveCycle/9.0/programLC/help/index.htm?content=001379.html

    http://www.Adobe.com/devnet/LiveCycle/articles/dsc_development.html

    -Note that for the import-package, it must be explicit.  specifying a.b.c won't matter in a.b.c.d classes.

    -for classes that you import, you can not have the jar in the classpath of component.xml and do not want it in included in your container of components.

    -If you use ServiceClientFactory.createInstance () without a context, then you will get the current context.  Which it is depends on how your service operation is called.  I have direct invocation by a user will have the context of the user.  So called by the engine of workflow in a long-lived process then it will run in a system context.  Since you call TaskManager to extract data from a task, rights of access apply so you should be aware of the context.  The context of the system has full access rights so it can get the desired results.  But runs under the context of the user calling, that user must be the owner of the task or the request fails.

  • listening in the main application for event from custom component

    I have a component that custom im using an identifier.  I watch videos and tutorials on how to pass variables between applications and custom components. the problem im having is that tutorials or explanation you put the event on the custom component and then it refers to a function in the main application.

    Is a fair way to listen on the main application at the event begins? Ive been tempting for hours and I know there must be something im missing may not be so difficult. any help, I would be really grateful.

    Thank you

    Miguel

    Hello

    The following example has been done as a simple demonstration of States, but the connection (state1) component, is a simple custom event which is sent by the ok button on the connection, the event could be extended to transfer the information to connect to the main application, in this case because the login screen is always public vars or fields of the box would be available for the main application anyway.

    http://gumbo.flashhub.NET/Wizard/ source included

    David.

  • Custom component... Null object reference

    I'm having a hard time understanding how to solve a problem, I have met in my flex application and I hope someone here can help me out! I will try and provide a very basic example that illustrates my problem...

    <! - Main.mxml - >

    " < = xmlns:mx mx:Application ' http://www.Adobe.com/2006/MXML "layout ="vertical"initialize =" init () "> "

    < mx:Script >
    <! [CDATA]

    private function init (): void {}

    I have a call here that connects to a server of clodfusion by a remote object that returns a user object

    }

    []] >
    < / mx:Script >

    Then, I call a component customized which manages permissions for my application.  I pass on the user object in the custom component

    < user comp: permissions = "{user}" / >

    < / mx:Application >

    <! - Permissions.mxml - >

    " < = xmlns:mx mx:VBox ' http://www.Adobe.com/2006/MXML "creationComplete ="init ()">

    < mx:Script >
    <! [CDATA]

    Basically, this function is triggered and gets some info that depends on the user loged in

    private function init (): void {}

    svc.getSomething (user. PKEY);

    }

    < / mx:Script >

    < / mx:VBox >

    So the problem is that my call to the main application takes a few seconds to run and as the client component is processed before the entire purpose of the use is returned I get the error "object Null Reference '...  How can I make sure that the user object has been created and returned prior to use in my custom components?

    Thank you

    Probably the error will disappear if you create an empty instance of the VO of the user.

  • How to import the custom component exported from flash cs3

    Hello

    I exported a custom component that I designed in flash cs3 as a SWC file. How to import it in my project flex and how to use it?

    Sorry if this is a stupid question. I'm new to flex. Thank you.

    You must add the swc file in your path of the project. Please check the following URL for more information about how to import Flash components in Flex project.
    http://www.Adobe.com/devnet/flash/articles/flex_component_workflow.html

    I hope this helps.

Maybe you are looking for