PageDef operatingBinding is not visible or returning null

Hi,
I have an ADF application with taskflow which contains a page fragement which has some methodAction bindings in its pageDef.
I dragged this taskflow as a region in a Webcenter Portal application project page which has a pageTemplate. When that page opens, it opens fine by initializing the page which involves invoking some methodAction bindings.
After the page got loaded, I click on a button, this again requires methodAction bindings but this time that operationBinding is returning null. so, I am not able to invoke the method.
I am getting the operatingBinding in my managed bean as below. operatingBinding is fine while loading the page (init method) but it is giving null when I click on any button in the page after page load.
OperationBinding operationBinding = getBindings().getOperationBinding("getPersonId")
public BindingContainer getBindings() {
if(this.bindings == null){
FacesContext fc = FacesContext.getCurrentInstance();
this.bindings = (BindingContainer)fc.getApplication().evaluateExpressionGet(fc, "#{bindings}", BindingContainer.class);
return bindings;
I dragged the same taskflow to an other ADF application and it worked fine before and after loading the page. I do not understand why it is not working in portal application. But it is nothing to do with Webcenter I believe. I just wanted to know if anyone faced this issue before. Please give some pointers if you have any.
regards
Vinay Kumar

Page Definition is
*<?xml version="1.0" encoding="UTF-8" ?>*
*<pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel"*
version="11.1.1.59.23" id="SearchFragmentPageDef"
Package="com.johnlewis.cpl.wcportal.ui">
*<parameters/>*
*<executables>*
*<variableIterator id="variables"/>*
*<iterator Binds="PartnerHrchy" RangeSize="25"*
DataControl="PartnerSearchAMDataControl"
id="PartnerHrchyIterator"/>
*<iterator Binds="PartnerSearchTempVO1" RangeSize="25"*
DataControl="PartnerSearchAMDataControl"
id="PartnerSearchTempVO1Iterator"/>
*<searchRegion Binds="PartnerSearchTempVO1Iterator" Criteria=""*
Customizer="oracle.jbo.uicli.binding.JUSearchBindingCustomizer"
id="PartnerSearchTempVO1Query"/>
*</executables>*
*<bindings>*
*<methodAction id="getPersonId"*
InstanceName="PartnerSearchAMDataControl.dataProvider"
DataControl="PartnerSearchAMDataControl"
RequiresUpdateModel="true" Action="invokeMethod"
MethodName="getPersonId" IsViewObjectMethod="false"
ReturnName="data.PartnerSearchAMDataControl.methodResults.getPersonId_PartnerSearchAMDataControl_dataProvider_getPersonId_result">
*<NamedData NDName="uname" NDType="java.lang.String"/>*
*</methodAction>*
*<methodAction id="initPartnerSearch"*
InstanceName="PartnerSearchAMDataControl.dataProvider"
DataControl="PartnerSearchAMDataControl"
RequiresUpdateModel="true" Action="invokeMethod"
MethodName="initPartnerSearch" IsViewObjectMethod="false"
ReturnName="data.PartnerSearchAMDataControl.methodResults.initPartnerSearch_PartnerSearchAMDataControl_dataProvider_initPartnerSearch_result">
*<NamedData NDName="uname" NDType="java.lang.String"/>*
*</methodAction>*
*<methodAction id="searchPartnerTempTable"*
InstanceName="PartnerSearchAMDataControl.dataProvider"
DataControl="PartnerSearchAMDataControl"
RequiresUpdateModel="true" Action="invokeMethod"
MethodName="searchPartnerTempTable"
IsViewObjectMethod="false">
*<NamedData NDName="uname" NDType="java.lang.String"/>*
*<NamedData NDName="param" NDType="java.lang.String"/>*
*<NamedData NDName="leavers" NDType="java.lang.String"/>*
*</methodAction>*
*<tree IterBinding="PartnerHrchyIterator" id="PartnerHrchy">*
*<nodeDefinition DefName="com.johnlewis.cpl.wcportal.model.view.PartnerHrchy"*
Name="PartnerHrchy0">
*<AttrNames>*
*<Item Value="FullName"/>*
*<Item Value="Position"/>*
*<Item Value="LocationCode"/>*
*</AttrNames>*
*<Accessors>*
*<Item Value="PositionIdPartnerHrchy"/>*
*</Accessors>*
*</nodeDefinition>*
*</tree>*
*<tree IterBinding="PartnerSearchTempVO1Iterator" id="PartnerSearchTempVO1">*
*<nodeDefinition DefName="com.johnlewis.cpl.wcportal.model.view.PartnerSearchTempVO"*
Name="PartnerSearchTempVO10">
*<AttrNames>*
*<Item Value="PartnerName"/>*
*<Item Value="EmployeeNumber"/>*
*<Item Value="SecurityProfileName"/>*
*<Item Value="ResponsibilityName"/>*
*<Item Value="PositionCode"/>*
*<Item Value="LocationCode"/>*
*</AttrNames>*
*</nodeDefinition>*
*</tree>*
*</bindings>*
*</pageDefinition>*
Managed Bean code to invoke methodAction is
*public void myTimeCard(ActionEvent actionEvent) {*
*// Add event code here...*
String uname = null;
uname = ADFContext.getCurrent().getSecurityContext().getUserName();
System.out.println("User name is " + uname);
OperationBinding operationBinding = getBindings().getOperationBinding("getPersonId");
System.out.println("Before setting parameters");
System.out.println("operationBinding is " + operationBinding);
*if(operationBinding != null){*
operationBinding.getParamsMap().put("uname", uname);
System.out.println("After setting parameters");
String out = (String)operationBinding.execute();
System.out.println("After invoking method");
System.out.println("Person Id from getPersonId is " + out);
if(out != null)
personId = Long.parseLong(out);
System.out.println("Person Id of search is " + personId);
System.out.println("User name is " + uname);
ADFContext.getCurrent().getPageFlowScope().put("personId", personId);
ADFContext.getCurrent().getPageFlowScope().put("respId", null);
ADFContext.getCurrent().getPageFlowScope().put("type", "ess");
ADFContext.getCurrent().getPageFlowScope().put("userName",uname); //TODO username need to be passed from security Context
*}*

Similar Messages

  • FindNode returning Null And XML Not Accepting Special Characters

    Hi All,
    i am trying the get the attribute value in the element "ns4:InfoCFDi" using FindNode method, but the method is returning NULL. I used the same code for other sample as well and was successfull. but for this specific XML file(which is below) I am getting a Null.
    i can get till S:Body, but when i try to use FindNode for ":Body/s4:ResponseGeneraCFDi" I get Null value.
    And I used "S:Body/*[local-name()=" | "ns4:ResponseGeneraCFDi" | "]";
    as mentioned in other post but still no success.
    ==>I Have one more question relating to special characters. I need to use characters such as - ó in my XML to read as well as write. When I try to read i am getting XML parse error and when writing, i cannot open the file properly.
    Your help is much appreciated.
    My code is here:
    Local XmlDoc &inXMLDoc, &reqxmldoc;
    Local XmlNode &RecordNode;
    &inXMLDoc = CreateXmlDoc();
    &ret = &inXMLDoc.ParseXmlFromURL("D:\Agnel\Mexico Debit Memo\REALRESPONSE.xml");
    If &ret Then
    &RecordNode = &inXMLDoc.DocumentElement.FindNode("" );
    If &RecordNode.IsNull Then
    Warning MsgGet(0, 0, "Agnel FindNode not found.");
    rem MessageBox(0, "", 0, 0, "FindNode not found");
    Else
    &qrValue = &RecordNode.GetAttributeValue("asignaFolio ");
    Warning MsgGet(0, 0, "asignaFolio." | &qrValue);
    End-If;
    Else
    Warning MsgGet(0, 0, "Error. ParseXmlString");
    End-If;
    XML File:
    - <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
    - <S:Body>
    - <ns4:ResponseGeneraCFDi xmlns="http://www.xxl.com/ns/xsd/bf/rxx/52" xmlns:ns2="http://www.sat.gob.mx/cfd/3" xmlns:ns3="http://www.xx/ns/bf/conector/1&quo t; xmlns:ns4="http://www.xx/ns/xsd/bfxx/xx/32&qu ot; xmlns:ns5="http://www.xxcom/ns/xsd/bf/xxxxx&q uot; xmlns:ns6="http://wwwxx.com/ns/referenceID/v1">
    - <ns3:Result version="1">
    <ns3:Message message="Proceso realizado con exito." code="0" />
    </ns3:Result>
    - <ns4:InfoCFDi noCertificadoSAT="20001000000100003992" refId="STORFAC20121022085611" fechaTimbrado="2012-10-22T08:56:45" qr=" "
    uuid="a37a7d92-a17e-49f4-8e4d-51c983587acb" version="3.2" tipo="XML" archivo="xxx" sello="B8WjuhYLouSZJ6LU2EjxZ0a4IKyIENZNBx4Lb4 jkcAk6wA+EM477yz91/iDdsON0jm8xibBfom5hvHsH7ZK1ps3NnAXWr1LW 7ctmGsvYKAMvkCx/yOVzJTKFM2hN+OqCTE0WVfgv690vVy2CDQWKlMxbK+3idwG4t OKCMelrN9c=" fecha="2012-10-22T08:56:44" folio="281" serie="IICC">
    <InfoEspecial valor="Este documento es una representacin impresa de un CFDI." atributo="leyendaImpresion" />
    <InfoEspecial valor="||1.0|a37a7d92-a17e-49f4-8e4d-51c983587acb|2012-10-22T08:56:45|B8WjuhYLouSZJ6LU2EjxZ0a4IKyIENZNBx4Lb4 jkcAk6wA+EM477yz91/iDdsON0jm8xibBfom5hvHsH7ZK1ps3NnAXWr1LW 7ctmGsvYKAMvkCx/yOVzJTKFM2hN+OqCTE0WVfgv690vVy2CDQWKlMxbK+3idwG4t OKCMelrN9c=|20001000000100003992||" atributo="cadenaOriginal" />
    <InfoEspecial valor="Doscientos dieciocho mil cuatrocientos setenta y cinco pesos 00/100 M.N." atributo="totalConLetra" />
    </ns4:InfoCFDi>
    </ns4:ResponseGeneraCFDi>
    </S:Body>
    </S:Envelope>
    TIA

    First of all you have to supply a value you want to search for and this has to be the complete path to the value. You're saying you already tried that, but can you paste the code which you used for that? I don't see the path mentioned in the code you posted.
    *FindNode*
    Syntax
    FindNode(Path)
    Description
    Use the FindNode method to return a reference to an XmlNode.
    The path is specified as the list of tag names, to the node that you want to find, each separated by a slash (/).
    Parameters
    Path
    Specify the tag names up to and including the name of the node that you want returned, starting with a slash and each separated by a slash (/). This is known as the XPath query language.>
    Another option would be this snippet of code:
    &InfoCFDiArray = GetElementsByTagName("ns4:InfoCFDi");
    &InfoCFDiNode = &InfoCFDiArray [1];
    &attValue = &InfoCFDiNode.GetAttributeValue("noCertificadoSAT")
    Warning(&attValue);
    It creates an array of XML Nodes which match the name "ns4:InfoCFDi". Since there's only one in the XML it's safe to assume it will be the one and only node in the array. I've assigned that node to the variable &InfoCFDiNode and use that to retrieve the attribute "noCertificadoSAT" value. The warning message should display the value supplied there.
    Concering the special characters; you will have to change the encoding of the XML. Peoplecode sets this to UTF-8 by default, but doesn't include this in the header. There's a little hack for that somewhere on the web, I'll see if I can find it.

  • Request.getCookies() returns null, not 0 length array

    (reposted from J2EE forum)
    Just upgraded to 9ias with Embedded OC4J and we were getting a NullPointerException.
    Our previous calls to request.getCookies() AKA http://java.sun.com/products/servlet/2.1/api/javax.servlet.http.HttpServletRequest.html#getCookies()
    would return an an array of Cookie Objects or an array of zero length if there are no cookies.
    When we upgraded to 9ias, we got the NPE.
    Know why?
    OC4J implementation of HttpServletRequest doesn't return a zero length array, it returns a null object when there are no cookies!!!
    So we had to change our code to catch this.
    Not a big problem, and it's fixed now, but it was a problem nonetheless.
    Any reason/rationale for why this was done this way? Anyone? Bueller?

    Josh,
    According to Servlet Spec 2.3 (page 193) SRV 15.1.3.2 Methods for (HttpServletRequest SRV.15.1.3) getCookies() returns null if no cookies present. So we are compliant to the spec.
    regards
    Debu Panda
    Oracle That's strange that the NPE problem didn't occurr until deleting cookies on OC4J, then.
    Thanks for responding!

  • Graphics returning null in one place, but not another.

    If you want to compile and run my program.... you can get all the files here:
    http://s94182144.onlinehome.us/randomstuff/files.zip
    (The main classes you'll need to look at are DrawingCanvas, Trig and GraphEngine)
    Here's a visual just in case:
    http://s94182144.onlinehome.us/randomstuff/graph.jpg
    When I click the "Graph It" button, I'm sending all those variables in the window to another class. Except the method I need to call is passed Graphics g... and thus, I needed to create a graphics variable. But it's returning null.
    Here is my code in GraphEngine, which runs when a button is clicked. You'll notice for Graph It... I created a Graphics variable... this returns null. Except you'll also notice I do the same thing for "Clear"... but this works.
    NOTE: I was getting mad so I named some methods not so nicely :p .... you may notice they are different in my files.
         public void actionPerformed(ActionEvent e)
              userDisplay=e.getActionCommand();
              if(userDisplay.equals("Draw"))
                   String progChoice=grapher.graphType.getSelectedItem();
                   System.out.println(progChoice);
                   if(progChoice.equals("Lines"))
                        grapher.allButtons[0].enable();
                        draw();
                   else if(progChoice.equals("Scatter Plot"))
                        lineOfBestFit();
              else if(userDisplay.equals("Graph It"))
                   Trig.graphThisStuff();
                   Graphics g = canvas.getGraphics();
                   canvas.trig(g);
               else if(userDisplay.equals("Clear"))
                    Graphics g = canvas.getGraphics();
                   System.out.println(g);
                    canvas.clear(g);
            else if(userDisplay.equals("Reset"))
                Trig.restartThis();   
              else if(userDisplay.equals("Credits"))
                showInstructionsFrame();
            else if(userDisplay.equals("Help"))
                showHelpFrame();   
            else if(userDisplay.equals("Create Sinusodial Graph"))
                showTrigFrame();   

    1. Do you expect forum members to download and unzip your code? Good luck...
    2. Inside almost every "big" problem is a small one trying to get out. Write a minimal program
    demonstrating your problem (say <50 lines) and post that. The shorter code and the easier it
    is to copy, paste and run, the more forum members will actually give it a go.
    That being said, you problem is that you are using Component's getGraphics at all. Don't use it.
    It doesn't work very well -- they rendering you do is temporary, if you iconify and restore your
    window your changes will disappear (sometimes even moving another window past yours will do this!).
    What should you do instead? Put all your rendering code in paintComponent (or subroutines
    it calls). Changes in state of your app should trigger a call to repaint (or you will call it directly).
    Repainting will eventually cause your paintComponent to be called.

  • BufferedReader readLine() not returning null

    I'm trying write an SMTP client using Socket.
    I'm sending EHLO command to the SMTP server is is returning multiline response. When I tried to read this multiline response using the BufferedReader in a while loop, it is never returning null.
    Following is my code snippet
    while(true)
                    data=reader.readLine();
                    multilineData +=data+"\r\n";
                    if(data==null )
                        break;
                    }why it is not returning?

    I have written debug statements.
    It is printing the following lines and it still expecting something from the server even though server has finished sending all the response.
    250-mail.merakdemo.com Hello <hostname>, pleased to meet you.
    250-ENHANCEDSTATUSCODES
    250-SIZE
    250-EXPN
    250-ETRN
    250-ATRN
    250-DSN
    250-CHECKPOINT
    250-8BITMIME
    250-AUTH CRAM-MD5 DIGEST-MD5 LOGIN PLAIN
    250-AUTH=LOGIN
    250-STARTTLS
    250 HELP
    This is the end of response from server.
    And even I tried to break the while loop by checking the "HELP" String in the response. It is breaking the loop, but it is never returning the control.
    Following is the Code snippet:
    private String pullMultilineData(BufferedReader reader) throws CommunicationException
           String multilineData="";
           String data="";
            try
                while(true)
                    data=reader.readLine();
                    multilineData +=data+"\r\n";
                    // as per SMTP Protocol last line is without "-"
                    if(data==null || data.equals("") || data.indexOf("-")==-1)
                                        break;
                   logger.log(Level.DEBUG, "Data: "+data);
            catch(IOException ioe)
                logger.log(Level.ERROR, "I/O exception: "+ioe);
                throw new CommunicationException("unable to pull the respose, i/o error occured");
           return multilineData;
        }

  • Waveform not visible / showing in tracks returned from Audition

    I have a sequence I sent out to Audition to be edited. When I return it to Premiere, it produces a newly added track, but no wave forms are visible. Can't find how to turn them on or why they are not visible. Any suggestions?
    Thanks.

    With your Sequence active in the Timeline Panel...
    Try:
    Sequence > Render Audio

  • Return results from custom dialog box not visibly updating field value

    I have a form with custom dialog boxes (execDialog) for data entry. The dialog box is being called from the Entry event successfully. I also have it called from the Click event. So, here's what I get:
    1. On entering the field, I get the dialog box pop up, I select a value, it visibly changes the field raw value and leaves focus in the field.
    2. If I exit the field and re-enter, it also works as in point 1 (as expected)
    3. If, while focus is already in the field, I click in the field, I get the dialog box, as expected, but after selecting a value from the dialog, the field raw value DOES NOT VISIBLY change until I exit the field! It's kind of like the click event is working in conjunction with the Exit event. This is totally counter-intuitive for a production form that is being designed for the general populace.
    Anyone had any experience with this?
    Cheers,
    Marty.

    Thom Parker answered this here: http://forums.adobe.com/message/2614570#2614570
    Answer copied below:
    "The problem is that when the focus is on the text box
    it's in edit mode. It's only displaying the value interactively entered by
    the user, or as a consequence of the change event.  What you need to do is
    force the focus off of the text box in code.  You can do a little trick
    where you bounce it to a tiny transparent field, which then bounds the focus
    back so it doesn't look like the focus changed."
    What I ended up doing was calling up the dialog box, then using setfocus with no parameters to remove focus from the field, as follows:
    this.rawValue = this.dialogBoxFunction(this.rawValue); // passing current value so dialog box defaults to that value
    xfa.host.setFocus();
    Cheers,
    Marty.

  • Content OF  Panel Is Not Visible. Need Help

    Hi Guys,
    Can someone tell me why the contents of the "VisPanel" (JPanel) class is not showing up in the main window. I just don't understand why it is not visible after i add it to the main window.
    Here is the code. You can test it. Only the button shows up. The contents of "VisPanel" class is not visible.
    Replace the images in the "VisPanel" class with any image of your choice. I made them 130 X 130. I would have like to add the images in the post but i don't think it is possible to add images to post in this forum.
    public class TilesImage extends JFrame{
         private static final long serialVersionUID = 1L;
         public TilesImage(){
                this.setLayout(new GridLayout(2,1));
                this.setSize(600,600);
                this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                VisPanel vis = new VisPanel();
                JPanel pana = new JPanel();
                pana.add(vis);
                BufferedImage sub = vis.getImg().getSubimage(261, 260, 129, 129);
               JButton but = new JButton(new ImageIcon(sub));
               pana.add(but);
               this.add(pana);
               this.setContentPane(pana);
               this.setVisible(true);
               repaint();
           public static void main( String[] args ) {
                 new TilesImage();
                 //new VisPanel();
    class VisPanel extends JPanel{
          private static final int IMAGE_TYPE = BufferedImage.TYPE_INT_ARGB;
           private BufferedImage img;
          public VisPanel() {
                 // here you should create a compatible BufferedImage
                 //img = new BufferedImage( 450, 350, IMAGE_TYPE ); 
                 img = new BufferedImage( 525, 500, IMAGE_TYPE );
                     this.setSize(img.getWidth(), img.getHeight());    
                 final int NB_TILES = 4;
                 BufferedImage[] tiles = new BufferedImage[NB_TILES];
                 tiles[0] = createHorizontalRail( new Color( 255, 255, 255 ) );
                 tiles[1] = createVerticalRail( new Color( 255, 255, 255 ) );
                 tiles[2] = createCrossing( new Color( 255,   0, 255 ) );
                 final int[][] map = new int[][] {
                             {4, 4, 1},    
                               {4, 4, 1},
                               {0, 0, 2},
                               {4, 4, 4}, 
                 for (int i = 0; i < map[0].length; i++) {
                       BufferedImage tile = null;
                     for (int j = 0; j < map.length; j++) {
                          if(map[j] == 0){
                   tile = tiles[0];
                   for (int x = 0; x < tile.getWidth(); x++) {
              for (int y = 0; y < tile.getHeight(); y++) {
              img.setRGB( x + i * 130, y + j * 130, tile.getRGB(x,y) );
                   //img.setRGB( x + i * 45, y + j * 32, tile.getRGB(x,y) );
              } if(map[j][i] == 1){
                   tile = tiles[1];
                   for (int x = 0; x < tile.getWidth(); x++) {
              for (int y = 0; y < tile.getHeight(); y++) {
              img.setRGB( x + i * 130, y + j * 130, tile.getRGB(x,y) );
              if(map[j][i] == 2){
                   tile = tiles[2];
                   for (int x = 0; x < tile.getWidth(); x++) {
              for (int y = 0; y < tile.getHeight(); y++) {
              img.setRGB( x + i * 130, y + j * 130, tile.getRGB(x,y) );
         this.setVisible( true );
         private BufferedImage createHorizontalRail( final Color c ) {
         final Random r = new Random();
         BufferedImage img = null;
         try {
         img = ImageIO.read(new File("images/crossingsHorizontal.JPG"));
         } catch (IOException e) {
         return img;
         private BufferedImage createVerticalRail( final Color c ) {
         final Random r = new Random();
         BufferedImage img = null;
         try {
         img = ImageIO.read(new File("images/crossingsVertical2.JPG"));
         } catch (IOException e) {
         return img;
         private BufferedImage createCrossing( final Color c ) {
         final Random r = new Random();
         BufferedImage img = null;
         try {
         img = ImageIO.read(new File("images/railCrossing2.JPG"));
         } catch (IOException e) {
         return img;
         public void paintComponent(Graphics g) {
         g.drawImage(img, 0, 0, null);
              public BufferedImage getImg() {
                   return img;
              public void setImg(BufferedImage img) {
                   this.img = img;
    Thanks for your help.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    kap wrote:
    The "pana" panel must contain both the contents of the "VisPanel" panel and the button i created. So it is correct to set the contenPane to the "pana" panel. I tried to set the content pane to the "VisPanel" panel. It is visible but the button i added to the "pana" panel cannot be visible.
    I hope you understand what i mean here.He understands exactly what you mean and has pointed out your mistake and offered a decent solution. I suggest you take his advice and set the layout of pana not the JFrame.

  • Jdeveloper - GUI not visible in the visual design editor

    Hello everybody!
    Actually I'm designing a Java Desktop Application with javax.swing. using JDeveloper 11g Release 1 (Studio Edition Version 11.1.1.3.0, Build JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660), Java Platform 1.6.0_18 and Oracle IDE 11.1.1.3.37.56.60 on Linux.
    My question is related to JDevelopers visual design editor. Most of my forms extend javax.swing.JInternalFrame. Those forms are visible within the visual design editor but for some of my forms I had to create a subclass of JInternalFrame named ITMSInternalFrame.
    package itms.view;
    import javax.swing.ImageIcon;
    import javax.swing.JButton;
    import javax.swing.JInternalFrame;
    public class ITMSInternalFrame extends JInternalFrame {
        private MainWindow mainWindow;
        private JButton btnExit;
        protected static final ImageIcon ICOCOMMIT =
            new ImageIcon(ITMSInternalFrame.class.getResource("grafiken/commit-icon.png"));
        protected static final ImageIcon ICOROLLBACK =
            new ImageIcon(ITMSInternalFrame.class.getResource("grafiken/rollback-icon.png"));
        protected static final ImageIcon ICOINSERT =
            new ImageIcon(ITMSInternalFrame.class.getResource("grafiken/add-icon.png"));
        protected static final ImageIcon ICOUPDATE =
            new ImageIcon(ITMSInternalFrame.class.getResource("grafiken/page-edit-icon.png"));
        protected static final ImageIcon ICODELETE =
            new ImageIcon(ITMSInternalFrame.class.getResource("grafiken/delete-icon.png"));
        protected static final ImageIcon ICOUSER =
            new ImageIcon(ITMSInternalFrame.class.getResource("grafiken/user-icon-16x16.png"));
        protected static final ImageIcon ICOWAPPEN =
            new ImageIcon(ITMSInternalFrame.class.getResource("grafiken/wappen-icon.png"));
        protected static final ImageIcon ICOPRINT =
            new ImageIcon(ITMSInternalFrame.class.getResource("grafiken/printer-icon-16x16.png"));
        protected static final ImageIcon ICOPRINTPREVIEW =
            new ImageIcon(ITMSInternalFrame.class.getResource("grafiken/find-icon.png"));
        protected static final ImageIcon ICOITSET =
            new ImageIcon(ITMSInternalFrame.class.getResource("grafiken/folder-Options-icon-16x16.png"));
        protected static final ImageIcon ICOREALESTATE =
            new ImageIcon(ITMSInternalFrame.class.getResource("grafiken/real-estate-icon-16x16.png"));
        protected static final ImageIcon ICOBUILDING =
            new ImageIcon(ITMSInternalFrame.class.getResource("grafiken/building-icon-16x16.png"));
        protected static final ImageIcon ICOROOM =
            new ImageIcon(ITMSInternalFrame.class.getResource("grafiken/room-icon-16x16.png"));
        protected static final ImageIcon ICOPROCESS =
            new ImageIcon(ITMSInternalFrame.class.getResource("grafiken/process-icon-16x16.png"));
        public ITMSInternalFrame(MainWindow mainWindow, String title,
                                 String path) {
            this.mainWindow = mainWindow;
            this.setLayout(null);
            this.setTitle(title);
            setFrameIcon(new ImageIcon(ITMSInternalFrame.class.getResource(path)));
            this.addInternalFrameListener(this.mainWindow);
        public MainWindow getMainWindow() {
            return this.mainWindow;
        public JButton getExitButton() {
            btnExit = new JButton();
            btnExit.setIcon(new ImageIcon(ITMSInternalFrame.class.getResource("grafiken/home-icon.png")));
            btnExit.setToolTipText("Closes this window");
            btnExit.setActionCommand("Exit");
            btnExit.addActionListener(this.mainWindow);
            return btnExit;
    }The forms that extend ITMSInternalFrame are not visible within JDevelopers visual editor. It says "No GUI selected. Double click on an item in the Structure Window to see its GUI here" and in the UI - Log it tells me "Unable to instantiate live instance for btnExit; using placeholder object instead."
    I've used Google to find an answer and I've read certain tips about it in different forums but non of that used to help me. So please, does anyone of guys around here know what to do to solve this?
    I look forward to receiving your advice on this matter.
    Yours sincerely.
    Florian W.

    Hi,
    I remember GUI subclasses to be an issue in 10.1.3. Not sure this has been resolved. Best suggestion is to file a service request with support and have them looking at a test case
    Frank

  • The method clone() from the type Object is not visible

    Hi,
    This is my 1st post here for a few years, i have just returned to java.
    I am working through a java gaming book, and the "The method clone() from the type Object is not visible" appears, preventing the program from running. I understand "clone" as making a new copy of an object, allowing multiple different copies to be made.
    The error occurs here
    public Object clone() {
            // use reflection to create the correct subclass
            Constructor constructor = getClass().getConstructors()[0];
            try {
                return constructor.newInstance(new Object[] {
                    (Animation)left.clone(),
                    (Animation)right.clone(),
                    (Animation)deadLeft.clone(),
                    (Animation)deadRight.clone()
            catch (Exception ex) {
                // should never happen
                ex.printStackTrace();
                return null;
        }The whole code for this class is here
    package tilegame.sprites;
    import java.lang.reflect.Constructor;
    import graphics.*;
        A Creature is a Sprite that is affected by gravity and can
        die. It has four Animations: moving left, moving right,
        dying on the left, and dying on the right.
    public abstract class Creature extends Sprite {
            Amount of time to go from STATE_DYING to STATE_DEAD.
        private static final int DIE_TIME = 1000;
        public static final int STATE_NORMAL = 0;
        public static final int STATE_DYING = 1;
        public static final int STATE_DEAD = 2;
        private Animation left;
        private Animation right;
        private Animation deadLeft;
        private Animation deadRight;
        private int state;
        private long stateTime;
            Creates a new Creature with the specified Animations.
        public Creature(Animation left, Animation right,
            Animation deadLeft, Animation deadRight)
            super(right);
            this.left = left;
            this.right = right;
            this.deadLeft = deadLeft;
            this.deadRight = deadRight;
            state = STATE_NORMAL;
        public Object clone() {
            // use reflection to create the correct subclass
            Constructor constructor = getClass().getConstructors()[0];
            try {
                return constructor.newInstance(new Object[] {
                    (Animation)left.clone(),
                    (Animation)right.clone(),
                    (Animation)deadLeft.clone(),
                    (Animation)deadRight.clone()
            catch (Exception ex) {
                // should never happen
                ex.printStackTrace();
                return null;
            Gets the maximum speed of this Creature.
        public float getMaxSpeed() {
            return 0;
            Wakes up the creature when the Creature first appears
            on screen. Normally, the creature starts moving left.
        public void wakeUp() {
            if (getState() == STATE_NORMAL && getVelocityX() == 0) {
                setVelocityX(-getMaxSpeed());
            Gets the state of this Creature. The state is either
            STATE_NORMAL, STATE_DYING, or STATE_DEAD.
        public int getState() {
            return state;
            Sets the state of this Creature to STATE_NORMAL,
            STATE_DYING, or STATE_DEAD.
        public void setState(int state) {
            if (this.state != state) {
                this.state = state;
                stateTime = 0;
                if (state == STATE_DYING) {
                    setVelocityX(0);
                    setVelocityY(0);
            Checks if this creature is alive.
        public boolean isAlive() {
            return (state == STATE_NORMAL);
            Checks if this creature is flying.
        public boolean isFlying() {
            return false;
            Called before update() if the creature collided with a
            tile horizontally.
        public void collideHorizontal() {
            setVelocityX(-getVelocityX());
            Called before update() if the creature collided with a
            tile vertically.
        public void collideVertical() {
            setVelocityY(0);
            Updates the animaton for this creature.
        public void update(long elapsedTime) {
            // select the correct Animation
            Animation newAnim = anim;
            if (getVelocityX() < 0) {
                newAnim = left;
            else if (getVelocityX() > 0) {
                newAnim = right;
            if (state == STATE_DYING && newAnim == left) {
                newAnim = deadLeft;
            else if (state == STATE_DYING && newAnim == right) {
                newAnim = deadRight;
            // update the Animation
            if (anim != newAnim) {
                anim = newAnim;
                anim.start();
            else {
                anim.update(elapsedTime);
            // update to "dead" state
            stateTime += elapsedTime;
            if (state == STATE_DYING && stateTime >= DIE_TIME) {
                setState(STATE_DEAD);
    }Any advice? Is it "protected"? Is the code out-of-date?
    thankyou,
    Lance 28

    Lance28 wrote:
    Any advice? Is it "protected"? Is the code out-of-date?Welcome to the wonderful world of Cloneable. In answer to your first question: Object's clone() method is protected.
    A quote from Josh Bloch's "Effective Java" (Item 10):
    "A class that implements Cloneable is expected to provide a properly functioning public clone() method. It is not, in general, possible to do so unless +all+ of the class's superclasses provide a well-behaved clone implementation, whether public or protected."
    One way to check that would be to see if super.clone() works. Their method uses reflection to try and construct a valid Creature, but it relies on Animation's clone() method, which itself may be faulty. Bloch suggests the following pattern:public Object clone() throws CloneNotSupportedException {
       ThisClass copy = (ThisClass) super.clone();
       // do any additional initialization required...
       return copy
    if that doesn't work, you +may+ be out of luck.
    Another thing to note is that Object's clone() method returns a +shallow+ copy of the original object. If it contains any data structures (eg, Collections or arrays) that point to other objects, you may find that your cloned object is now sharing those with the original.
    Good luck.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Target Unreachable, 'firstField' returned null

    Hi everybody!
    Before I begin, I'm sorry but my english is bad.
    I'm using JDeveloper 11.1.1.3 to develop an application.
    My application is linked with database.
    I created a Train with 2 pages: In the first, you can fill out the form. And in the second, we see the data filled
    in the first, and there you can click a button to submit the form.
    Then I create a method in my class "TestServiceImpl.java" which is the method of application module. This method
    add a new row in a table in the database.
    And finally, I'd drag and drop this method in my "confirmationPage". The value of each field of this method is that
    of the corresponding fields the first page where the form was completed (example: # {} backingBeanScope.backing_firstPage.firstField.value).
    I have hidden filds so they are not visible to the user, and I left the button in this method visible (to create item).
    When I run the application, I fill the fields in the form, I click Next, I preview my form;
    BUT when I click on the button (which is the method that I have hidden filelds), I have the following error:
    Target Unreachable, 'firstField' returned null
    Any help is welcome.
    Thank's

    Yes, but it still seems that the value is null when the method attempts to retrieve it.
    Unless there is some other problem in your page or the bindings.
    If you were to try using pageFlowScope parameters, all that you would have to do would be to set the component values in the virst page equal to the pageFlowScope parameter it corresponds to
    something like this:
    <af:inputText id="var1"/>
    value="#{pageFlowScope.variable1}"
    />then you could get the values in the second page using #{pageFlowScope.variable1}.
    Gabriel.

  • Target unreachable "EmployeeId" returned null

    Hi all,
    My Jdeveloper version is 11.1.1.3.0
    I am Getting error while running my JSpx
    as "Target unreachable "EmployeeId" returned null.
    In the EO , i set Display Hint hide for the EmployeeId attribute.
    I dragged and Dropped this VO as table in My Jspx.
    in the Pagedef, Manually i entered the <Item value="EmployeeId" />, SincePage will have the item entry only for the display attribute in VO/EO.
    In Jspx, i added the "EmployeeId" as inputtext.
    After I run the JSPX, iam getting this error.
    But once when i changed Hide to Display for the EmployeeId in EO,
    It is working fine.
    May i know what is the reason for this error occur.
    Reg,
    Vini.

    When you set the Control Hints to Hide, the attribute which you have set is not exposed (i.e.. actually you are hiding it). Thats why you get the error
    Regards,
    Srindhi

  • Dynamic Declarative Component managed bean returned null

    Hi,
    In a project from an application a DDC component is defined. This component uses a managed/backing bean with view scope.
    Using this component inside this project is working fine. This component should be used in other view controller projects, and here where the problems are.
    This project(let's call it Common) is deployed as ADF Library jar, and used in the other V-C projects.
    The big problem is that the managed bean defined for the logic of this component is not 'reacheable'.
    (Another problem is that the attribute value is not seen as its EL expression but as string, for this i found a workaround.)
    In project Common the adfc-config.xml file:
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
      <managed-bean id="__4">
        <managed-bean-name id="__2">ExtendedShuttle</managed-bean-name>
        <managed-bean-class id="__1">com.xyz.portal.taskflow.common.extendedshuttle.ExtendedShuttle</managed-bean-class>
        <managed-bean-scope id="__3">view</managed-bean-scope>
      </managed-bean>
    </adfc-config>A part from component declaration:
          <af:table var="row" rowBandingInterval="0" id="ta"
                                  rowSelection="multiple" columnStretching="last"
                                  disableColumnReordering="true" fetchSize="-1"
                                  binding="#{viewScope.ExtendedShuttle.allItemsTable}"
                                  value="#{viewScope.ExtendedShuttle.allModel}"
                                  partialTriggers="::dc_cb5 ::dc_cb3"
                                  filterVisible="true"/>The root exception is :
    javax.el.PropertyNotFoundException: Target Unreachable, 'ExtendedShuttle' returned null
    This exception is throw on com.sun.faces.application.ApplicationImpl.createComponent when *#{viewScope.ExtendedShuttle.allItemsTable}* is evaluated.
    Caused By: javax.faces.FacesException: javax.el.PropertyNotFoundException: Target Unreachable, 'ExtendedShuttle' returned null
         at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:262)
         at javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:222)
         at javax.faces.webapp.UIComponentClassicTagBase.createFacet(UIComponentClassicTagBase.java:510)
         at javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:661)
         at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1142)
         at org.apache.myfaces.trinidad.webapp.UIXComponentELTag.doStartTag(UIXComponentELTag.java:70)
         at oracle.adfinternal.view.faces.taglib.UIXTableTag.doStartTag(UIXTableTag.java:41)
         at oracle.adfinternal.view.faces.unified.taglib.data.UnifiedTableTag.doStartTag(UnifiedTableTag.java:50)
         at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:50)
    Caused By: javax.faces.FacesException: javax.el.PropertyNotFoundException: Target Unreachable, 'ExtendedShuttle' returned null
         at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:262)
         at javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:222)
         at javax.faces.webapp.UIComponentClassicTagBase.createFacet(UIComponentClassicTagBase.java:510)
         at javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:661)
         at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1142)
         at org.apache.myfaces.trinidad.webapp.UIXComponentELTag.doStartTag(UIXComponentELTag.java:70)
         at oracle.adfinternal.view.faces.taglib.UIXTableTag.doStartTag(UIXTableTag.java:41)
         at oracle.adfinternal.view.faces.unified.taglib.data.UnifiedTableTag.doStartTag(UnifiedTableTag.java:50)
         at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:50)
    Caused by: javax.el.PropertyNotFoundException: Target Unreachable, 'ExtendedShuttle' returned null
         at com.sun.el.parser.AstValue.getTarget(AstValue.java:88)
         at com.sun.el.parser.AstValue.setValue(AstValue.java:133)
         at com.sun.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:255)
         at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:259)
    Can you help figure it out, why is not working or why the managed bean is not visible in other projects but only in the one where the component is defined?
    Thank you for your time,
    Bogdan
    ps: how can i format the source code, on this fourm?

    Hi Frank,
    Thank you for the answer.
    I must say i'm quite new with ADF technology and maybe my questions are silly.
    Here is a Quote from "Oracle Fusion Developer Guide - Building Rich Internet Application with Oracle ADF" by Frank Nimphius and Lynn Munsinger Chapter 15 page 498:
    "You build dynamic declarative components *instead* of tag library based declarative components, if component resuse is required *only within the application* that has the component defined."
    Maybe i misunderstand the meaning of application from this sentence, but i need this component in several ViewController projects from only one application (ADF application).
    Tag lib declarative component I would not like to have, since the (automtically) build process is not my responsability and it will take some time till is pinpointed, but still is a last resort.
    Anyway two things are strange:
    1. Why the component is still available in other projects(and the beans not)?
    2. Why when a binding variable (for example: of type FaceCtrlHierBinding) has the correct type in the declarative project and in the order projects is of type String and its value is the variable name?
    Example:
    <af:declarativeComponent ...
    AllItems="#{bindings.Action}"
    In project where the component is declared its value is an instance of FacesCtrlHierBinding and in the rest of the projects is of type String with value "Action".
    Once again thank you a lot,
    Bogdan

  • Problem with accessing dynamically created movie clips, returns null...

    Hopefully this is a stupid question with an easy answer, if my code is straight forward enough.
    I am using this snippet of code to create menu items, and then use the jCount variable below to give the clips an index number, like so (which seems to be working just fine):
    for(var j:Number=0;j<xmlSubMenuLength;j++){ 
        var mcSubMenuItem:mcSubMenu=new mcSubMenu();   
        addChild(mcSubMenuItem);    
        jCount++;   
        mcSubMenuItem.name = "mcSubMenuItem" + jCount;
        //traces out names correctly
        trace ("---------------------------------jCount NAME = "+ mcSubMenuItem.name);
        mcSubMenuItem.x=mcMenuHolder.x+20;
        mcSubMenuItem.y =mcMenuHolder.y;
        mcSubMenuItem.y+= nextBtnY;
        nextBtnY+=subtopicSpace;
        global_subi.text = String(jCount); //i see the proper count of 10 in the text field
    However, when I try to access the clips using this snippet:  
    for(var j:Number=0;j<Number(global_subi.text);j++)//
      trace("GLOBAL SUBI = "+ String(global_subi.text));  //traces out 10, which it should
      var scSubMenuItem:String = "mcSubMenuItem" + j;  
      var scSubContent:Object = this.getChildByName(scSubMenuItem);
      trace(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>scSubContent:Object = "+ scSubContent); //returns null!
    My last trace statement returns null. Can anyone see my error, or explain why I can't access my clips after they have been created?
    Thank you muchly,
    ~Chipleh

    Hi kglad,
    Thanks for the response.
    "it's not clear from the shown code that jCount is initialized." - I've posted the relevant code below, which shows that I'm initializing jCount.
    "and it's not clear why you don't use j instead of jCount in that for-loop" - j is used as loop for creating the subtopic movie clips within the i for-loop. So, for each topic in i for-loop, create a group of suptopics using the j for-loop. The j for-loop re-initiates j every time the length of the subtopics is reached(if that makes any sense) - i.e. topic1>subtopic 1,2,3,4 : topic2>subtopic>1,2 : topic3>subtopic1,2,3,4
    jCount is used to keep a running count of the total number of subtopcs created - i.e. per the example above, jCount will display 10.
    var topicSpace:uint=button_mc.height;
    var subtopicSpace:uint = button_mc.height;
    var nextBtnY:uint = 0;//whatever;
    var jCount:Number = 0;
    function createXMLMenu(menuLength:Number,itemName:XMLList):void{
         var navItemText:XMLList = itemName;
          for(var i:Number=0;i<menuLength;i++)
               var mcMenuItem:mcMenu=new mcMenu();        
               addChild(mcMenuItem); 
               mcMenuItem.btnTxt.htmlText = i+1 +". " +navItemText[i];  
               mcMenuItem.ivar = i;  
               mcMenuItem.name = "mcMenuItem" + i;  
               mcMenuItem.x=mcMenuHolder.x;
               mcMenuItem.y =mcMenuHolder.y;
              //kglad's addition
               mcMenuItem.y+= nextBtnY;
               nextBtnY+=topicSpace; 
               var subVar:Number = i;//mcMenuItem.ivar 
               //Submenu content
               var xmlSubMenuLength:Number = xml.sim.bodyText.page[i].subpage.length()
               var menuItemAttachment:MovieClip = MovieClip(mcMenuItem); 
               for(var j:Number=0;j<xmlSubMenuLength;j++)
                     var xmlSubPageNumber:XMLList = xml.sim.bodyText.page[subVar].subpage;
                     var subNavLinkNumber:Number = xmlSubPageNumber[j];
                     var subTitleText:String = xml.sim.bodyText.page[subVar].subpage.subNavItem[j];
                     var mcSubMenuItem:mcSubMenu=new mcSubMenu();
                     trace("mcSubMenuItem.ivar = "+ j+1);
                     var mc2Attach2:MovieClip = MovieClip(menuItemAttachment);
                     mcSubMenuItem.btnTxt.htmlText = j+1 +". " +subTitleText;   
                     mcSubMenuItem.ivar = Number(subVar);
                     mcSubMenuItem.jvar = Number(j);
                     addChild(mcSubMenuItem);
                     jCount++;   
                     mcSubMenuItem.name = "mcSubMenuItem" + jCount;
                     trace ("---------------------------------jCount NAME = "+ mcSubMenuItem.name);
                     mcSubMenuItem.x=mcMenuHolder.x+20;
                     mcSubMenuItem.y =mcMenuHolder.y;
                     //kglad's addition
                     mcSubMenuItem.y+= nextBtnY;
                     nextBtnY+=subtopicSpace;    
                     global_subi.text = String(jCount);
                mcSubMenuItem.lExtend.visible = false;  
    global_i.text = String(i);
    Then I try to access the clips like so:
    -The first for-loop access the topic movie clips, no problem, and traces out scContent correctly.
    -The second for-loop traces out null everytime, when I would expect it to be tracing out the names of the subtopic movie clips.
    function accessClips(){
         //This will access the topic movie clips
         for(var i:Number=0;i<Number(global_i.text);i++)
               var scMenuItem:String = "mcMenuItem" + i;
               var scContent:Object = this.getChildByName(scMenuItem);            
               trace(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>scContent:Object = "+ scContent);
         //This is supposed to access the subtopic movie clips
         for(var j:Number=0;j<Number(global_subi.text);j++)//
               var scSubMenuItem:String = "mcSubMenuItem" + j;
               var scSubContent:Object = this.getChildByName(scSubMenuItem);
               trace(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>scSubContent:Object = "+ scSubContent);
    Hope this makes sense, Chipleh confused. If the code is not clear enough, let me know and I'll try to further clarify.
    Thanks again,
    ~Chipleh

  • JComponet.getName() returning null

    I have various component. on JPanel.One of them is given some name using componet.setName("xyz").
    I have to perform Action in fousListener focuslost event depending on e.getComponent.getName()
    if (e.getComponent.getName()==null ) //do this
    else if (e.getComponent.getName().equals"xyz"l ) //do that.
    when component .getName() returns null I get null pointer exception and code with in "if" block never gets executed.
    how do I take care of null pointer exception here.Any help is greatly appreciated .Thanks in Advance

    JButton is not getting null anymore.But I run in to another issue
    This is my dummy code which I wrote to paste on forum .
    /* Requirement as soon as jtable looses focus Status btn text should become show Result and frame should be hidden but when status button is clicked toggling of frame should happen normal **/
    /** Problem
    when textFiled1 gains focus after  button2 has lost it  Frame doesnt hide if it was visible
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.FocusAdapter;
    import java.awt.event.FocusEvent;
    import java.awt.event.FocusListener;
    import java.util.ArrayList;
    import javax.swing.*;
    public class DummyCode extends JPanel implements ActionListener {
         JComboBox cBox;
         String[] cBoxOption;
         JButton button1;
         JButton button2;
         JToolBar jToolBar1;
         JFrame frame;
         boolean showFrame;
         private String newline = "\n";
         JTextField textField1;
         FocusListener listener;
         JTable tbl;
         public DummyCode() {
              textField1 = new JTextField();
              textField1.setColumns(10);
              button1 = new JButton("Search");
              button2 = new JButton("Status");
              button2.setName("BTNStatus");
              cBoxOption = new String[] { "A", "B", "C" };
              cBox = new JComboBox(cBoxOption);
              jToolBar1 = new JToolBar();
              showFrame = false;
              frame = new JFrame();
              tbl = new JTable();
              jbInit();
         void jbInit() {
              jToolBar1.addSeparator();
              jToolBar1.add(cBox);
              jToolBar1.addSeparator();
              jToolBar1.add(textField1);
              jToolBar1.addSeparator();
              jToolBar1.addSeparator();
              jToolBar1.add(button1);
              jToolBar1.addSeparator();
              jToolBar1.add(button2);
              jToolBar1.addSeparator();
              jToolBar1.addSeparator();
              jToolBar1.addSeparator();
              this.add(jToolBar1);
              frame.setContentPane(tbl);
              frame.setSize(400, 200);
              frame.setLocation(666, 500);
              button1.addActionListener(new java.awt.event.ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        button1_actionPerformed(e);
              button2.addActionListener(new java.awt.event.ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        button2_actionPerformed();
              textField1.addActionListener(new java.awt.event.ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        showFrame = false;
                        button1_actionPerformed(e);
              listener = new FocusAdapter() {
                   // when table looses the focus status button text should be "Show
                   // result" and
                   // and frame gets hidden
                   public void focusLost(FocusEvent e) {
                        if (e.getComponent() instanceof JTable)
                             if (e.getOppositeComponent().getName() == null) {
                             showFrame = true;
                             button2_actionPerformed();
              tbl.addFocusListener(listener);
         void button1_actionPerformed(ActionEvent e)
              loadsearchResults();
         // Toggle frame visisbility show /hide
         void button2_actionPerformed()
              if (!showFrame) {
                   frame.setVisible(true);
                   showFrame = true;
                   button2.setText("Hide Result");
              } else {
                   frame.setVisible(false);
                   showFrame = false;
                   button2.setText("Show Result");
         public void actionPerformed(ActionEvent e) {
         public void loadsearchResults() {
              frame.repaint();
              frame.setVisible(true);
              showFrame = true;
         private static void createAndShowGUI() {
              JFrame frame = new JFrame("ObjectSearch");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              DummyCode demo = new DummyCode();
              frame.setContentPane(demo);
              frame.setSize(800, 100);
              frame.setVisible(true);
         public static void main(String[] args) {
              javax.swing.SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        createAndShowGUI();
    }Based on above code I have following scenario
    "button2 " should toggle frame (show/hide) and change text of button2 accordingly
    button1 should bring the Jframe containing JTable
    whenever Jtable looses focus.It should hide frameand text of of button2 should become "showResult"
    But afte Button2 looses focus and TextField1 gains focus .Frame doesnt hide ?

Maybe you are looking for

  • Error while updating the Assignment details using 'hr_assignment_api'

    An exception message is thrown while updating the assignment details through 'hr_assignment_api.update_emp_asg'. The message is 'ORA-20001: HR_FLEX_VALUE_MISSING: N, COLUMN, ASS_ATTRIBUTE6, N, PROMPT'. Even though a valid value is being passed to the

  • URL issues?  Can't figure this out

    OK, I'm a bit frustrated here. I've created an enhanced podcast using Podcast Maker (made by Lemonz Dream). I have uploaded it to my server (hosted by GoDaddy.com) I submitted my feed to iTunes and it was accepted. I am able to subscribe to it and it

  • Need some help archiving and photos that are in multiple collections.

    After creating a new catalog for photos from a collection, I'd want to remove the photos from Lightroom and keep on disk.  In the collection, there are some photos that are in multiple other collections and I'd want to keep those images in their othe

  • How can I remove adobe reader x?

    I hate this version I want 9 back but want to remove X first. Heaven forbid Adobe have an uninstall. Is it as simple as trashing the Application form the applications folder?Is there anything else to trash? Thanks, Marcantonio

  • Installing soa

    Can someone help me to install Pre-built Virtual Machine for SOA Suite and BPM Suite 11g ?