Use custom AS  Class in MXML

Hi,
I have a custom class which extend button, and parameters is
needed in constructor.
when I try to put the class in MXML as visual compoents such
as <mx:customButton />
ArgumentError: Error #1063: Argument count mismatch on ____
Expected 0, got 1.
Appearently the parameters for the constructor is missed. but
how can i pass the parameters in the tag?
Thanks in advances.
C.

You can't use arguments on the constructor in MXML. Aside of
anything else, there's no way to pass them. Your options are - if
you want to use the same component from AS and really want those
constructor arguments, is to make them optional:
public customButton(myArg:String=null)...
The attributes specified in the MXML will be assigned to
public properties by the same name once the instance has been
created. So if you want to be able to say:
<mx:customButton myArg="hello"/>
You'll need to do something like:
public class customButton extends Button{
public var myArg:String;
By the way it's conventional to use uppercase to start the
name of a class, and lowercase to start the name of an instance. So
it would be conventional to call your class CustomButton.
Tim

Similar Messages

  • Using Custom Java Class - WorkflowRegistry.xml

    I am using a custom java class in workflow. While executing I am getting errot -
    com.waveset.util.WavesetException: Class com.LdapGroupMod is not a WorkflowApplication
    It seems from documentation that I need to add this in workflowregistry.xml file. I added the same like given below -
    <WorkflowApplication name='Workflow Name'
    class='com.LdapGroupMod'>
    <Comments>Nothing Here</Comments>
    </WorkflowApplication>Even tried restaring the application server but I am still getting same error. Any idea what needs to be done here? or I am missing smething?

    Well the first thing would be to read the workflowRegistry.xml file. The header talks about internal and external applications and so on. The crucial part is that any application registered must implement the WorkflowApplication interface (which I guess your class dont do)
    I gave up. I am totally baffled by the documentation. I admit it.
    What I did was to create an Script action in an Activity where the script used Xpress to invoke my class. It seems to work.

  • Creating users using custom made class/UI in portal

    This is what i have to achieve,
    I need to create an interface in portal which will,
    1. Create users in the OID where the users extend a class which i have created in OID with my custom attributes.
    2. Then create them in portal and then assign them to default groups which will depend on a parameter in the user creation form.
    From reading various documents in Metalink and OTN i have understood that the wwsec_api package allows us to do all this except that it is all for a user which will extend a predefined set of classes.
    So i decided to do this
    1.Make entries into the OID using the DBMS_LDAP package using commands like
    emp_vals(1) := p_first_name;
    DBMS_LDAP.populate_mod_array(emp_array,DBMS_LDAP.MOD_ADD,'firstName',emp_vals);
    retval := DBMS_LDAP.add_s(emp_session,emp_dn,emp_array);
    2.Fire the wwsec_api.add_portal_user to create the portal user and then activate and assign him to the default group after running the provsyns.sql file
    The problem i face is that i get errors when i execute the said procedure from any other schema other than portal.
    When the procedure is recreated in the portal schema and executed it works fine.
    So i decided to create the entire package in the portal schema itself.
    Now the problem i face is that the proc would execute fine on the sql prompt but fail when called from the form created in portal based on this procedure.
    I found out that the execution fails when the wwsec_api.xxx calls are made.
    The exceptions are not specific and have the error code 1 => user defined exception
    To have a workaround for this i directly inserted into the wwsec_person$ table with no values for the GUID column( I know this is not recommended but i gave it a try)
    The insert worked fine but i still had to set his default group.I tried updating the rows for the user to set the default_group column but there seems to be a trigger on it which causes the update to fail.
    Also when i check up the wwsec_person$ table there two rows for each user that i created ,one without the GUID/default_group and the other with the GUID/default_group.I guess this is because of the trigger.
    If i try using the wwsec_api.set_defaultgroup api, the proc fails.
    It is quite interesting to note that all the steps mentioned above, grant access to the user to portal.
    But the place it fails is while setting the default group for the same which is of prime importance to me.
    Also because I am inserting directly into the tables i have also to delete them when the user is deleted, this is because i again cannot execute the delete_portal_user in the wwsec_api package from the browser.
    Surprisingly the wwsec_api.create_list function works fine.
    Once i have created the users all the manipulations like changing group memberships etc become easy as i just modify the required details in the OID itself.
    What i need is a proper/safe way to do what i have just mentioned above.
    Please help out ASAP as this is urgent.
    Regards,
    KK

