Adding a popup to TextField in JEditorPane

okay, I'm trying to add a popup window to my JEditorPane so that when someone right clicks in a text field a popup window is displayed.
So far I've got my popup to display when they click the page surrounding the text field, but it won't display when they right click insde the text field - which is what I want.
Does anyone know where I might be going wrong? Below is my code:
import java.awt.event.*;
import javax.swing.*;
public class TestClass extends JFrame{
    JEditorPane pane = new JEditorPane();
    public TestClass() {
        super();
        try {
            pane.setPage( "https://softwarereg.sun.com/registration/developer/en_US/login?" );
        } catch (Exception e) {
        PopupWindow oPopup = new PopupWindow(pane);
        this.getContentPane().add(new JScrollPane(pane));
    public static void main(String args[]) {
        TestClass app = new TestClass();
        app.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
        app.setSize( 400, 400 );
        app.setVisible( true );
    class PopupWindow extends JPopupMenu {
        private JPopupMenu popup;
        public PopupWindow(final JEditorPane theTable)
            popup = new JPopupMenu();
            JMenuItem oMenu = new JMenuItem("Test");
            oMenu.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    System.out.println("Pressed");
            popup.add( oMenu );
            //Add listener to components that can bring up popup menus.
            final MouseListener popupListener = new PopupListener();
            theTable.addMouseListener(popupListener);
        public JPopupMenu getPopup() {
            return popup;
        class PopupListener extends MouseAdapter {
            public final void mousePressed(final MouseEvent e) {
                maybeShowPopup(e);
            public final void mouseReleased(final MouseEvent e) {
                maybeShowPopup(e);
            private void maybeShowPopup(final MouseEvent e) {
                if (e.isPopupTrigger()) {
                    popup.show(e.getComponent(), e.getX(), e.getY());
}

ICE, thanks for pointing me in the right direction. I've now managed to make it so that I can find the names of the input fields for the form elements.
What I need to do now is actually get a handle on the the component so that I can then set the text of the textfield, in the past I've managed to use this piece of code:
Container c = (Container)pane.getComponent(0);
Component swingComponentOfHTMLInputType = c.getComponent(0);
if ( swingComponentOfHTMLInputType instanceof JTextField ) {
  JTextField tf = (JTextField)swingComponentOfHTMLInputType;
  tf.setText( "AutoCompleted"  );
}Which would set the textfield to "AutoCompleted". But in my implementation I can't seem to find a method to get the component:
import java.awt.event.*;
import java.awt.*;
import java.util.Enumeration;
import javax.swing.*;
import javax.swing.text.*;
public class TestClass extends JFrame{
    static JEditorPane pane = new JEditorPane();
    public TestClass() {
        super();
        try {
            pane.setPage( "http://www.google.com" );
        } catch (Exception e) {
        this.getContentPane().add(new JScrollPane(pane));
        JButton b = new JButton("Auto Complete");
        b.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                Document oDoc = pane.getDocument();
                Element oElems = oDoc.getDefaultRootElement();
                expandElems( oElems );
        this.getContentPane().add(b,BorderLayout.SOUTH);
    private static void expandElems( Element voElem )
        if ( voElem.isLeaf() )
            if ( voElem.getName().equals("input") || voElem.getName().equals("textarea") )
                ComponentView oView = new ComponentView(voElem);
                AttributeSet oAttrib = oView.getAttributes();
                Enumeration oAttribEnum = oView.getAttributes().getAttributeNames();
                // Loop through the input fields
                while ( oAttribEnum.hasMoreElements() ) {
                    Object sName = oAttribEnum.nextElement();
                    Object sValue = oAttrib.getAttribute( sName );
                    System.out.println( sName + ": " + sValue );
                System.out.println("\n\n");
                // Attempt to get the container / component
                Container c1 = oView.getParent().getContainer();
                Container c2 = (Container)oView.getComponent();
        } else {
            for ( int i = 0; i < voElem.getElementCount(); i++ ) {
                expandElems( voElem.getElement(i) );
    public static void main(String args[]) {
        TestClass app = new TestClass();
        app.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
        app.setSize( 400, 400 );
        app.setVisible( true );
}I've tried to get the container using these methods:
Container c1 = oView.getParent().getContainer();
Container c2 = (Container)oView.getComponent();
But the values of c1/2 are always null. Does anyone know how I might get the component?
I'd really appreciate some help on this - i'm well and truely stuck! :-s
Thanks in advance,
BBB

Similar Messages

  • ContextMenu Not Displayed in Tree Which is added in popup.

    I have created popup. and added tree in it. Tree has a userdefined contextMenu.But when i right click on item in tree the contextMenu is not displayed.

    Hello,
      As per ADOBE docs, context menu works for top level components and not with the child components.
      Thats why u r not getting context menu in the tree, as its now the child of title window.
    please checkout this link,
    http://stackoverflow.com/questions/5382159/flex-custom-context-menu-for-a-component
    Thanks and Regards,
    Kanchan Ladwani | [email protected] | www.infocepts.com

  • Adding a popup that does not interupt the progress

    I'm trying to add a popup that opens up a URL, like help window. But I do not want it to interfere with the progress of the captivate project.
    I tried using javascript popup window.open() command, on a button. When user clicks button it brings up appropriate popup, but the project goes blank, except for the word [object] on the page.
    Any suggestions are appreciated!

    Hi again
    In that case you need to avoid using JavaScript unless you want to control the size and placement of the popup. If that's what you are doing, you need to code a function in the HTML page or the standard.js file that handles the popup for you. The way you are doing it with the Button or Click Box is likely not pointing to a function.
    If simply opening a new window is sufficient, just click the down arrow to the right of the URL and choose New. Click it a second time and DE-select "Continue playing project" to keep the movie paused when the user clicks the object.
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • How do I block adds served by Primawega?? I have added 3 popup blockers but none of them work! Running Windows 7...

    Adds keep popping up from primawega and none of the popup blockers I've used have works. I'm running Windows 7
    == This happened ==
    Every time Firefox opened
    == When I updated to Windows 7

    Here is a mix of solutions from different sources:
    Tools->Add-ons->Extensions->Loudmo (or anything strange, suspicious, unknown, etc.)
    Disable them or even uninstall them. Restart Firefox.
    Quote:
    "I deleted those over a week ago and everything has been running fine since. Check your add-on programs in Firefox."
    Quote:
    "In the Mozilla Components directory [C:\Program Files\Mozilla Firefox\components], I found a library called wry-NhK-.dll, which got created/modified around the same time the problems started. Since I renamed the file, the popups stopped."
    Look out in
    C:\Program Files\Mozilla Firefox\components
    for *.dll file which was created/modified at another date than all other files around.
    Quote:
    "In profile directory [application data/mozilla/firefox/profiles/xxxxxxxx.default/extensions], there should be a number of directories that look like: . If you look under/inside those, one will have a components directory. There a conspicuous dll [-zfdgl.dll] will reside. Delete/rename that...
    But you aren't done. Now in your registry, HKEY_CURRENT_USER/Software/AppDataLow there will be another conspicously named hive with a number of binary, hex and such entries. While I don't condone deleting anything in your registry, in this case, it was so obvious that it wasn't part of the normal computer, I delete the hive entry (NOT appdatalow) and viola, problem gone... "
    Comment: In my registry, in HKEY_CURRENT_USER/Software/AppDataLow I see only empty AVG folder (while I have just recently uninstalled AVG). So I suppose that deleting a hive of keys in this directory (if you have any keys in this directory) is relatively safe. But, just in case, you can backup it before deleting:
    right-click AppDataLow
    click Export
    save the backup of this one registry folder somewhere
    I hope you have some anti-malware program. Just in case primawega is a malware.

  • I seriously don't know what caused this to start being a problem until today it worked fine, but I added an exception for popups full question in DETAILS

    is there anyway to allow Firefox to allow pop ups from this 1 page of Facebook / well this 1 game https://apps.facebook.com/vampiresdarkside/ and not the entire pan in the Ass Pop up happy site, I cant see any sense in allowing popups from all
    apps.facebook.com
    and when I try to add it as the exception should be your program edits it to be that crap above instead of the exception I entered specifically,
    apps.facebook.com/vampiresdarkside/
    I seriously don't know what caused this to start being a problem until today it worked fine, but I added an exception for popups from this one site in Chrome and Firefox decided it wouldn't allow it popups from this part of Facebook and no I am not allowing all the FB apps to have popups I never had to before
    apps.facebook.com/vampiresdarkside/
    have popups after adding the popup exception in chrome, and no I did nothing to Firefox but it is kinda asking me to switch to Opera or some other crap browser with it acting like this, I modified the exception in chrome and Firefox now wont allow the pop ups it always had up until chrome allowed them WTF

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
    *Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
    *Do NOT click the Reset button on the Safe Mode start window
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    Do a malware check with several malware scanning programs on the Windows computer.
    Please scan with all programs because each program detects different malware.
    All these programs have free versions.
    Make sure that you update each program to get the latest version of their databases before doing a scan.
    *Malwarebytes' Anti-Malware:<br>http://www.malwarebytes.org/mbam.php
    *AdwCleaner:<br>http://www.bleepingcomputer.com/download/adwcleaner/<br>http://www.softpedia.com/get/Antivirus/Removal-Tools/AdwCleaner.shtml
    *SuperAntispyware:<br>http://www.superantispyware.com/
    *Microsoft Safety Scanner:<br>http://www.microsoft.com/security/scanner/en-us/default.aspx
    *Windows Defender:<br>http://windows.microsoft.com/en-us/windows/using-defender
    *Spybot Search & Destroy:<br>http://www.safer-networking.org/en/index.html
    *Kasperky Free Security Scan:<br>http://www.kaspersky.com/security-scan
    You can also do a check for a rootkit infection with TDSSKiller.
    *Anti-rootkit utility TDSSKiller:<br>http://support.kaspersky.com/5350?el=88446
    See also:
    *"Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked
    *https://support.mozilla.org/kb/troubleshoot-firefox-issues-caused-malware

  • ADF Popup issue with table row not selected

    OK, imagine this scenario. There is a page displaying a table of employees, and when you click on the employee_id (which is shown as URL), which is one of the columns of the table, a popup displays, showing the details of that particular employee.
    Now in the properties of the employee table, we unchecked the row selection property. Now how will I be able to achieve the same thing?
    I dragged the setCurrentRowWithKeyValue operation on employee_id column, changed the bindings of the TEXT property, added a popup behaviour, but still the popup displays the first row which is fetched in the table.
    Where am I missing, or is there any other way to achieve the same thing?
    JDev version: 11.1.2.2.0
    Edited by: Sonal on Oct 11, 2012 3:11 AM

    I did an exercise where I created one page which was displaying all the employees, and once you click on employee_id (which is shown as URL), a 2nd page opens displaying the details of the employees.
    Now in the above exercise, ROW SELECTION was disabled, for which I had to use this setCurrentRowWithKeyValue operation and then set the NDValue with the binding of the employee ID. So whenever I used to click on the employee_id, the page was taking to me the form, which was displaying exactly the same employee details.
    Now this thing should work with the popup thing too, right? So I disabled the ROW SELECTION

  • How to add a parameterized Popup to seeded iProc page by Personalisation ?

    Hi
    I'm trying to add a button on the iProcurement 'Add To Cart' region (ResultsInParagraphRN), to display a standard OAF popup. Release 12.
    Please let me know where I went wrong :)
    1. I read the OAF Dev Guide on popups, as far as I can currently follow it ...
    2. I made a region in a different project, and a test page, and successfully deployed that project so I can call the popup, so far no problem.
    3. I used personalization to create a Parameterized Popup and a Button to call it, in iProc, using the same values as above.
    4. When I click on the button in iProc, there is no reaction other than an 'Error on Page' indication in the browser.
    In IE6 - still our standard browser :(, I get and 'Error on Page' message, which then gives a message 'object required'.
    In Firefox, I see this message : 'popupdiv is null'. line 132 in popup.js - the last line of this fragment is highlighted -
    *//To avoid code redundency this is commen mehtod for showpopup and showpopuponppr.*
    function displayPopup()
    var winW = 630, winH = 460;
    t = document.getElementById(currentElement);
    *if (parseInt(navigator.appVersion)>3) {*
    *if (navigator.appName=="Netscape") {*
    winW = window.innerWidth;
    winH = window.innerHeight;
    *if (navigator.appName.indexOf("Microsoft")!=-1) {*
    winW = document.body.offsetWidth;
    winH = document.body.offsetHeight;
    width=popupDiv.style.width;_
    So, either I have gone wrong somewhere, or there is an issue with the Javascript generated by Framework?
    Thanks in advance for any help!

    user13501968 wrote:
    Hi ,
    Your popup id's are not properly generated.For popups under table the id's should be generated like
    tablename:popupname but in your case it is just popupname alone
    thats why you get javascript error since in run time java script cannot find popup of type tablename:popupname.
    Please share the page structure.
    Meanwhile try adding the popup under rowlayout instead of flowlayout.
    Regards,
    Guru Krishnan.Hi
    Here is (part of) the page structure (table is already nested inside another). The bit I added starts
    at <oa:flowLayout id="CustomFlow">
                  <oa:rowLayout id="ControlsRow" width="100%">
                     <ui:contents>
                        <oa:cellFormat id="AddToCartTopCell">
                           <ui:contents>
                              <oa:tableLayout id="AddToCartTableLayout">
                                 <ui:contents>
                                    <oa:rowLayout id="AddtoCartRow">
                                       <ui:contents>
                                          <oa:cellFormat id="QuantityFormatCell" extends="/oracle/apps/icx/icatalog/shopping/webui/QuantityFormatRN" rendered="${oa.current.IsItemAvailable}"/>
                                          <oa:cellFormat id="AddToCartSpacerCell" rendered="${oa.current.IsItemAvailable}">
                                             <ui:contents>
                                                <oa:spacer id="AddToCartSpacer" width="5"/>
                                             </ui:contents>
                                          </oa:cellFormat>
                                          <oa:cellFormat id="AddToCartButtonCell" rendered="${oa.current.IsItemAvailable}">
                                             <ui:contents>
                                                <oa:button id="AddToCart" text="Add to Cart" prompt="Add to Cart" shortDesc="Adds this item to your shopping cart." rendered="${oa.ShoppingPVO.IsIPFlow}"/>
                                                <oa:button id="AddToDocument" text="Add to Document" prompt="Add to Document" shortDesc="Adds this item to your document." rendered="${oa.ShoppingPVO.IsSicFlow}"/>
                                                <oa:flowLayout id="CustomFlow">
                                                   <ui:contents>
                                                      <oa:popUp id="CustomPopup" popupType="ParameterizedPopup" popupRegion="/oracle/apps/xxfss/newcart/webui/AddToCartRN" popupParameters="pItemId={@ItemId}" popupTitle="CustomPopup" height="200" width="400" readOnly="false" shortDesc="CustomPopup" comment="Custom Popup Region"/>
                                                      <oa:button id="CustomButton" popupId="CustomPopup" popupEnabled="true" text="Custom Button" prompt="Custom Button" shortDesc="Custom Button Additional Text" comment="Custom Button Comments"/>
                                                   </ui:contents>
                                                </oa:flowLayout>
                                             </ui:contents>
                                          </oa:cellFormat>
                                          <oa:cellFormat id="ItemNotAvailableCell" rendered="${oa.current.IsItemNotAvailable}">
                                             <ui:contents>
                                                <oa:formattedText id="ItemNotAvailableText" shortDesc="This item is not available." styleClass="OraTipText" text="This item is not available."/>
                                             </ui:contents>
                                          </oa:cellFormat>
                                       </ui:contents>
                                    </oa:rowLayout>
                                 </ui:contents>
                              </oa:tableLayout>
                           </ui:contents>
                        </oa:cellFormat>                                                           

  • "Java Applet Window" appears in my popup menu

    Hello
    I have added a popup menu to my applet but whenever the popup menu appears, I also get the text "Java Applet Window" at its bottom.
    What is causing this?
    Can I get rid of it?

    Yes you can add a local user policy or local system policy that grants an AWT permission that regards "Java Applet Window" more precisely permission java.awt.AWTPermission "showWindowWithoutWarningBanner";
    You can use a tool to add policy, create new policy files etc. Read about "policytool" in http://java.sun.com/j2se/1.4.1/docs/tooldocs/tools.html
    Probably, signing tha applet jar, you can obtain necessary permission without modifing local policy. But I'm not sure.
    Stefano.

  • Problems adding nodes to JTree on runtime

    I have added a popup menu to my tree, and would like to be able to add new nodes by right clicking, so I have this code in my event listener:
    void newFolderFolderPopup_mousePressed(MouseEvent e) {
      System.out.println("WEEEEEEEEEEEEEEEEEEEEEEEE");
      FolderDO folder = new FolderDO("New Folder");
      DefaultMutableTreeNode newNode = new DefaultMutableTreeNode(folder);
      TreePath treePath = foldersTree.getSelectionPath();
      DefaultMutableTreeNode slectedNode = (DefaultMutableTreeNode)treePath.getLastPathComponent();
      treeModel.insertNodeInto(newNode,slectedNode,slectedNode.getChildCount());
      foldersTree.scrollPathToVisible(new TreePath(newNode.getPath()));
    }If the slected node is a leaf, it works just fine every time I do it. But if the selected node has children and it has once been expanded, the new node is not displayed (but something strange is happening to the tree). If however the selected node has children and has not been expanded it works fine...???
    Any ideas?

    I have added a popup menu to my tree, and would like to be able to add new nodes by right clicking, so I have this code in my event listener:
    void newFolderFolderPopup_mousePressed(MouseEvent e) {
      System.out.println("WEEEEEEEEEEEEEEEEEEEEEEEE");
      FolderDO folder = new FolderDO("New Folder");
      DefaultMutableTreeNode newNode = new DefaultMutableTreeNode(folder);
      TreePath treePath = foldersTree.getSelectionPath();
      DefaultMutableTreeNode slectedNode = (DefaultMutableTreeNode)treePath.getLastPathComponent();
      treeModel.insertNodeInto(newNode,slectedNode,slectedNode.getChildCount());
      foldersTree.scrollPathToVisible(new TreePath(newNode.getPath()));
    }If the slected node is a leaf, it works just fine every time I do it. But if the selected node has children and it has once been expanded, the new node is not displayed (but something strange is happening to the tree). If however the selected node has children and has not been expanded it works fine...???
    Any ideas?

  • Buttons / popups hidden behind background why ?

    In CS5.5 the popup button areas I draw on an ' over ' state are drawn under the background - whether background is a bitmap or sold color.  The corresponding popup text also appears behind the background.  Arranging and sending to front or back doesn't help.  I had this working before and suddenly I can't do it.....I'm trying to make a map with rollover popup text.  Making the background layer invisible allows construction but the swf  has hidden popups.
    This is the quick tut I learned it on ...followed it and it worked at first.  Now following it doesn't work for anything new.  Tried on 2 computers. Does it work for anyone? 
    waveav.us/rollover.pdf
    Thanks!

    Thanks Kglad,
    Simply moving the button layer above the background layer showed the button rectangles, hence changing the display list I believe.  Thanks again for quick reply.
    Date: Sun, 24 Feb 2013 13:10:44 -0800
    From: [email protected]
    To: [email protected]
    Subject: buttons / popups hidden behind background why ?
        Re: buttons / popups hidden behind background why ?
        created by kglad in Flash Pro - General - View the full discussion
    is the parent of the background and the parent of the popup the same? if yes, that re-adding the popup to the display list will add it above the background. if no, you will need to rethink your setup or re-add the parent of the popup so it's above the parent of the background.
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5098686#5098686
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5098686#5098686
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5098686#5098686. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Flash Pro - General by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Using Tabs and Return in TextField

    Hi!
    I am tying to use a series of TextFields to collect information from the user for a GUI application. Currently, I am adding ActionListeners to the TextFields and when the user enters a value and hits return, then the event is triggered and I am able to collect the value entered. How do I set it up so that even if the user hits the tab key, an event is triggered? Any help/pointers will be appreciated.
    I posted this earlier and someone responded saying :
    Use the input map/action map pattern.Can anyone point me to some help in this regard.
    thanks
    ajs

    Hi!
    I am tying to use a series of TextFields to collect information from the user for a GUI application. Currently, I am adding ActionListeners to the TextFields and when the user enters a value and hits return, then the event is triggered and I am able to collect the value entered. How do I set it up so that even if the user hits the tab key, an event is triggered? Any help/pointers will be appreciated.
    I posted this earlier and someone responded saying :
    Use the input map/action map pattern.Can anyone point me to some help in this regard.
    thanks
    ajs

  • Can't add popup menu?

    Hi,
    Thanks so much, I have been adding DW popup menus to my
    sites for years and have never run into a problem, now today im
    getting an error message each time I try to add the menu and I dont
    know how to fix this.
    The error message is.
    While executing apply/behavior in show popup menu the
    following java script error occurred. At line 247 of C://program
    Files/Macromedica /Dreamweaver
    MX/configuration/Behaviors/actuibs/shop popup menu. js";
    TypeError: the head.innerHTML has no properties. The action
    will not be added to your document.
    I have checked at line 247 and nothing is there?
    Any thought or suggestion would be greatly appreciated.
    Jill

    Jill:
    I offer my sincere advice here - it's based on years of
    seeing people
    struggle with these simply awful menus. In fact, you may find
    this essay
    written by the person who adapted the code for Macromedia to
    be
    illuminating.
    http://www.losingfight.com/blog/2006/08/11/the-sordid-tale-of-mm_menufw_menujs/
    Further, you say "no problem" but there are things going on
    that you may
    have never thought about - read this -
    http://apptools.com/rants/jsmenu.php
    http://apptools.com/rants/menus.php
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "JND1993" <[email protected]> wrote in
    message
    news:eqlgkb$ln8$[email protected]..
    > Hi,
    > Thanks so much, I have been adding DW popup menus to my
    sites for years
    > and
    > have never run into a problem, now today im getting an
    error message each
    > time
    > I try to add the menu and I dont know how to fix this.
    >
    > The error message is.
    >
    > While executing apply/behavior in show popup menu the
    following java
    > script
    > error occurred. At line 247 of C://program
    Files/Macromedica /Dreamweaver
    > MX/configuration/Behaviors/actuibs/shop popup menu. js";
    > TypeError: the head.innerHTML has no properties. The
    action will not be
    > added
    > to your document.
    >
    > I have checked at line 247 and nothing is there?
    >
    > Any thought or suggestion would be greatly appreciated.
    > Jill
    >
    >

  • Invoking popup component programmatically

    Hi
    I am invoking popup component programmatically for that
    i have a link
    i have added a popup componet inside the af|form (for eg:popup id=p3) and bind the popup to a managed bean with name popup
    In the Action property of my commandlink, i have invoked a method in the managed bean( for eg.the method caller() )
    In my bean class i have used:-
    public class classname{
    private RichPopup popup;
    public void setPopup(RichPopup popup) {
    this.popup = popup;
    public RichPopup getPopup() {
    return popup;
    public String caller() {
    showPopup(popup, null);
    return null;
    public static void showPopup(RichPopup popup, UIComponent component) {
    FacesContext context = FacesContext.getCurrentInstance();
    String alignId = (component==null) ? null : component.getClientId(context);
    StringBuilder script = new StringBuilder();
    script.append("var popup = AdfPage.PAGE.findComponent('").append("p3").append("'); ")
    .append("if (!popup.isPopupVisible()) { ")
    .append("var hints = {}; ");
    if (alignId!=null) {
    script.append("hints[AdfRichPopup.HINT_ALIGN_ID] = '").append(alignId).append("'; ")
    .append("hints[AdfRichPopup.HINT_ALIGN] = AdfRichPopup.ALIGN_AFTER_END; ");
    script.append("popup.show(hints);}");
    ExtendedRenderKitService erks = Service.getService(context.getRenderKit(), ExtendedRenderKitService.class);
    erks.addScript(context, script.toString());
    But in my page when i clicked the link it doesnot invoke the popup component....
    am i missing with something......... please help
    Thanks
    sudeep

    yeah i even tried to call the "showPopup(popup, null);" from the actionlistener of the commandlink but no invoke........
    as u suggested http://ifelix.blogspot.com/2010/11/how-to-invoke-popup-component.html i followed this ........
    and my jsff
    <af:column sortProperty="contractFileName" sortable="false" id="c10"
    headerText="Contract File Name" width="166">
    <af:commandLink text="#{row.bindings.contractFileName.inputValue}"
    id="cl2" partialSubmit="true"
    actionListener="#{selContractName.OnClickOfContract}"
    binding="#{selContractName.conName}"
    action="#{selContractName.caller}">
    </af:commandLink>
    </af:column>
    Edited by: SKD on Sep 12, 2011 7:02 PM

  • How to show dynamically created popup from created command button?

    In my region I have a toolbar. The buttons in the toolbar are created dynamically in the bean. When one of the buttons is clicked I’d like to display a popup dialog.
    So, the code looks something like this:
    RichCommandToolbarButton button = new RichCommandToolbarButton();
    // set icons, text, etc….
    RichPopup popup = new RichPopup();
    // set id etc.
    RichDialog dialog = new RichDialog();
    dialog.setType(“cancel”);
    // add title, text, another button to toolbar, etc.
    popup.getChildren().add ( dialog);
    ClientListenerSet set = button.getClientListeners();
    if (set == null)
    set = new ClientListenerSet();
    button.setClientListeners(set);
    set.addFeatureDependency("AdfShowPopupBehavior");
    set.addBehavior("new AdfShowPopupBehavior('" + popup.getId() + "', AdfRichPopup.ALIGN_AFTER_END,null,'action')");
    button.setPopup(popup);
    In the corresponding .jsff the toolbar and the buttons are rendered in the following way:
    <af:toolbar id="t1" styleClass="AFStretchWidth"
    visible="#{backingBeanScope.MyBean.visible}" >
    <af:forEach items="#{backingBeanScope.MyBean.buttons}" var="adfButton" >
    <af:commandToolbarButton binding="#{adfButton}" />
    </af:forEach>
    This kind of works, except the button shows up with the down-arrow menu icon, which when clicked shows a tiny empty rectangle/menu. When the button itself is clicked, it correctly shows the popup with the dialog.
    So… how do I do this w/o doing the button.setPopup() so that I do not get the empty menu, but just get the popup to show when the button is clicked? Or is there a way to disable showing of the (empty) menu?
    I have tried adding the popup to the toolbar, but that did not work.
    I have tried adding action listener to the button, and adding the popup to the toolbar there and then showing it (by doing new RichPopup.PopupHints(); popup.show(ph)), but that did not work.
    I have tried adding action listener to the button, and adding the popup to the button getChildren().add() then showing it ((by doing new RichPopup.PopupHints(); popup.show(ph)), but that did not work.
    ANY help will be most appreciated!

    Hi,
    Do u mean to say that u need to open another PLD in when ur user form is open.?
    Please provide more information.
    Thanks,
    Vasu Natari.

  • Addin popup menu

    i have a JList contained in a JScrollPAne. HOw do i add a popup menu to the items within the list. When i right click the menu should popup. I tried adding the popup menu using
    scrollpane.add(popup);
    It s not responding to the rght clicks

    Usually, popup menu is invoked from a mouse listener.
    You could add a mouse listener on JList. Its javdoc is a good documentation.

Maybe you are looking for

  • Where can I purchase a replacement CD for the Airport Express Base station A1264?

    Where can I purchase a replacement CD for the Airport Express Base station A1264? I'd like to sell my Airport Base Station, but I believe I need a CD with the software on it for the new owner. Anyone know where I can find one? Thanks! Meredith

  • Lost settings icon on upgrade

    I lost my settings icon when I upgraded my new I phone 4. I was not at home, I did not back up on my computer. I do not have any search options. I have checked every folder multiple times, it no longer exists. Is there somewhere online I can reinstal

  • My the contents ipad email messages are being overwritten by subsequent email messages

    I've got a popd email account which I access through a 4th gen IPAD, which was running 8.11.  The contents of two  messages (which had a lot of jpgs attached) was overwritten by a different email which arrived later in the day.  So the subject line i

  • 2 iPhones with 1 iCloud account

    I have two iphones that share the same iCloud account. If I delete the account off of one phone, will it delete the account off of the other phone?

  • Trigger Best Practices Question

    Hi Guys, I want to create a table that storing last changes in the application and also can be used as a logging purpose. I decided to use trigger, this is mean I am going to have trigger of all type (ON DELETE, ON INSERT, ON UPDATE) My question is,