Component isVisible method behaving wierdly

Hi folks,
Build JDEVADF_11.1.1.4.0_GENERIC_101227.1736.5923
I have a page which has a region (taskflow) in it. Inside this region there are 2 other regions (say r1 and r2). Inside r2, I have a component whose visibility is set using EL expression pointing to a pageFlowScope entry as
visible="#{pageFlowScope.backingBeanHelper.lastName}" I want to get the visibility of all the components on the screen. So I took the parent element and iterate over its children. When I get the above component as part of the iteration and I call the isVisible() method for it, it returns me false even though it is displayed on the screen. I am not sure why it is returning a false value. If it was an issue with the pageFlowScope not having the backingBeanHelper, then it should have thrown an exception. I have double checked that backingBeanHelper.lastName always returns true.
What might be the issue?
Thanks
Vishal

What does your profiler say?
Have you included the cost of this line? Its a common mistake to overlook the cost of debug lines.
Log.debug("Time taken to record drop for DEBIT " + record + " Millis " + time);

Similar Messages

  • Your help needed: sychronized method behaving wrong

    //sychronized method behaving wrong:
    /*expected synchronized output:
    Thread-x: begin
    Thread-x: end
    Thread-y: begin
    Thread-y: end
    /*actual un-synchronized output:
    Thread-x: begin
    Thread-y: begin
    Thread-x: end
    Thread-y: end
    //what's wrong with the following code snippet about sychronized method? Thx!
    class Test implements Runnable {
         public void run() {
                   doo();          
         private synchronized void doo() {
              System.out.println(Thread.currentThread().getName() + ": begin");
              try { Thread.sleep(new java.util.Random().nextInt(10));} catch (Exception e) {}
              System.out.println(Thread.currentThread().getName() + ": end");     
         public static void main(String[] args) {
              Test[] tests = new Test[10];
              Thread[] tt = new Thread[10];
              for (Test test:tests) new Thread(new Test()).start();
    }

    oops! changing the thread initialization has sloved the problem, cauz synchronized method applies to the same object executing multiple threads.
    ...main...{
    Test t = new Test();
    for (int i=0;i<10;i++) new Thread(t).start();
    }

  • How to call Custom or Component Controller methods from View Controller

    Hy Guys,
    how do I call Custom Controller or Component controller methods from a View or Context Controlller?
    thanks in advance
    Jürgen

    Hi Juergen
    Yes it is possible, pls follow the below approach to access the component controller in context node class
    1) since the standard component controller class is protect variable , declare a variable of type component controller in your controller class.
    say for example the public variable you declared is  g_comp_controller
    2)  now redefine the controller class method WD_CREATE_CONTEXT  and add the below lines of code
       g_comp_controller ?= me->comp_controller.
    3) go to context node class  (CNXX)  there declare the varaible which of type controller class (IMPL)  as public variable, for example g_owner
    4) redefine the method  IF_BSP_MODEL~INIT  and write the below code
         CALL METHOD super->if_bsp_model~init
        EXPORTING
          id    = id
          owner = owner.
      g_owner ?= owner.
    5) now the variable   g_owner  that is declared in  (CNXX)   contains reference to your controller class
    6) in  on_new_focus  method access your component controller in the below manner and access the entities also.
    DATA: lv_owner                    TYPE REF TO xxxxx_impl,  " Implementation class
                 lr_comp_cont                TYPE REF TO xxxx_bspwdcomponen_impl, " component controller class
                 lv_entity type ref to cl_crm_bol_entity.
    lv_owner ?= g_owner.
    lr_comp_cont    ?= lv_owner->g_comp_controller.
    IF lr_comp_cont IS BOUND.
       lv_entity ?= lr_comp_cont->typed_context->mdfcampaign->collection_wrapper->get_current( ).
    now lv_entity contains the value of component controller context node.
    Thanks & Regards
    Raj
    Edited by: bmsraj on Sep 27, 2011 3:28 PM

  • Error in Component Api  Method

    Hi ,
    I getting a error in component Api method.
    Error : The method WDGetContext() is undefined for the type IPrivateDCFAppView
    SO, any body help me out in this regard why this one is happening.
    Thanks,
    William

    Hi,
    Are you trying to access the component controller's context from your view? check if you have added the component controller reference in the "properties" tab of the view.
    Regards,
    Poojith MV

  • Calling view controller method from component controller method

    Hi,
    Is there any way to call view controller method from component controller method?
    Thanks,

    Hi Khandal.
    You should not make you component controller dependent from a view controller.
    But what you can do is to define an event in the component controller. The view
    controller can register for this event.
    In the stage where you currently want to call the view controller method just fire
    the event. In the event handler method in the view controller you can call the
    method then.
    Why do you need to call a view controller method? Can you give more details
    about the scenario?
    Cheers,
    Sascha

  • Component repaint() method changed?

    Did the Component repaint() method used to clear the Component pane as well as painting it again?
    I ask because I think my textbook is assuming that repaint() clears the pane and then paints again but when I implement the code that I've written, I see all previously painted objects.
    Thanks.

    The job of repaint is just to queue a request for the repainting of the object. It sounds like the problem is in your actual painting code. You also haven't said what framework you are using? AWT? Swing? SWT?
    In Swing, you typically override paintComponent like so:
    @Override protected void paintComponent(Graphics g) {
         super.paintComponent(g);
         //do you painting here:
    }The call to super.paintComponent is what clears the component.
    In future, Swing questions should go tot the Swing forum: [http://forums.sun.com/forum.jspa?forumID=57]

  • Passing text component to methods

    I have a method that reads a file and output puts it to a JTextArea. Everything is working fine but I am wondering if I can pass an object from a class above JTextArea (like TextComponent). Looking for a generic feel with whatever text based component I passed...will this make a difference with lightweight and heavyweigth components (swing vs. awt)? Or even streams for that matter? Will byte and character streams act differently?
    What is the super class of all text based gui components?
    What is the super class of all streams?
    Yes I have read the java api doc on streams and using swing! Thanks

    You have me until
    Everything is working fine but I am wondering if I can pass an object from a class above JTextArea (like TextComponent).What are you asking for here?
    You want to know if you can pass an object to a method? Yes.
    You want to know if you can modify a class further up in JTextArea's hierarchy, so it has a method that passes an object to another method? Yes, by extending it and implementing the functionality you want.
    Looking for a generic feel with whatever text based component I passed...will this make a difference with lightweight and heavyweigth components (swing vs. awt)?Not sure what you were asking for in the first place, so I'm unable to help you with this one.
    Or even streams for that matter? Will byte and character streams act differently?If you're asking, "When I pass a stream through a method, will it act differently when I use it inside that method?", then I can answer no, it will not. You are passing your stream by reference.
    class MyClass {
       private Object anObject;
       public MyClass() {
          anObject = new Object();
          MySecondClass secondClass = new MySecondClass(anObject);
    class MySecondClass {
       private Object theSameObject;
       public MyClass(Object argument) {
          theSameObject = argument;
    }In the above example, anObject was created in MyClass, and passed to the constructor of MySecondClass. The field theSameObject in MySecondClass is set to point to the Object passed into its constructor, which just happens to be the Object anObject created in MyClass. anObject was created in MyClass. theSameObject is essentially the exact same Object in that it references (points to) anObject.
    If I'm wrong feel free to call me on it, java gurus.
    What is the super class of all text based gui components?AWT or Swing?
    If it's AWT, look up the API for an AWT text component, try TextField, and look at the class hierarchy.
    If it's Swing, do the same for JTextField. You can easily do some detective work and figure out the super classes of 'text based gui components'.
    What is the super class of all streams?You can do the same as above for streams as well.
    Yes I have read the java api doc on streams and using swing! ThanksIf you've read the API docs on streams and Swing, then why did you ask the last two questions? Not trying to offend, it just seems kind of wierd.

  • Cross-component: Call method of using component from within used component?

    Hi,
    I began diving into cross-component programming.
    Meanwhile after having digged into some scenarios some questions came up to my mind that I am not able to answer myself. I would appreciate your help here!
    Say we have to components.  Comp A uses Comp B (hence, B is a component usage in A)
    1) How to make them communicate not on a data level (via context binding) but on a process level, thus...
    a) can I call A's method from within B? How is the approach on a general level? - as B can be used from totally different components (like A, A1, A2 ...)
    b) perhaps the only way to do this is by firing events? If so, how can I react in A when an event in B (marked as interface event) gets fired? As it seems they do not get registered within A directly...
    I guess the question seems to be a bit tricky. Nevertheless, I think there will be plenty of you out there who used to asked them the same questions before and came up with an approach. Would be nice to hear from you.
    Best wishes,
    Marc @sap1

    Hi,
    thanks for your reply!
    Indeed, I think the nature of WDA would be just to somehow map the context from the used component to the other back and forth.
    Nevertheless, what if I would like to invoke a method of the using component from inside the used component.
    One sample for this requirement could be e.g.:
    Component B offers a tree item and a send/verify button.
    Component A uses B and has some restraints regarding what the selection should look like.
    The user taps the button in B (at runtime in the view container of A), the context gets updated in A and B and in Component A the verifyWithOwnConstraints() method gets called (through B).
    Thanks again,
    Marc

  • WD ABAP: call dialog window from component controller method

    Hi all,
    I need to call a dialog box from a method in the component controller. It would be helpful if u could post the code too.
    Thanks,
    Sravanthi

    Hi Maksim,
    this is the code i wrote:
    DATA: api_component  TYPE REF TO if_wd_component,
          window_manager TYPE REF TO if_wd_window_manager.
    api_component = wd_this->wd_get_api( ).
    window_manager = api_component->get_window_manager( ).
    wd_this->window = window_manager->create_window(
               window_name = 'OPTIONWD'
               close_button = abap_false ).
    wd_this->window->open( ).
    When i test it, this is the error i get.
    "An Instance of the View OPTIONWD Already Exists in the Component"
    how do i correct it?
    Thanks,
    Sravanthi

  • Calling Component controller method in webdynpro

    Hi All,
    Is it possible to call a method from component controller to view controller?
    Regards,
    Sasikala

    yes it is possible.
    hope this would help you
    http://help.sap.com/saphelp_nw70/helpdata/en/3b/29933f09a5fb47e10000000a114084/content.htm
    Regards,
    nag

  • Call component controller method from view

    Hi
    I have created an action in view Thus its event handler is "OnActionDoSomething()"
    And, I have a method in component controller "MethodSaySomething()".
    Now, how can I call MethodSaySomething() from OnActionDoSomething().
    OnActionDoSomething()
    // Call  MethodSaySomething() defined in component controller
    Thanks

    Hi,
        To access the methods present in component controller from View , first u need to add the component controller as the required controller.
    open the view controller --> switch to propertues tab --> add the component controller as required controller(click add controller).
    Now in your action handler , write this below code to add the method:
    wdThis.wdGet<COmponent Controller>().MethodSaySomething();
    Hope it helps
    Thanks and Regards,

  • Component calling methods on another component

    I have 2 components: Repository, and Document. A repository
    has an array of documents in variables scope. In each component I
    use the init() method to return an instance of the object. When a
    repository object is inited it generates a query of the documents
    that it contains, and loops through that, calling document.init()
    on each one and adding the resulting document object to the array.
    When I init() a repository and use CFDUMP to view its
    documents array, I get an array of the correct length containing
    document objects. However, when I try to loop through the array and
    call a method like getTitle() on each document, I get empty
    strings. When I init() a document on its own, getTitle() works
    fine. Is there something basic that I'm forgetting here?
    Let me know if you need to see the more code.
    Don Zacharias
    Sacramento, CA

    In the Repository's init() method:
    <cfloop query="qDocuments">
    <!--- create empty document object --->
    <cfset document =
    createObject("component","Document").init(qDocuments.id)>
    <!--- add empty document to array --->
    <cfset arrayAppend(variables.documents,document)>
    </cfloop>
    In the front end
    <!--- show documents for this repository --->
    <cfset arr_documents = repository.getDocuments()>
    <cfloop from="1" to="#arrayLen(arr_documents)#"
    index="i">
    <cfset doc =
    createObject("component","/docmanager_v2/components/Document")>
    <cfset doc = arr_documents[ i ]>
    <cfoutput>Title: #doc.getTitle()#, Summary:
    #doc.getSummary()#, Keywords:
    #doc.getKeywords()#<br></cfoutput>
    </cfloop>
    Now I'm doing createObject twice but I guess that makes
    sense... I wish I knew the principle at work here though...

  • Cannot execute custom component.:Method not found error

    Hi,
    I have created a custom component. When i execute the component i am getting error message :"Unable to execute service ABC and function XYZ." The service method XYZ is not defined.
    intradoc.data.DataException: !csMethodNotDefined,XYZ
    Where else i have to define my method in component wizard?
    Please provide inputs
    Thanks in advance

    If you haven't done it yet, get a copy of the Bex's book http://www.amazon.com/Definitive-Stellent-Content-Server-Development/dp/1590596846
    The chapter 10 will explain how a service, and its methods are bound to Java package whose classes extend the standard interfaces.

  • Thread behaves wierdly.. takes more time for less code...

    Hi everyone,
    I am stuck into this probel very badly..i have never seen such a problem before..Thread bottleneck somewhere is the issue i guess,,, plz have a look at the code patiently.. and do reply.. u guys are my last hope on this thing..Thank YOU...
    The Bank method is called by another method which runs 50 threads , so at a time 50 threads could enter this method to record Debit...
    class BankHelper {
    // Some code of bank.. not relevant to my problem public Bank() {
    long time = System.nanoTime();
    abc.recordDebit(); // want to measure how much time this method takes
    abc.recordTimeForDebit(System.nanoTime() - time); // accumulating the total time the above method takes to calculate
    class abc {
    // Some code of bank.. not relevant to my problem
    public synchronized void recordDebit(){
    debit++;
    } // I had put timers aound the ++ and it took not more than 700 to 900 nanoseconds
    public synchronized void recordTimeForDebit(long time){
    record += time;
    Log.debug("Time taken to record drop for DEBIT " + record + " Millis " + time);
    }Answer:
    Record time is 9014 millis for 5000 increments or 5000 calls to recordDebit()
    One can see in the answer that its a huge number when one is expecting it to be somewhere around:
    EXPECTED ANSWER:
    5000 * 800 nanos( it takes 800 nanos for very increment) = 4000000 = 4 millis and its like 9014 millis
    How is there such a huge difference ????????? I have bruised thorugh it for like 3 days... i have lost all my hope.. Plz help..Also look at the next code..
    When i go to see in the log .. it shows me that every record took like from 2000 nanos to 6 to 7 millis i.e.7000000...
    HOw is this even possibly possible ??? where did it get all this extra time from...it should not be more than some 700 to 900 nanos ..
    Is there a bottleneck somewhere ????
    Now part 2:
    This thing has fazzed, dazzled , destroyed me.. I could not understand this and it has tossed all my concepts into the cupboard..
    Same stuff: JUST HAVE A LOOK AND ENJOY AND TELL ME WHATS GOING ON...Same code.. different way of incrementing data i.e synchronization is at a different place..but results are very highly improved...
    class BankHelper {
    // Some code of bank.. not relevant to my problem
    public Bank() {
    long time = System.nanoTime();
    abc.recordDebit(); // want to measure how much time this method takes
    abc.recordTimeForDebit(System.nanoTime() - time); // accumulating the total time the above method takes to calculate
    }The Bank method is called by another method which runs 50 threads , so at a time 50 threads could enter this method to record Debit...
    class abc {
    // Some code of bank.. not relevant to my problem
    public void recordDebit(){
    someotherclass.increment();
    } // this is not synchronized nowwwwwwww
    // I have put timers here too and it took like 1500 to 2500 nanos
    public synchronized void recordTimeForDebit(long time){
    record += time;
    Log.debug("Time taken to record drop for DEBIT " + record + " Millis " + time);
    class someotherclass{
    // Not relevant code
    public void increment(){
    someotherclass1.increment1();
    class someotherclass1{
    // Not relevant code
    public void increment1(){
    someotherclass2.increment2();
    class someotherclass2{
    // Not relevant code
    public synchronized void increment2(){
    someotherclass3.increment3();
    } //now its synchronized
    class someotherclass3{
    // Not relevat code
    public synchronized void increment3(){
    debit++;
    } //now its synchronized
    }ANSWER: Record is 135 millis for 5000 increments or 5000 calls to recordDebit()
    Expected time was : 5000 * 2500 = 125000000 = 125 millis (WOW .. AS EXPECTED)
    Please don't ask me why this code has been written this way..i know it goes and increment and does the same thing...but somehow when i measured it..
    overall time or the accumulated time for both codes varied like in huge numbers...even though latter code is actually a superset of previous code..
    HOW IS THERE SUCH A HUGE DIFFERENCE BETWEEN THE NUMBERS ???
    COULD BE BECAUSE OF THE POINT OF SYNCHRONIZATION ???
    Thank you..for going through all this..

    Triple post - http://forums.sun.com/thread.jspa?threadID=5334258&messageID=10438241#10438241

  • How to call Visual Basic Component's method (DLL)in Java

    Hi people ,
    I need to make calls to methods from a dll . Why ? because the main project is in java and I am a java developer . This dll is the API of an other system that we need to access .
    I have searched this on google as you normally do . I found Jacob and some examples using javah . But all the references are old . The latest file I downloaded (version 1.5) was written in 2004 .
    Like wise all the results I get on google are old like from 2000 and even 2001 . What are standard practices for this now a days . The dll is written in Visual Basic .
    Any help will be appreciated .

    mycoffee wrote:
    Shahzeb wrote:
    Hi people ,
    I need to make calls to methods from a dll . Why ? because the main project is in java and I am a java developer . This dll is the API of an other system that we need to access .
    I have searched this on google as you normally do . I found Jacob and some examples using javah . But all the references are old . The latest file I downloaded (version 1.5) was written in 2004 .
    Like wise all the results I get on google are old like from 2000 and even 2001 . What are standard practices for this now a days . The dll is written in Visual Basic .
    Any help will be appreciated .That is history
    Why do you need a method in VB? everything vb can do, java can do better :JK
    Need more information to know what are you going to doWell that's an invain argument but I agree in principle .
    That DLL is not my code , it is api for some other application that we need to access . A system written by some other company whose API is exposed to us in a DLL . I need to use that simple as that .

Maybe you are looking for