    Based on your requirements, you should go about things a little differently...
    You have written your custom DBMS_LDAP code to create and populate the user entry including your custom objectclasses - good.
    You don't need to create the user profile in the Portal schema at all.
    To set the default group, just set the orcldefaultprofilegroup attribute in the user entry in OID. This should be set to the DN of the default group.
    When the user logs on, his profile will automatically be created, and the default group will also sync up with the user entry in OID (patch required - 2830252).
    Also, you should have DIP provisioning running so that updates to the orcldefaultprofilegroup attribute in OID are subsequently conveyed to the portal schema. It will also take care of automatically deleting the user profile from the portal if the user is removed from OID.
    Please see the Portal Configuration Guide on how to enable and activate the Directory Integration Platform (DIP) provisioning integration between OID and Portal

  • How to dispatch events from custom AS3 classes to MXML

    Hello,
    I introduce some custom classes inside my SCRIPT tag in MXML.
    These classes should dispatch custom Events (or any events for that
    matter) and the listeners should be defined inside the SCRIPT tag.
    In the custom class I have:
    quote:
    dispatchEvent(new Event("customEvent"));
    And inside the script tag:
    quote:
    addEventListener("customEvent", testListener);
    quote:
    public function testListener(evt:Event):void{
    Alert("Event fired successfully.");
    However, this event is not handled in the listener (the alert
    is not shown). What could be wrong?

    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" creationComplete="init();">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    private function init():void
    addEventListener("customEvent", testListener);
    dispatchEvent(new Event("customEvent"));
    private function testListener(evt:Event):void{
    Alert.show("Event fired successfully.");
    Do like this
    Alert is the Class Object. This is not the Function.

  • Alternative to f:verbatim to use custom DIV classes?

    I have some pages with panelCustomizable facets containing simple HTML like so:
    <f:verbatim>
    <div class="tableClass">
    <table cellpadding="0" cellspacing="0">
    <tr>
    <td colspan="2"><h2>TABLE TITLE</h2></td>
    </tr>
    </f:verbatim>
    At runtime, in "*Edit mode*", when I try to "*Add Content*" - the page hangs with a message about "stopping long-running script" which point to core11.1.1.3.js line 4569
    By some trial and elimination - i think this is due to usage of f:verbatim tag- so whats the alternative?
    I could use included HTML snippets stored off the file system (as shown in Avitek sample) but the data will eventually be dynamic and coming from data controls - to which i want to add some formatted text

    Yannick - you are so right.
    I once added some plain text in Design view which automatically got wrapped in <f:verbatim> and I assumed all plain HTML needed it.
    Now this leads me to new exceptions which I will try to fix
    java.lang.NullPointerException
         at oracle.jbo.uicli.binding.JUMethodIteratorDef$JUMethodIteratorBinding.hasRefreshParametersChanged(JUMethodIteratorDef.java:541)
         at oracle.jbo.uicli.binding.JUMethodIteratorDef$JUMethodIteratorBinding.executeQueryIfNeeded(JUMethodIteratorDef.java:334)
         at oracle.adf.model.binding.DCBindingContainer.internalRefreshControl(DCBindingContainer.java:3185)
         at oracle.adf.model.binding.DCBindingContainer.refresh(DCBindingContainer.java:2845)
         at oracle.adf.controller.internal.binding.TaskFlowRegionController.doRegionRefresh(TaskFlowRegionController.java:227)
         at oracle.adf.controller.internal.binding.TaskFlowRegionController.refreshRegion(TaskFlowRegionController.java:119)
         at oracle.adf.model.binding.DCBindingContainer.internalRefreshControl(DCBindingContainer.java:3143)
         at oracle.adf.model.binding.DCBindingContainer.refresh(DCBindingContainer.java:2845)
         at oracle.adf.controller.internal.binding.TaskFlowRegionController.doRegionRefresh(TaskFlowRegionController.java:227)
         at oracle.adf.controller.internal.binding.TaskFlowRegionController.refreshRegion(TaskFlowRegionController.java:119)
    Edited by: new_to_webcenter on 24-Jan-2011 02:42

  • Force JAXB  to use custom base class on a per complexType basis?

    I know I can <superClass="Blah"> in <globalBindings> to make all classes use "Blah" as a super class. Is there a way to get a complexType to use its own user defined base class?
    I'd like the JAXB compiler to generate the following classes for the schema below:
    What I'd like JAXB compiler to create:
    class A extends MyUserDefinedAbstractA{}...
    class B extends MyUserDefinedAbstractB{};For my own base classes:
    abstract class MyUserDefinedAbstractA {}
    abstract class MyUserDefinedAbstractB {}Based on the following schema:
    <complexType name="A"> .... </complexType>
    <complexType name="B"> .... </complexType>What is the alternative if I can't do the above? I'd like the generated classes to more than just hold data. I'd like them to have methods that can operate on the data as well.
    Regards,
    Monty
    Edited by: CuriousJorj on Jul 9, 2008 6:33 AM
    Edited by: CuriousJorj on Jul 9, 2008 6:35 AM

    There are some Safari extensions that can block JavaScript by domain, but you'll have to search for them.

  • Creating data dictionary type using custom java class

    Hi Experts,
    I have a situation involving the TableSorter mechanism as described here:
    In order to do my sorting correctly, I've created my own Java class implementing the Comparable interface. Based on this class, I need to define my own data dictionary type to be used in a context/table.
    However, I cannot se how this could be achieved as standard Data Dictionary elements can only be based on simple built-in types. Any ideas?
    Kind regards,
    Rasmus Røjkjær Ørtoft

    Hi,
    have you tried to use the following steps while creating your attribute
    1) Right click on the context
    2) New->Attribute
    3) Manually-> Provide a name for the attribute
    4) Browse->Select java native type and select your class
    regards
    Ayyapparaj

  • Error Smart Form Collections using various  Form Classes

    I want to add a Smart Form into a collection contianing two PDS's . 
    Before I add the Smart Form the collection works.
    The Collection is using customized form-class ZLSO_PWB_COVER and one PDF #1  is using standard form-class LSO_PWB_COVER and PDF #2 is using standard form-class LSO_PWB_CURRI_INFO.
    After I add the Smart Form into the collection, the process errors out.  
    Any ideas why by adding the Smart Form I would get an error?

    Solved myself.

  • What is customer  processin class..and its range...

    Please help me.....
    Customer  processing class be setup in the Range below.....
    60-70
    80-90
    70-80
    90-100.

    Hi Skiranth,
    By using customer processing classes, you can be able to group wage types in a different grouping than the standard ones. By this way, you can use VWTCL decision operation in your rules based on the processing class you maintain.
    E.g. Let's say you wanna group the wage types as being company-based and personnel-based. Then you maintain processing class 90 of all company-based wage types with 1 and all personnel-based wage types with 2. Then in a rule, you can process these wage types according to this grouping as follows:
    D  VWTCL 90
    1 ....
    2 ....
    ERROR
    Regards,
    Dilek

  • Facing problem to Use a custom Java class in UCCX

    /* Style Definitions */
    table.MsoNormalTable
    {mso-style-name:"Table Normal";
    mso-tstyle-rowband-size:0;
    mso-tstyle-colband-size:0;
    mso-style-noshow:yes;
    mso-style-priority:99;
    mso-style-qformat:yes;
    mso-style-parent:"";
    mso-padding-alt:0in 5.4pt 0in 5.4pt;
    mso-para-margin-top:0in;
    mso-para-margin-right:0in;
    mso-para-margin-bottom:10.0pt;
    mso-para-margin-left:0in;
    line-height:115%;
    mso-pagination:widow-orphan;
    font-size:11.0pt;
    font-family:"Calibri","sans-serif";
    mso-ascii-font-family:Calibri;
    mso-ascii-theme-font:minor-latin;
    mso-hansi-font-family:Calibri;
    mso-hansi-theme-font:minor-latin;}
    Hi,
    We are using Communication manager 7.0.1 and UCCX version 7.0.1(Cisco Unified CCX Premium).  We are trying to call a Custom Java class file from UCCX scripting. We have followed the steps mentioned in the guide (How-To: Using a custom Java class in UCCX 5.x (SOAP Example)). See below link.
    http://www.avholloway.com/vtools/ipcc/custom-java/soap/
    After completed all the steps we have got the variable type SimpleSOAP at script but we did not found it to object constructors or object attributes (plz find the attached screenshots). We will appreciate if you plz guide us to solve the issue.
    Thanks
    Fakhrul
    LEADS Corporation Ltd.

    Hello, Fakhrul.
    I'm sorry to see you were not able to find the information or help you were looking for here in the Contact Center community forum.
    You may be able to find more help through the Cisco Developer Network.
    Also, you might want to consider engaging Cisco Advanced Services via your account team to assist with UCCX custom scripting.
    Thank you, and good luck.
    -Paulo

  • Problem Using Custom Classes in UCCX8.5.1 SU3

    Dear All,
    My team is facing problem in using Java custom classes for UCCX 8.5.1 SU3
    The problem is that we have created some conditional prompts for currency in different languages, our custom java class contains two mathods GetEnglishString(parameter set) and GetUrduString(parameter set). We are able to use/call both methods one by one and both at same time in CCX Editor and validate the script successfully but when we set the script as application it failed.
    We tried to use both methods one by one and found that script with GetEnglishString is working ok but when we place GetUrduString (alone as well) MIVR logs say that method is unknown altough CCX Editor does not give us any error. We triend to restard Administration and Engine Services several time but to no avail. If somebody know the reason and solution kindly share it ASAP.
    Regards
    Kashif Surhio

    Hi
    In that case I would double check you have uploaded the file, and restart the server completely. In testing we found that restarting the engine didn't always reload the classes.
    Aaron

  • Use of bpelx built-in methods like getVariableData in custom java classes

    Hi,
    how can I use bpelx built-in methods like getVariableData ...
    inside custom java classes embedded with BPEL project?
    I have large java code to embed with BPEL process
    and it will be very useful ....
    It is possible to access these methods like static methods of some class?
    import com.xxx.yyy.class;
    class.getVaribleData("inputVariable","payload","/ns1:mailMessage/ns1:content/ns1:multiPart");
    Regards
    Karel

    you can access them from <bpelx:exec> activity and you can pass these returned document to underlying java class.
    Re: getVariableData in Java Exec

  • How to use custom password encryptor/decryptor class for jdbc connection

    I am in process of migrating application from Jrun server to weblogic . In jrun we use to provide our custom class which used to decrypt the password provided in resource file as below
    <username>webclt</username>
    <password>AAAAAAASSSSSSSCCCCCCCCCCCCCC</password>
    <encrypted>true</encrypted>
    <encryption-class>com.CustomEncryptor</encryption-class>
    How could i use the same class while configuring datasource in weblogic 10 server.

    1- By default, the jre will read the user's cacerts which runs the program.
    2- You can specify another cacerts this way :
    System.setProperty("javax.net.ssl.trustStore", my_trust);
    For the case 1 and 2, you need to put the certificate in the cacerts.. Or,
    3- You implement a custom TrustManager which, for example, accepts all certificates :
    class X509TrustManagerTrustAll implements X509TrustManager {
    public boolean checkClientTrusted(java.security.cert.X509Certificate[] chain){
    return true;
    public boolean isServerTrusted(java.security.cert.X509Certificate[] chain){
    return true;
    public boolean isClientTrusted(java.security.cert.X509Certificate[] chain){
    return true;
    public java.security.cert.X509Certificate[] getAcceptedIssuers() {
    return null;
    public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) {}
    public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) {}
    and you call it in the right place in the code you wrote (SSLContext,..)
    Hope it helps and deserves a duke star ;)

  • Using custom class loaders with DefaultCacheServer

    Hello,
    Is it possible for the DefaultCacheServer to use the class loader specified when a named cache is initially created (e.g. CacheFactory.getCache(cacheName, classLoader))? We would like our application to allow cached objects to be customized and deployed at runtime. Performing a rolling restart of the DefaultCacheServers to update the classpath is not feasible as this could negatively impact existing applications.
    Thanks,
    Jim

    Hi Jim,
    You are correct, the DefaultCacheServer does not currently have any ClassLoader customization support. What is important to know is that the DefaultCacheServer is just a thin wrapper around the Coherence library, and the only functionality it adds is the auto starting of services, and periodic reassurance that the services are still running. As suggested in my prior post, you can choose to extend, or call out to it's methods to add functionality. If you are interested in per-cache ClassLoaders, you should be able to achieve this by again creating your own custom CacheServer class, which iterates through your list of caches, and calls CacheFactory.getCache(name, loader), and then finishes up by calling DefaultCacheServer.main().
    You may also want to consider using seperate cache services (still in the same process) per customer. If you were to take such an approach you could choose to address the ClassLoader issue by calling the setContextClassLoader() method on each service, which would then cover all caches associated to a specific customer. There are other benefits to the multi-service approach, for instance you can choose to run or not run a service on a given node, allowing more control over how much of your cluster resources a customer has access to.
    thanks,
    mark
    Coherence Development Team

  • Using custom classes that are not beans

    Hi folks,
    Is it possible to use java classes that are not beans. I mean, on a page, could you say Customer cust = new Customer("Jones", 25);
    if you had a Customer class with a constructor that took a name and age (String and int).
    If so, how do you go about this- do you need to import the class, or put it in a standard location? I'm using Tomcat, and would guess that this would go in WEB-INF/classes?
    I hope it's not a stupid question, all the literature seems to be focused on JavaBeans
    Any advice on this would be great!

    Beans are used as putting Java code into a JSP is generally considered bad practice. The advantage of the bean pattern is that you use things like:
    <jsp:setProperty name="laBean" property="someSetter" value="someValue" />so that you aren't embedding Java directly into the JSP. I'm not very religious about this particular topic personally and will throw a line or two in here and there.
    Having said that though, you can easily use any Java class in a JSP. You'll have to import it first:
    <%@ page import="java.util.*" %>And then you can easily use it like in a real Java program.

Maybe you are looking for