Component requestFocus question?

Hello,
I have components arranged in different panels and panels arranged in
tab pane.I have framework for validating component values after confirming the changes and if an invalid value is found i popup error message and then call the invalid component's method requestFocus()I want to know how to make JTabPane to select the invalid component's panel when I call requestFocus method if it is not current panel?
Is this possible?
Thanks in advance.

1. Add a FocusListener to the component
2. Inside focusGained(), check to see if the Component isShowing()
3. If isShowing() returns false, instruct the JTabbedPane to select the appropriate panel.
If you don't have access to the JTabbedPane, you can recursively find the Component's parent until you get to it.
There are probably better ways, but I think this should work.
HTHs,
Jamie

Similar Messages

  • Business component representation - question

    Hello, I'm trying to create objects in ID for a scenario where in we receive EDI documents from external customers and we convert few of them in to files and ftp it to a location. (location is internal to the company).
    I already have two parties one representing the EDI customers and the other representing my company... can I create a business component(service) underneath the party of my company representing the file processor (instead of  creating it separately without party)?
    If so, how can I model this in the integration scenario to create objects in the ID.
    If I represent the EDI(sender) party as third party(external party with B2B communication)...I can assign the party and service to it..
    On the received side I'm not able to select the business component I created to represent(couldn't assign) the receiver..the system always expects a business system..
    how this could be handled?
    Please advise. Let me know if you have any further questions.
    Larry.

    Hi Harish,
    Technically I do not get an error but I'm not even allowed to select a business component while implementing my model in ID. I selected a party and service to assign it to the sender application component(Third party EDI) ..but for the receiver(file service) I got an option only to identify it as business system and business components are not even available for selection (this is while applying my model in ID)..Also I'm not sure if it fits a perfect B2B or A2A scenario as it involves a third party EDI(external) and an internal file service location different to be identified as my own company(party)..I just can use it as service without party and forget about modelling as it's not mandatory...but just wanted to see the usual way of handling this scenario..
    Thank you.
    Please advise.
    Larry.

  • Cfinvoke component argument question

    cfnewbie here...
    I want to invoke a method in a CFC file - I am not clear from
    the docs. how to construct the component argument. If using the
    filepath structure below, for example, where am I supposed to
    start? what should "directory" be? the root folder of the server?
    <cfinvoke
    component="directory.subdirectory.subdirectory2.cfc_filename"
    method="method_name"
    returnvariable="whatever">
    </cfinvoke>
    Thanks!

    Thanks Ted. I am looking at the " Registered CFX Tags" area
    in CFAdmin MX6.1 and I do not see it, should it be there?
    Again thanks for answering such dumb questions... the person
    who supported CF is no longer with our company so I'm stuck with
    it.

  • Please some HELP,  Component requestFocus()

    hi guys,
    i have two JTextFields calling from and to!
    JTextField from = new JTextField();
    JTextField to = new JTextField();
    if(from != null){
    from.setText("blabalbl");
    to.requestFocus(); // focus next Componet (JTextField to)
    else
    if(to != null){
    to.setText("blalbblalbla");
    // now i want to focus next Component, maybe on a JComboBox or another JTextField but it
    //doesn`t work
    java.awt.Component comp = getNextFocusableComponent();
    comp.requestFocus();

    Focus order depends on the order in which components are added to their parent container. If you wish to change the order, you must either use a FocusManager or you can use a FocusLost listener to know when the user leaves one field so you can request focus to some other field.

  • Migrate from XI 3.0 to PI 7.11 software component version question

    Hi,
    We are migrating from XI 3.0 to PI 7.11. there are about 2000 receiver determination, etc.
    We have to assign for every receiver determination, interface determination etc a new software component version.
    does anyone know how to do this automaticly.
    regards meinhart

    The SWVC in receiver determination is not relevant for service interfaces of type "XI 3.0 compatible".
    So you can leave the fields emtpy.
    The technical background for this SWVC in receiver determination is finding the correct operation for a message.
    But XI 3.0 compatible service interfaces have only one operation with same name as the interface.

  • Dynamic Component Creation Question

    I have a process that looks up fields names from a database. I then loop through and create HtmlInputText components dynamically. The question I have is how do I create a value binding to these components? I have been trying to think of a way to create a separate class that can be applied to each field name I retrieve from the database. But I just can't think of a good solution for this. I assume people have had to do this before.
    Thanks

    Let it bind to a List<String> or Map<String, String>. To get/set elements in a List you can use the brace notation, e.g. #{list[0]} for the 1st element (list.get(0)). For map you can use the key name as propertyname, e.g. #{map.key} for the entry associated with key "key" (map.get("key")).

  • MXML Component State Question

    Hey guys,
    I am trying to simplify my code and break out different parts of the app into different MXML Component files.  I have taken my login info and created the LoginScreen.mxml file which calls the doLogin function in its (parent) mxml file FlexCMS.  It properly sets the state to 'LoggedIn' but then the LoginScreen.mxml file doesnt hide...
    Any ideas?
    <!-- FlexCMS.mxml file -->
    <s:states>
              <s:State name="Login" />
              <s:State name="LoggedIn" />
         </s:states>
    <fx:Script>
              <![CDATA[
    public function doLogin($username:String, $password:String):void {
                        loginResult.token = customUserClass.login($username, $password);
                   protected function loginResultEvent(event:ResultEvent):void {
                        //Alert.show(event.result.toString(), 'loginResult');
                        trace(event.result.toString());
                        if (event.result == true) {
                             currentState = 'LoggedIn';
                        trace('currentState: ' + currentState);
         ]]>
         </fx:Script>
    <components:LoginScreen includeIn="Login" />
    ... More code for rest of app that hasnt been broken out to other mxml files yet
    <!-- LoginScreen.mxml -->
    <?xml version="1.0" encoding="utf-8"?>
    <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:local="*">
         <s:layout>
              <s:BasicLayout/>
         </s:layout>
         <s:states>
              <s:State name="Login" />
              <s:State name="LoggedIn" />
         </s:states>
         <fx:Declarations>
              <!-- Place non-visual elements (e.g., services, value objects) here -->
         </fx:Declarations>
         <fx:Script>
              <![CDATA[
                   private var flexCMS:FlexCMS = new FlexCMS(); //get reference to main class
                   protected function loginClick(event:MouseEvent):void {
                        flexCMS.doLogin(username_txt.text, password_txt.text);
              ]]>
         </fx:Script>
         <s:Panel height="140"
                    horizontalCenter="0"
                    title="Login"
                    includeIn="Login"
                    verticalCenter="0"
                    width="250">
              <s:TextInput id="username_txt" text="testuser" width="151" x="87" y="10" />
              <s:TextInput id="password_txt" text="test" width="151" x="87" y="40" />
              <s:Label fontSize="14" text="Username:" x="10" y="10" />
              <s:Label fontSize="14" text="Password:" x="10" y="44" />
              <s:CheckBox label="Remember Me" x="10" y="68" />
              <s:Button click="loginClick(event)" id="login" label="Login" x="168" y="69" />
              <!-- <local:FlexCMS -->
         </s:Panel>
    </s:Group>

    I did something similar in the past for a few of my apps.
    The login screen was a custom TitleWindow component that contained the normal username field, password field and login button and could communicate with the server for authentication purposes. If the authentication was successful then I'd call the PopUpManager's removePopUp method on the login window and change the current state to the authenticated state.

  • Component newbie question

    I'm trying to create a function that willa automatically
    increment a number for tabindex on form fields this is what I did
    for now to this it.
    <cfcomponent>
    <cffunction name="myFunction" access="public"
    returntype="numeric">
    <cfargument name="myArgument" type="numeric"
    required="true">
    <cfset myResult= arguments.myArgument>
    <cfreturn myResult>
    </cffunction>
    </cfcomponent>
    Saved as default.cfc
    then in the form i do this
    <cfparam default="0" name="myResult" />
    <cfscript>
    getTabIndex=createObject("component","cfc.default");
    </cfscript>
    Then this:
    <cfoutput>#getTabIndex.myFunction(myResult)#</cfoutput>
    <cfoutput>#getTabIndex.myFunction(myResult)#</cfoutput>
    <cfoutput>#getTabIndex.myFunction(myResult)#</cfoutput>
    <cfoutput>#getTabIndex.myFunction(myResult)#</cfoutput>
    which give me 0 0 0 0 . I want 1,2,3,4 ect. Any idea on how
    to do this? Seems simple but I can't seem to figure it out.

    Sorry I cut-n-pasted the wrong function. This is what I have
    and I still get 11111. The output does not accept the updated
    myResult Variable.
    <cfcomponent>
    <cffunction name="myFunction" access="public"
    returntype="numeric">
    <cfargument name="myArgument" type="numeric"
    required="true">
    <cfset myResult= incrementValue(arguments.myArgument)>
    <cfreturn myResult>
    </cffunction>
    </cfcomponent>

  • Component interface question

    Is the concept "component interface" related to the business methods of the bean or to the callback methods (that inform the bean about state events) of SessionBean/EntityBean interface?
    if "component interface" related to the callBack methods then how the interface with the business methods is called (in 3.0 i know it's "business interface" but what about 2.1)?
    thanks in advanced

    The component interface refers to a particular client view exposed from the bean. It contains the business methods available to the callers.
    The callback methods are a separate contract between the bean class and the container. In EJB 2.x, they are expressed via strongly-typed javax.ejb interfaces that the bean class was required to implement.
    In EJB 3.0, all callbacks are optional and the bean class uses annotations such as @PostConstruct to annotate the methods it wants to be called back. These methods are typically not exposed through the client (component interface) view.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Skip validation - component design question

    i've made my own component.
    in renderer.encode it outputs link, like:
    <A onclick="document.forms['_id0']['_id0:_id27'].value='field2'; document.forms['_id0'].submit(); "
    href="#">
    it handles this action on it's own, in renderer.decode.
    my problem is, that the link causes form to be validated. i want to skip validation in this case, something like with immediate=true in commandButton. what exactly should i do in component/renderer? i've tried to investigate commandButton implementation but i haven't manage do get the solution... i don't need any events to be queued, any listeners invoked etc. all to logic of the action is executed in renderers decode method...

    No, you should not ever call the default ActionListener unless you're actually firing an action that should trigger navigation.
    All you need to do is call FacesContext.renderResponse() at some point during Apply Request Values (decode()).
    -- Adam Winer (JSF EG member)

  • About change the component UI question?

    Such as a jcolorchooser, can i suddenly change the UI of jcolorchooser to other UI such as JButton, but all the property of of jcolorchooser no change. That mean can i just change the jColorChooser UI to other UI or image?
    Can i use paint method in component to paint the component UI to other image?
    Please help me! thx to read~

    You mean something like this?JColorChooser jcc = new JColorChooser();
    jcc = new JButton("Click Me");You will get an error indicating that they are
    incompatible types.
    Mark

  • JSF Component Tree questions

    In JSF, the components in the jsp page are converted in to a tree accessible by the Controller, is that correct?
    Can I manipulate that tree on the fly and will the tree be rendered properly when displayed?
    Even more important, will the tree be recreated when I submit the form?
    Simple example, say I want to add an extra text input field on my form on the fly, based on a DB table perhaps.
    Can I do that? And will the tree be there when I post back, or is that based solely upon what's hard coded in the JSP page?

    Read about binding. I think it's what you need.
    Open faces.getViewRoot() to get the root.
    Regards,
    Stas

  • Component Palette question

    I want to create a folder to put all of my .gif files in under my WEB CONTENT folder, does anyone have any suggestions

    Go into the file sytstem and create an images directory under your project's public_html directory.
    Then in JDeveloper go into project properties->Content->Resources and add this directory.

  • Creator2 component state question

    I am new to JSF and Creator. I am using a page fragment for navigation on all pages of my site. The page fragment contains a tabset, with sub-tabs. I would like the tab set to maintain its state (which tab is highlighted) between pages. I cannot get this to work. Is this possible with JSF and Creator and if so how? Thanks.

    Hi,
    There is a relevant topic on EA discussion.
    Topic:TabSet navigation on a page fragment
    https://feedbackprograms.sun.com/project/forum/thread.html?cap={3F4DA363-16D3-4D4C-920C-992ECB054B6D}&forid={CC6B8562-F896-4A44-ACB6-4684BDD05E19}&topid={DFA961CF-157A-4E7C-9BBC-FDB69D982E9E}
    Hope this helps.
    Please post messages related to Creator 2 EA at the feedbacks programs portal. The URL is:
    https://feedbackprograms.sun.com/login.html
    Thanks,
    RK.

  • Printing a component that is larger than the paper size

    Hi,
    I am trying to print a component that may be larger than the size of the paper being used. Is there some way to get it to split between pages - ie, if it's larger than the page, it is printed over two or more pages?
    The component in question is a JTextArea. Would it be better to get the text from it and use the graphics drawString rather than the component's paint method?
    The relevant part of the code is below.
    Thanks,
    Helen
         //cast the Graphics object to a Graphics2D object
         Graphics2D g2 = (Graphics2D) g;
         //set the origin to be (0,0)
         g2.translate(format.getImageableX(), format.getImageableY());
         //if double buffering is enabled, disable it before printing
         boolean b = testForDoubleBuffering(c);
         if (b == true){
         disableDoubleBuffering(c);
         //tell the Component to draw itself to the printer
         comp.paint(g2);
         //if double buffering was enabled, reenable it once printing has happened
         if (b == true){
         enableDoubleBuffering(c);
         //return this constant to tell the PrinterJob that the page has been printed
         return Printable.PAGE_EXISTS;

    Hi,
    I am trying to print a component that may be larger
    than the size of the paper being used. Is there some
    way to get it to split between pages - ie, if it's
    larger than the page, it is printed over two or more
    pages?
    The component in question is a JTextArea. Would it be
    better to get the text from it and use the graphics
    drawString rather than the component's paint method?
    The relevant part of the code is below.
    Thanks,
    Helen
         //cast the Graphics object to a Graphics2D object
         Graphics2D g2 = (Graphics2D) g;
         //set the origin to be (0,0)
    g2.translate(format.getImageableX(),
    format.getImageableY());
    //if double buffering is enabled, disable it before
    printing
         boolean b = testForDoubleBuffering(c);
         if (b == true){
         disableDoubleBuffering(c);
         //tell the Component to draw itself to the printer
         comp.paint(g2);
    //if double buffering was enabled, reenable it once
    printing has happened
         if (b == true){
         enableDoubleBuffering(c);
    //return this constant to tell the PrinterJob that
    the page has been printed
         return Printable.PAGE_EXISTS;I should add that this is part of a class that implements Printable. However, it is being called by a Book class with the Book's append() method. It is the Book class that is being printed by the PrintJob:
         Book book = new Book();
         book.append(new PrintableClass(c), format);
         //set the pageable class to be the book, with the user-selected format
         job.setPageable(book);
         //if the user clicks the print button, start the printing process, otherwise cancel the print
         if(job.printDialog()){
         try {
              job.print();
         } catch(PrinterException pe) {
              System.out.println("Error printing: " + pe);
    Thanks,
    Helen

Maybe you are looking for

  • Problems with new iPod touch apps

    Hi everyone, I'm in a pickle. I just bought the new apps update for my iPod touch, but it never uploaded to my iPod. Help is greatly appreciated!

  • Problem with multiple output for software simulated project

    When a software simulated project in captivate is published more than thrice, the output is not generated properly, i.e not in-line with the project. Is this a problem with my system or due to some settings in captivate which is not activated?

  • HT201272 App I purchased now missing from AppStore.

    In September of 2011, I purchased Screen Record Pro from the App store for $4.99. It is still on my desktop and I love it. I just got a new MacBook Air and I was disappointed to see that app missing from my purchase history. How can I get this app ag

  • Can I run Skype through FireFox/Mozilla without installing skype on my laptop?

    My laptop is running Windows Vista Home premium (SP2) and the Windows Installer has failed thus I am unable to install or un-install applications like skye. As a result I am looking for a way to run skype while I am unable to install it normally. Is

  • Multi-touch in java

    Hi, I am trying to build a project with multi-touch capabilities using java. I did some research and thought mt4j is promising. But now I find it difficult to design a page with swing radio buttons and buttons etc., I want to use swing components suc