Trying to create a popup component

I'm creating a DataChoiser component that looks like edit field along with button to popup date choiser panel. This panel is wery simple, but my problem in this:
When I'm trying to popup my panel it seems to be right, but panel don't hides when I'm clicking anywhere else not in this panel, but I need this.
Here is code that shows popup panel, it's wery short and I hope you can help me with this.
DateChoiserPnl pnl = new DateChoiserPnl();
     // Calculating coords of popup component to be shown
     Point myLoc = getLocationOnScreen();
     int myWidth = getWidth();
     int myHeight = dateTxt.getHeight();
     Dimension pnlSize = pnl.getPreferredSize();
     int x = myLoc.x + myWidth - pnlSize.width;
     int y = myLoc.y + myHeight;
     if (popup != null) {
     popup.hide();
     popup = null;
     popup = pupFact.getPopup(this.getParent(), pnl, x, y);
     popup.show();
pupFact is object of type PopupFactory and popup is object of type Popup
Oleg

I have new question here, maybe somebody knows this: when I'm adding new FocusListener to my popup panel it doesn't fire focusLost to my listener, maybe it's problem of panel? Then how can I figure out when my panel losts focus?

Similar Messages

  • Trying to create Netbeans Swing/GUI component

    Hello,
    I'm trying to create a GUI component from the following code. The main idea is to create a component consisting of a checkbox and a panel. The panel can contain several other swing components. By checking or unchecking the checkbox I want all by components in the panel to be enabled or disabled.
    The important thing is that this component should work in the Netbeans GUI designer. I'm using Netbeans 5.5.
    My problem is the following:
    When adding my swing component to the Netbeans swing component palette and dragging onto a new form, I cannot assign other components to the main panel of my component. Even if I use the Inspector tree to drag components to be children of my component, the mouse icon shows a denying icon.
    If I add swing components programmatically, it works.
    Can somebody give me an advice what I should change in my code to make it work with the Netbeans GUI designer?
    Below you can find the current code of my standalone component. It includes a main() method so one can give it a try.
    Many thanks in advance!
    package test.swing;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class JEnabler extends JPanel {
        private JCheckBox checkEnabler = new JCheckBox();
        private JPanel contentPane = new JPanel();
        public JEnabler() {
            super.setLayout(new BorderLayout());
            checkEnabler.setSelected(true);
            checkEnabler.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
            checkEnabler.setMargin(new Insets(0, 0, 0, 0));
            checkEnabler.setVerticalAlignment(SwingConstants.TOP);
            checkEnabler.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent evt) {
                    checkEnablerActionPerformed(evt);
            super.addImpl(checkEnabler, BorderLayout.WEST, -1);
            super.addImpl(contentPane, BorderLayout.CENTER, -1);
        private void checkEnablerActionPerformed(ActionEvent evt) {
            Component[] list = contentPane.getComponents();
            for (int i=0; i<list.length; i++)
                list.setEnabled(checkEnabler.isSelected());
    protected void addImpl(Component comp, Object constraints, int index) {
    contentPane.add(comp, constraints, index);
    public LayoutManager getLayout() {
    return contentPane.getLayout();
    public void setLayout(LayoutManager mgr) {
    if (contentPane!=null)
    contentPane.setLayout(mgr);
    public void remove(Component comp) {
    contentPane.remove(comp);
    public void remove(int index) {
    contentPane.remove(index);
    public void removeAll() {
    contentPane.removeAll();
    public static void main(String args[]) {
    SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JEnabler enabler = new JEnabler();
    JTextField tf = new JTextField("Test");
    enabler.add(tf);
    JButton test = new JButton("Click");
    enabler.add(test);
    frame.getContentPane().add(enabler);
    frame.pack();
    frame.setVisible(true);

    Can anyone tell me what I am missing?
    public void paintComponents(Graphics g)you're not 'missing' anything, in fact you've gained an 's'

  • Creating a popup to return more than one value

    Hi
    I am trying to create a POPUP item on my page.
    I have created a List of Values with the following queries
    select NAME d, ID r from EMPLOYEE order by 1
    The page displays a text box with a popup icon adjacent to it.
    On clicking the popup icon the popup window displays the name of all the employess in order, on choosing the employee the Id of the employee gets populated into the text box; I would like the name to be displayed on the text box.
    I also would like to have the employee name to be available in the page. Is this possible?
    The current popup is similar to the select list. I would like to obtain both the values from my popup window i.e the employee name and employee id into my page. So that I can display the employee name to the user but while submitting the page i can pass the employee id.
    Can you give me some suggesstions as to how to achieve this.
    Thanks.
    Message was edited by:
    KART

    Hmm, can't think it's going to be possible to pass back two values from a standard popup. One option:
    Use a standard popup and set its SQL to something like:
    SELECT employee d, (employee || ' ( ' || id || ')') r FROM employee;
    This will populate your item with something like: Smith (0122345)
    Assuming the item with the popup is called :P1_MYITEM, you could then reference the ID of the employee in a PL/SQL process when the page is submitted, something like:
    emp_id := substr(:P1_MYITEM,instr(:P1_MYITEM,'(')+1,instr(:P1_MYITEM,')')-instr(:P1_MYITEM,'(')-1)
    Or you could use the same kind of code in a computation to set a hidden item to contain the employee's ID.
    It's not ideal but might do the trick depending exactly how rigid your requirements are.
    Andy

  • Error create a software component

    I am trying to create a software component in SLD, but I am getting following error.
    <b>“Unknown reference instance in CIMPropertyReference key property” </b>.
    I am giving following parameters .
    Product  : TBIT40_WORKSHOP,1.0 of SAP
    Vendor :sap
    Name :  PRASHANTH
    Version: 1.0
    can any one please help me create a SWC and also let me know how to create Product in SLD <b>I am new to XI</b> .

    Hi Prashanth,
    More on -
    http://help.sap.com/saphelp_nw2004s/helpdata/en/a4/481955dc9e42c19d5a1bc3b8aead81/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/12/003479fa4c2d4aa9d175dcbb081d66/frameset.htm
    doubts in funda's of XI
    Hope this helps
    Regards,
    Moorthy

  • How to create a popup help page in html db

    i'm trying to create a popup up help page in html db by having a help button from the main page and when clicked a popup page will appear... but can't seem to get it working...
    can somebody pls help me? thanks a bunch!!

    Hi Denes ,
    Need some more suggestion from you .
    I have incorporated your popup code in navigation 'Logout' link.
    Now after clicking on that the popup page appears fine .
    But i like to include two button in that popup page such a way that --
    after clicking 'Confirm Logout' button some database updation has been done and the child popup page unloads,but the parent page redirect to login page.But if cancel pressed then only child popup page unloads and no database action will will be carried out .
    Could you plz help on this .
    Cheers,
    Rosy

  • Creating a custom component is causing a strange scoping issue

    I am a fairly new user to Flash and Actionscript, but I have
    a fair amount of experience working with C and Java. I'm currently
    working with Actionscript 2 in Macromedia Studio 8. I was trying to
    create a new component for a project I am working on, and I
    followed the tutorial in the help and all testing works while I am
    in context of the flash document where I export the component from.
    However, I try testing my component in a new blank document and I
    get some strange behavior.
    I am able to create a component on the stage, and adjust the
    properties perfectly fine. However, when I test the file, the
    variables for colors go out of scope. That is, the adjustments I
    made to the component through the parameters panel, and saw updated
    on the stage aren't demonstrated at runtime. The Number variable I
    used however is preserved. I did some traces, and it appears that
    this is happening because at runtime in the new blank document, the
    variables in the onEnterFrame method go out of scope, where they
    weren't before.
    It seems really strange to me that I should be able to edit
    the color on stage but have it revert while it is running. My
    intuition says that if it wasn't going to work in the new document,
    that it shouldn't work in either case.
    Anyway, here is the code for the .as file, I hope I'm just
    doing something stupid.

    There seems to be a little confusion here. Think of it this way:
    A basic UIComponent by itself is not visible; you can add something you can see to it to make a visual custom component. For example, a ComboBox component is a UIComponent with a ComboBox added to it.
    The UIComponent is the lightest weight component available from which you can create other components. I use it as the base for custom components that the user cannot see, like a data manager.
    HTH,
    Carlos

  • How create a PopUp in a WebDynpro CO???

    hi all,
    I am trying to create a PopUp in a Web Dynpro CO, but not work for me...
    try this:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/20d2def3-f0ec-2a10-6b80-877a71eccb68
    but it does not work, How can I fix this?
    Thanks!

    Hi,
         Can you give some more information on this.Are you getting any exception?

  • Create complex custom component

    Hi everyone!
    I'm trying to create my own custom component in JSF. However I have several questions :
    - It is not mandatory to create a renderer class, right ? the component can draw itself ?
    - How can I create a custom component which would have several "values" inside ? for example let us supppose I want to create a custom JSF component to enter a IBAN. The IBAN is divided into several parts : BBAN, country code, key, Bank adresse,... but any tutorial I've found explain how to create a input component with only one simple value (for example the classical "CreditCardInputComponent").
    Josselin

    Hi,
    did you find a solution for your "composite" component problem?
    I am also trying to create a custom component that contains several standard jsf components such as HtmlCommandLink and HtmlInputText.
    I build all the standard components within my component programmatically using things like:
    HtmlCommandLink link = (HtmlCommandLink) application.createComponent(HtmlCommandLink.COMPONENT_TYPE);
    Also at the beginning of the encodeBegin I clear all children from my custom component using getChildren().clear()
    and rerender the component based on my new internal model which I updated during the previous decoding of my component.
    As a simple jsf custom tag it works ok, however, I am facing deep problems with action events as soon as I use the component within a jsf HtmlDataTable tag.
    Am I missing something here?
    Any ideas? Help is really really appreciated. This different behavior in different contexts is slowly but constantly driving me nuts.
    cheers
    hans

  • Error while creating WPC editor component...

    Hi,
    I was trying to create WPC editor component based on [Creating Editor Components for Composite Web Form Elements|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/30c46426-829b-2b10-4286-ec70189e5de5&overridelayout=true] tutorial.
    Basically i want to display the dropdown list component in WPC form. Please find below error  i am getting when i try to open the form.
    Error
    com.sapportals.portal.prt.component.PortalComponentException: Error in service call of Resource
    Component : com.sap.nw.wpc.designtime.EditorTool
    Component class : com.sap.nw.wpc.editor.EditorTool
    Thanks in advance,
    Vasu

    Hi,
    Any Suggestions?
    Regards
    Vasu

  • Trying to use a popup window as a component  in another component

    Hi guys,
    I am unable to use a popup component in another component in
    Flex .
    Its not calling the popup compopnent.
    Could anyone plz hel me.
    This is my code.
    This is the parent component TitlWindow where i want to call
    my popup
    component.
    <mx:TitleWindow xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" width="100%" height="100%"
    xmlns:util="userinterfaces.util.*"
    creationComplete="showWindow();"
    title="CREATE PROFILE">
    This is my script where i am writing a function to call a
    component
    whose name is fielupload.mxml
    <mx:Script>
    private function showWindow():void
    pop =
    fileupload(PopUpManager.createPopUp(this,fileupload,true));//
    fileupload.mxml
    is called
    pop.title = "Please enter your login information.";
    pop.showCloseButton =true;
    PopUpManager.centerPopUp(pop);
    pop.addEventListener("close",removeMe);
    </mx:TitleWindow>
    This is the code for fileupload.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:TitleWindow xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" width="100%" height="100%"
    xmlns:util="userinterfaces.util.*" title="File Upload">
    <mx:Script>
    <![CDATA[
    import mx.collections.XMLListCollection;
    import flash.events.Event;
    import flash.events.IOErrorEvent;
    import flash.events.ProgressEvent;
    import mx.controls.Alert;
    import flash.net.FileFilter;
    import flash.net.FileReference;
    import flash.events.SecurityErrorEvent;
    import mx.controls.Button;
    import mx.controls.TextInput;
    import mx.controls.ProgressBar;
    import mx.core.Application;
    import flash.net.URLRequest;
    import flash.net.URLRequestMethod;
    import mx.core.UIComponent;
    import mx.managers.PopUpManager;
    public var fileFilterImage:FileFilter = new
    FileFilter("Images","*.png;*.gif;*.jpg");
    public var fileFilterDocument:FileFilter = new
    FileFilter("Documents", "*.txt;*.doc;*.pdf;*.rtf");
    public var fileFilterArchives:FileFilter = new
    FileFilter("Archives", "*.zip;*.tar;*.hqx");
    public var fileFilterAll:FileFilter = new
    FileFilter("All", "*.*");
    public var fileRef:FileReference;
    public var selectedId:String;
    public function init():void {
    fileRef = new FileReference();
    fileRef.addEventListener(Event.CANCEL,
    traceEvent);
    fileRef.addEventListener(Event.COMPLETE,
    completeEvent);
    fileRef.addEventListener(Event.SELECT,
    selectEvent);
    fileRef.addEventListener(IOErrorEvent.IO_ERROR,
    traceEvent);
    fileRef.addEventListener(Event.OPEN, traceEvent);
    fileRef.addEventListener(ProgressEvent.PROGRESS,
    onFileProgress);
    fileRef.addEventListener(SecurityErrorEvent.SECURITY_ERROR,
    traceEvent);
    public function traceEvent(event:Event):void {
    var tmp:String =
    "================================\n";
    public function
    ioErrorEvent(event:IOErrorEvent):void{
    Alert.show("IOError:" + event.text);
    traceEvent(event);
    public function selectEvent(event:Event):void{
    //var selectedId:String =
    selectButton(event);
    //Alert.show("i am in id" +
    Application.application.winMyProfile.selectedId);
    btnUpload.enabled = true;
    iptFile.text = fileRef.name;
    public function
    selectButton(catchButton:Event):void{
    var newButton : Button = new Button;
    newButton = catchButton.currentTarget
    as Button
    selectedId = newButton.id;
    //Alert.show("i am in id" +
    selectedId);
    public function
    onFileProgress(event:ProgressEvent):void {
    prgBarUpload.label = "Loaded " +
    event.bytesLoaded + " of " +
    event.bytesTotal + " bytes";
    prgBarUpload.setProgress(event.bytesLoaded,
    event.bytesTotal);
    public function
    completeEvent(event:Event):void {
    Alert.show("File Uploaded
    Successfully");
    btnUpload.enabled = false;
    btnBrowse.enabled = true;
    public function uploadFile(url:String):void {
    url = url + "?
    folder="+Application.application.winLogin.userInfo.getUsername();
    var req:URLRequest = new
    URLRequest(url);
    req.method = URLRequestMethod.POST;
    var folder:String =
    Application.application.winLogin.userInfo.getUsername();
    fileRef.upload(req, folder,true);
    ]]>
    </mx:Script>
    <mx:VBox id="vbMain" width="100%" height="60">
    <mx:HBox width="100%" height="22">
    <mx:TextInput height="22" id="iptFile"
    width="100"/>
    <mx:Button id="btnBrowse" label="Browse"
    click="selectButton(event),fileRef.browse([fileFilterAll]);"
    />
    <mx:Button id="btnUpload" label="Upload"
    enabled="false"
    click="uploadFile('fileupload.do');" />
    <mx:Button id="btnCancel" label="Cancel"
    enabled="false"
    click="PopUpManager.removePopUp(this);"/>
    </mx:HBox>
    <mx:ProgressBar width="200"
    source="iptFileResume" height="5"
    id="prgBarUpload" mode="manual"/>
    </mx:VBox>
    </mx:TitleWindow>
    Its not even showing any error , i dont know whats the
    problem with
    it.
    Thanks for your help,
    Mario.

    If I understand, you want to display a popup Titlewindow from
    within another popup TitleWindow? This is possible.
    Simplify your code to get it working first.
    Tracy

  • Error while creating a new component

    Dear
    I'm trying to create a component to delete the "blank" value from an option list so that the default value would be the first value on the list. I did all the steps in the "Component Wizard" and at the end when clicking finish the following errors appear:
    Unable to add resource.  Error Parsing file
    *'C:/Oracle/ucm_instances/ecm1/ucm/cs/custom/Remove_Default/resources/remove_default_resource.htm'*
    Line 9 column 3
    -><@dynamichtml compute_std_field_overrides@>
    -><$if fieldName like "xFirst_Name|xFull_Name"$>
    -><$if not isQuery$>
    Resource definition tag inside resource definition tag.
    Please advise how to solve
    Below is the code I used
    *<@dynamichtml compute_std_field_overrides@>*
    *<$if fieldName like "xCountry|xState"$>*
    *<$if not isQuery$>*
    *<$inc('setOptionsAllowPreselect')$>*
    *<$inc('clearAddEmptyOption')$>*
    *<$endif$>*
    *<$endif$>*
    *<$include super.compute_std_field_overrides$>*
    *<@end@>*
    Thanks and Best Regards

    I don't think the pipe is the problem as that appears to match what's defined in the manual. Plus, the error doesn't seem to match that (not saying that detail alone would ever through a hypothesis out). It's worth taking out.
    MME, are you 100% sure you've opened the file, from the filesystem, and all you saw was the code you posted?
    Typically the format is:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>
    componentname htmlIncludeOrString
    </title>
    </head>
    <body>
    <@dynamichtml nameofinclude@>
    idoc goes here
    <@end@>
    </body></html>
    That could cause a difference between what you believe is the ninth line & what the system reads as the ninth line.
    I would suggest taking all of the idoc out of the dynamichtml and see if that renders. If that works, add it back in line-by-line. See what causes it to break. There's not much code, so it shouldn't take more than a handful of restarts to test this out.
    I have a feeling that even empty, the component will fail. The fact that you believe you made your code eight lines long and yet the error still pointed to line nine means something is not as it seems.
    Can you post the full component for review? I so, provide a link and I'll take a look.
    Thanks,
    -ryan
    Ryan Sullivan | ECMconsultant
    http://www.ecmconsultant.net/

  • Need help trying to create a ActiveX registered event

    I am trying to create a register event for an ActiveX component. The problem I am having is creating the callback vi. When I right click on the VI ref and create the callback vi it is created with the user parameter as a variant. I would like this to be a control refnum. If I open the callback vi and replace the user parameter variant with a control refnum the wire from the callback vi to the VI ref is broken. How do I change the user parameter?

    Joe is correct on this one. The callback where designed to take variants as their inputs, so that they are more flexible. In addition Variants are used through out ActiveX programming.
    If you have a control reference that you want to pass into the VI, all you need to use is the "To Variant" function in the main VI to turn the reference into a variant. You can then inside the Callback VI you can use the Variant to Data VI to change the variant back to a reference; you simply where a constant of the reference type to the "Type" terminal.
    Evan
    National Instruments

  • Trying to create Large Play button on Flash CS4

    Hello,
    I am trying to create the following: (using someone elses post from another board)
    "I am wondering if there is a way to hide the FLVPlayback skin until a certain event happens. Let me explain.
    I have an instance of the flvplayback component in my movie. I have the player skin set to "autohide" and "autoplay" set to false. Instead of having users click on the play button of the skin to start the movie I have incorporated a larger play button in the middle of the screen. The set back here is that when a user mouses over the movie to click on the larger play button the flvplayback skin appears as well.
    I'd like to basically tell the skin "Hey don't appear on mouseover until AFTER the large play button is pressed." What code would I need for this in Actionscript 3?"
    I am curious if someone can teach how to embed a regular .swf movie file into the
    "example" code, which was also posted here
    (http://www.kirupa.com/forum/showthread.php?t=323702)
    I have very limited coding skills and very much appreciate the assistance.
    Rod

    You are looking for the visible property I believe.
    At the beginning of your code, set:
    myFLVPlayer._visible = false;
    to set it invisible (replacing "myFLVPlayer" with your components name ocourse)
    Then, onRelease of your button, set:
    myFLVPlayer._visible = true;
    to make it visible again.
    EDIT
    I just looked at your code in the other forum, and here is your onRelease function fixed:
    video_mc.video._visible = false;
    video_mc.bigButton_mc.onRelease = function(){
    video_mc.bigButton_mc._visible = false;
    video_mc.video._visible = true;
    video_mc.video.play();

  • I tried to create a new google calendar in ical, but they did not show up, I tried this several times. Now when I sync my iPad via iTunes all these failed attempts are showing up under the ical sync list in iTunes, how can i clear them from this list?

    I tried to create a new google calendar in ical, but they did not show up, I tried this several times.
    Now when I sync my iPad via iTunes all these failed attempts are showing up under the ical sync list in iTunes, how can I clear them from this list?

    See https://bugs.downthemall.net/ticket/2147
    Google Search Bug
    Reported by: openid:nathan wride Owned by:
    Priority: major Milestone:
    Component: Polish/Usability Version: 2.0.10
    Keywords: Google search instant save bug Cc:
    Operating System: Windows
    Description
    Hi Guys
    I have found a bug/annoying thing that occurs frequently on google. When searching, DTA trys to download the search...
    I'll try to attach a screenshot.
    Attachments
    [https://bugs.downthemall.net/attachment/ticket/2147/Screenshot.png Screenshot.png] Download (113.0 KB) - added by openid:nathan wride 4 weeks ago.
    The screenshot that shows the bug.

  • Creating a popup on mouse over in bar graph

    Hi,
    I want to create a popup using mouse over event on bar graph but I didn't find corresponding property in the property inspector. Is it possible to display a popup on mouse over in bar graph?
    At present I am able to create a popup in the backing bean based on click event. I want to align it to the bar in the graph which was clicked. But now, it is being aligned to the bar graph as a whole(like above the graph , below the graph) when I use "RichPopup.PopupHints.HintTypes.HINT_ALIGN_ID, source". Is there a way to align it to the particular bar?
    Any help is greatly appreciated
    Thank you,
    KK

    Hi,
    don't think you can align it to an area within a component. The align id property expects a component reference. Note that mouse over on a bar graph doesn't select the bar, which means that the data in the binding layer is not set to current (just in case that the data in the popup is meant to be dependent)
    Frank

Maybe you are looking for