Can you call a public method in a custom skin?

I made a custom skin for a button. In the skin there's a method to change some text. Can I call this method from my application?
I get an error message when I try to call it like a normal object:
uploadNewBtn.setNewPhotosLabel("test");
Error 1061: Call to a possibly undefined method setNewPhotosLabel through a reference with static type spark.components:Button.

You said it yourself, the method is inside skin not the HostComponent (button in your case). Obviously you cannot call it.
There is a skin protperty inside SkinnableComponent, but it is typed as UIComponent so you still cannot cal it on the skin without casting. I don't know your use case, so in theory you either push the text/label from the host towards the skin, or you listen or bind from the skin on the hostcomponent.
C

Similar Messages

  • Can you call a class method as an RFC function

    Hi
    I would like to know whether it is possible to instantiate a class in another system via RFC and then call a method eg. cl_abap_typedescr=>describe_by_name, of that class in the other system like you can with an RFC enabled function.
    Thanks
    Faaiez

    Its not possible to call a method like RFC.
    What you could do is write a RFC and within that instantiate the class and call desired method .
    And now you can call this RFC from the other system.
    Regards
    Raja

  • Can you override a public static method?

    Can you override a public static method?

    A static method belongs to a class, not to a particular object, because you can call them without having an object instantiated. Methods are over rided which are inherited from an object. Since Static methods (although inherited) are not bound to a particular object, are not overridden.
    Though you have a method in the subclass with the same signatures but if you try to call super.____() you will get the error
    non-static variable super cannot be referenced from a static context

  • Can we call a static method without mentioning the class name

    public class Stuff {
         public static final int MY_CONSTANT = 5;
         public static int doStuff(int x){ return (x++)*x;}
    import xcom.Stuff.*;
    import java.lang.System.out;
    class User {
       public static void main(String[] args){
       new User().go();
       void go(){out.println(doStuff(MY_CONSTANT));}
    }Will the above code compile?
    can be call a static method without mentioning the class name?

    Yes, why do it simply?
    pksingh79 wrote:
    call a static method without mentioning the class name?For a given value of   "without mentioning the class name".
        public static Object invokeStaticMethod(String className, String methodName, Object[] args) throws Exception {
            Class<?>[] types = new Class<?>[args.length];
            for(int i=0;i<args.length;++i) types[i] = args==null?Object.class:args[i].getClass();
    return Class.forName(className).getDeclaredMethod(methodName,types).invoke(null,args);

  • Can we call a BO method directly

    Hi all,
    Can we call a BO method  explicitly in a program .
    e.g. can i  call the method approve of the  FORMABSENC BO.
    Regards,
    Sateesh.

    Of course you can. You just need to include the macros include so you can create objects and call the methods. If you are not familiar with the different macros, just browse through <CNTN01> to find what you need. There is documentation in the code.
    You will probably need at least the following four macros
    SWC_CREATE_OBJECT to create an object from its type and key.
    SWC_SET_ELEMENT one or more times to fill the container with appropriate parameters.
    SWC_CALL_METHOD to call the method.
    SWC_GET_ELEMENT one or more times to retrieve returned parameters.
    Note that SWC_SET_ELEMENT does not work for table parametes, use SWC_SET_TABLE instead.

  • How can I call the create method in BO from Application Service

    Hello!
    When I create a Business Object, CAF generates some methods automatically.
    How can I call the create method in the BO from Application Service logic?
    When i call the method then the entityManager and the sessionContext is NULL.
    How can I initialize this?
    Can anybody help me?
    Thanks, Thomas

    If you are using CE 7.11...
    1) In the Application Services, add the BO as dependant object in dependencies tab.
    2) In the implemention, add the following codes to call create method of the BO:
    this.get<BO>.createMethod();
    julius

  • I cannot download adobe reader in order to download an item. can you call me Removed by Moderator

    I cannot download adobe reader in order to download an item.  can you call me

    What is your operating system & version?
    Define "cannot" - what happens when you try?
    Try downloading the offline installer from http://get.adobe.com/reader/enterprise/
    P.S. this is a user-to-user support forum; you can use paid support if you want telephone support: http://helpx.adobe.com/reader.html

  • Can you Call qdbus?

    Hi
    After allot of upgrades, lot of .pacnew files resolving, a boot partition resize and grub reinstallation, I had allot of problems which is hardly surprising but I solved them all except one: when I login to KDE through KDM or GDM I get the good old error message
    Could not start D-Bus. Can you Call qdbus?
    And yes, I can call qdbus. I was seeing this error before I switched to systemd, but this was long time ago and then it was working until yesterday.
    I can start kde by starting X from the console and then typing
    DISPLAY=0 startkde &
    but not from a display manager. Gnome starts fine.
    I'm running out of ideas. Where should I look?

    After
    ln -s /usr/bin/qdbus /qdbus
    I can login into kde and I do not get the above message. But kde get unresponsive from time to time when I switch between windows. I had this problem more than a year ago and was using xfce in the meantime. Does anyone have any ide this time what causes this error?

  • Can you call a plsql application process from a validation?

    Can you call an on-demand plsql application process from a page validation?
    Thank you,
    Gayle

    Gayle:
    I don't think you can do that. You could consider moving the ODP into the database as a stored procedure . The stored procedure can then be referenced in the ODP and in your validation code as well.
    varad

  • I want to make an identity card of my dad. he is a government employee. so can you send me whole method to make it using Photoshop CS2 ? please its urgent,

    i want to make an identity card of my dad. he is a government employee. so can you send me whole method to make it using Photoshop CS2 ? please its urgent

    Identity cards are not things individuals typically make.
    You can get yourself into big trouble forging fake IDs.
    -Noel

  • Can you call these regular US numbers from Skype? ...

    Can you call these regular US based number's from Skype without being blocked why or why not?
    Number's are  from (removed).
    They are considered "free telephone chat line's" only long distance or regular fee's would apply.
    So are these allowed by the Skype system etc?
    Some example's of the phone number's incase you can't visit the site are: (removed)
                                                                              Thanks in advance.

    playdoughfigure wrote:
    1. They are considered "free telephone chat line's" only long distance or regular fee's would apply.
    2. So are these allowed by the Skype system etc?
    Hello,
    I've made a test call to one of these #s.
    1. Yes. That statement is correct.
    2.  Yes they are allowed.
    I've had to edit your post a little as we don't allow third party sites being posted.
    TIME ZONE - US EASTERN. LOCATION - PHILADELPHIA, PA, USA.
    I recommend that you always run the latest Skype version: Windows & Mac
    If my advice helped to fix your issue please mark it as a solution to help others.
    Please note that I generally don't respond to unsolicited Private Messages. Thank you.

  • How can i call the public void paint(Graphics g) method on click of button?

    Hello,
    I have done this before i know its got to do something with the repaint() method but can someone show me with and example and call the paint method using AWT in a frame not in an applet....
    Thank you very much.

    Thank You very Much.... You have cleared all my doubts.
    But my main objective is to display an image in an AWT Frame !!
    here is the code that i have been trying..
    import java.awt.*;
    import java.awt.event.*;
    public class check6 extends Panel
         Frame f;
         Image i;
         public check6()
              f = new Frame("Heading");
              f.addWindowListener(new WindowAdapter(){
                   public void windowClosing(WindowEvent e){
                        System.exit(0);
              final Button b1 = new Button("Submit");
              b1.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e){
                        repaint();
              i = getImage(getCodeBase(), "titanic.jpg");
              add(b1);
              setLayout(new FlowLayout(FlowLayout.LEFT));
              f.add(this);
              f.setSize(500,500);
              f.setVisible(true);
         public void paint(Graphics g)
              g.drawImage(i,10,10,this);
         public static void main(String args[])
              new check6();
    }

  • How can I call  a component method from OCAP ?

    I'll try to invoke Cold Fusion Component from Xlet (OCAP App), specifically I wan to invoke a query from Component(CFC) method.
    Somebody knows how to... or any idea or comments.
    Thank you so much!

    Actually, as long as the servlet returns valid javascript, you can indeed "call it" from the client. It will initiate a request and return the result to the browser.
    This example uses Perl, but it could be easily modified to go to a servlet instead.
    Note that it is only supported in DOM browsers (IE6+/NN6+/etc)
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
    <html>
    <head>
    <title> Test server-side JS </title>
    </head>
    <body>
    <script type="text/javascript">
    function checkIt(variable, value)
    var newScript = "cgi-bin/validateJS.cgi?"+variable+"="+value;
    var body = document.getElementsByTagName('body').item(0)
    var scriptTag = document.getElementById('loadScript');
    if(scriptTag) body.removeChild(scriptTag);
    script = document.createElement('script');
    script.src = newScript;
         script.type = 'text/javascript';
         script.id = 'loadScript';
         body.appendChild(script)
    </script>
    <p>Test.</p>
    <form id="f1" action="">
    <input type="text" name="t1" id="t1" onChange="checkIt(this.name, this.value)">
    </body>
    </html>
    validateJS.cgi
    #!/opt/x11r6/bin/perl
    use CGI qw(:all);
    my @valArray = split(/=/,$ENV{QUERY_STRING});
    print "Content-type: text/javascript\n\n";
    # myPass is the password
    $myPass = "foobar";
    if ("$valArray[1]" eq "$myPass")
    print "alert(\"Success!!\")";
    else
    print "alert(\"Failure!!\")";

  • How can I call a servlet method from a javascript function

    I want to call l a servlet method from a javascript function.
    Does any one have an example of code.
    Thinks in advance

    Actually, as long as the servlet returns valid javascript, you can indeed "call it" from the client. It will initiate a request and return the result to the browser.
    This example uses Perl, but it could be easily modified to go to a servlet instead.
    Note that it is only supported in DOM browsers (IE6+/NN6+/etc)
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
    <html>
    <head>
    <title> Test server-side JS </title>
    </head>
    <body>
    <script type="text/javascript">
    function checkIt(variable, value)
    var newScript = "cgi-bin/validateJS.cgi?"+variable+"="+value;
    var body = document.getElementsByTagName('body').item(0)
    var scriptTag = document.getElementById('loadScript');
    if(scriptTag) body.removeChild(scriptTag);
    script = document.createElement('script');
    script.src = newScript;
         script.type = 'text/javascript';
         script.id = 'loadScript';
         body.appendChild(script)
    </script>
    <p>Test.</p>
    <form id="f1" action="">
    <input type="text" name="t1" id="t1" onChange="checkIt(this.name, this.value)">
    </body>
    </html>
    validateJS.cgi
    #!/opt/x11r6/bin/perl
    use CGI qw(:all);
    my @valArray = split(/=/,$ENV{QUERY_STRING});
    print "Content-type: text/javascript\n\n";
    # myPass is the password
    $myPass = "foobar";
    if ("$valArray[1]" eq "$myPass")
    print "alert(\"Success!!\")";
    else
    print "alert(\"Failure!!\")";

  • How can i call a taskflow methode from backing bean ??

    Build JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660
    i like to call a Methode (taskflow) from backing bean!
    my bean code :
        public void imageLinkActionListner(ActionEvent actionEvent) {
            String              id      = actionEvent.getComponent().getId();
            int                 linkID  = Integer.parseInt(id.substring(4));
            DCBindingContainer  bc      = (DCBindingContainer)ADFUtils.getBindingContainer();
            DCTaskFlowBinding   tf      = null;
            System.out.println("Region Change...."+id+" INT "+linkID);
            switch (linkID) {
                case LINK_CALENDAR_REGION:
                    tf = (DCTaskFlowBinding)bc.findExecutableBinding("calendartaskflowPage");                   
                break;
                case LINK_MAIL_REGION:
                    tf = (DCTaskFlowBinding)bc.findExecutableBinding("mailtaskflowPage");                   
                break;
              case LINK_ADDRESS_REGION:
                  tf = (DCTaskFlowBinding)bc.findExecutableBinding("addresstaskflowPage");                   
              break;
              case LINK_BLOGS_REGION:
                  tf = (DCTaskFlowBinding)bc.findExecutableBinding("blogstaskflowPage");                   
              break;
              case LINK_MAPS_REGION:
                  tf = (DCTaskFlowBinding)bc.findExecutableBinding("mapstaskflowPage");                   
              break;
            default:
                return;
            if (tf != null){
                uiMainRegion.setRegionModel(tf.getRegionModel());
                uiMainRegion.setValue(tf.getRegionModel());
                tf.getExecutableBindings();
                AdfFacesContext.getCurrentInstance().addPartialTarget(uiMainRegion);
        }i like to call *#{backingBeanScope.mapBean.initMap}*
    my taskflow source
    <?xml version="1.0" encoding="windows-1252" ?>
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
      <task-flow-definition id="map-task-flow">
        <default-activity id="__1">map</default-activity>
        <view id="map">
          <page>/map/map.jsff</page>
        </view>
        <method-call id="initMap">
          <method>#{backingBeanScope.mapBean.initMap}</method>
          <outcome id="__7">
            <fixed-outcome>init</fixed-outcome>
          </outcome>
        </method-call>
        <control-flow-rule id="__2">
          <from-activity-id id="__3">initMap</from-activity-id>
          <control-flow-case id="__5">
            <from-outcome id="__6">init</from-outcome>
            <to-activity-id id="__4">map</to-activity-id>
          </control-flow-case>
        </control-flow-rule>
        <use-page-fragments/>
      </task-flow-definition>
    </adfc-config>

    Hi,
    to call the bean, use the EL in Java and reference #{backingBeanScope.mapBean.initMap} as a method expression. If you try and access the bean directly then chances are that the instance is not available. Using EL from Java always guarantees this
    Frank

Maybe you are looking for