Displaying pop up on click of commandMenuItem

Hello,
I wan to display popup window when I click on commandMenuItem
<af:popup binding="#{backing_showData.delPopup}" id="delPopup">
<af:commandMenuItem text="Item One"
binding="#{backing_showData.deleteRow}"
partialTriggers="logTable" action="#{backing_showData.moveAction}"
id="deleteRow"
disabled="#{!bindings.Delete.enabled}"/>
<af:clientListener method="loadItem" type="click"/>
</af:commandMenuItem>
I am calling client listener to show pop up , this function get called and popup component is there on the page, but popup.show() does not do anything , any idea?
function loadItem(event) {
alert("clicking to show popup ");
var popup = AdfPage.PAGE.findComponent("delPopup");
popup.show();
}

Hi!
First, your code is not correct: clientListener does not have property name but method for client script invokation.
Second, as you have not provided complete page, I cannot tell you if something else is wrong.
Anyhow, the folowing page works fine for me in FF3.0.3:
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0" xmlns:f="http://java.sun.com/jsf/core"
          xmlns:h="http://java.sun.com/jsf/html" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
          xmlns:dvt="http://xmlns.oracle.com/dss/adf/faces">
  <jsp:directive.page contentType="text/html;charset=UTF-8"/>
  <f:view>
    <af:document>
      <af:messages/>
      <af:form>
        <af:table value="#{bindings.SampleGraphDataRow.collectionModel}" var="row"
                  rows="#{bindings.SampleGraphDataRow.rangeSize}"
                  emptyText="#{bindings.SampleGraphDataRow.viewable ? 'No rows yet.' : 'Access Denied.'}"
                  fetchSize="#{bindings.SampleGraphDataRow.rangeSize}"
                  selectedRowKeys="#{bindings.SampleGraphDataRow.collectionModel.selectedRow}"
                  selectionListener="#{bindings.SampleGraphDataRow.collectionModel.makeCurrent}" rowSelection="single"
                  contextMenuId="myRightClickMenuPopup">
          <af:column sortProperty="year" sortable="false" headerText="#{bindings.SampleGraphDataRow.hints.year.label}">
            <af:outputText value="#{row.year}"/>
          </af:column>
          <af:column sortProperty="value" sortable="false"
                     headerText="#{bindings.SampleGraphDataRow.hints.value.label}">
            <af:outputText value="#{row.value}">
            </af:outputText>
          </af:column>
        </af:table>
        <af:popup id="myRightClickMenuPopup">
          <af:menu id="newMenu">
            <af:commandMenuItem id="item1" text="first item"/>
            <af:commandMenuItem id="item2" text="second item"/>
            <af:commandMenuItem id="item3" text="third item">
              <af:clientListener type="click" method="test"/>
            </af:commandMenuItem>
          </af:menu>
        </af:popup>
      </af:form>
      <f:facet name="metaContainer">
        <f:verbatim>
          <script>
                function test(e) {
                    alert(e);
            </script>
        </f:verbatim>
      </f:facet>
    </af:document>
  </f:view>
</jsp:root>Regards,
PaKo

Similar Messages

  • Can I change where on the screen the "get info" display pops up?

    Can I change where on the screen the "get info" display pops up? I have dual 23" cinema displays and the Get Info box always pops up inconveniently on the far, far left. Is there a way to change the default location, more towards the middle, where it would fit better into my work flow?

    treetopstudio,
    I'm not sure to change the default of Get Info but what you could do is open the Inspector instead it 1 remembers it location when you close it and 2 when you click on another icon in finder changes to that. To open it instead of the get info window Option + Command + i or hold Option and click File show Inspector.
    Hope that helps,
    Weston

  • Battery , time , signal strength bar is not getting displayed in home screen , these will be displayed only when i click on any app. Can u let me know the setting change ?

    Battery , time , signal strength bar is not getting displayed in home screen , these will be displayed only when i click on any app. Can u let me know the setting change ?

    Did you check the Zoom setting?
    Have you tried a reset (reboot)? Hold HOME and SLEEP until an Apple logo appears.
    If it isn't Zoom and a reboot doesn't help try Settings/General/Reset - Reset all settings

  • I cannot change the value in about:newtab from "newtab" to "blank." The dialog is displayed but when I click Ok, the value is not changed.

    I cannot change the value in about:newtab from "newtab" to "blank." The dialog is displayed but when I click Ok, the value is not changed.
    ===Answer===
    Comment on usual method and solution, by a forum Moderator.
    As long as there are no confounding factors, such as certain extensions, or a user.jsfile the procedure is as follows
    # Open a new tab and type "about:config" in the address bar.
    # In the Search bar type: "newtab"
    # Locate and double click "browser.newtab.url"
    # In the "Enter String Value" box change "'''about:newtab'''" to "'''about:blank'''" and click OK.
    # Verify that the value has changed and now all new tabs will be blank.
    See post under by ''pirate048'' [/questions/976589?page=2#answer-509482] ~J99

    Have to say that I rather agree with Mark..all we want is a simple, unadorned clean page that doe not track and show usage!! WHY NOT!! Is it too simple for developers..we aren't all (nor do we want to be!) software experts! Come on Mozilla..tidy up and clean up..it might be a quicker programme too!!

  • How to display a seperate right click menu for each item of a tree control?

    Hi I want to display a specific right click menu when a particular tree item is selected. I know how to create a menu and how to display it. I am using the function GetLabelFromIndex() to get the active tree item and then compare the label and based on the result display a manu for that item. Now my problem is that when I use the above function in the EVENT_RIGHT_CLICK it gives me the error "the Index passed is out of range" while using the same function with the same arguments in EVENT_SELECTION_CHANGE it gives no error...below is the part of my code
    case EVENT_RIGHT_CLICK:
    GetLabelFromIndex(panelHandle, PANEL_TREE, eventData2, label1);
    //The function gives the stated error here
    if(eventData1)//after it I compare the result and display the menu
    case EVENT_SELECTION_CHANGE:
    GetLabelFromIndex (panelHandle, PANEL_TREE, eventData2, label1);
    //The function works fine here
    if (eventData1)
     If any one have any idea whats going on or alternate way of doing this Please share knowledge...Thanks
    If you are young work to Learn, not to earn.

    Hi,
    one possible approach of solving this problem is looking closer at the error message: The error "the Index passed is out of range" tells you that something is wrong with the index, either it is too small or too large So why don't you set a breakpoint and check the index value, it might be useful information...
    The other hint is to check the meaning of eventdata2 (using the help): It is different for different events! For the event_right_click it gives the horizontal mouse position, not the index as event_selection_change does...

  • Display pop ups in the jsp by using Java script

    Hi
    can any body say ,how to display pop ups in the jsp by using Java script ?

    that's correct. You can use the below code for AJAX request.
    <script type="text/javascript">
    var httpObject = getHTTPObject();
    //create XMLHttpRequest object
    function getHTTPObject() {     
         var xmlhttp;
         if (window.XMLHttpRequest) // if Mozilla, Safari etc
              xmlhttp = new XMLHttpRequest();
         else if (window.ActiveXObject){ // if IE
              try {
                   xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
              catch ( e ){
                   try{
                        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                   catch ( e ){}
         return xmlhttp;
    //define the function to send the request
    function sendRequest(){
        var currDesc = document.getElementById("description").value;
        var URL =  "manageMaintAction.do"; //action mapping in your struts-config
        var queryString = "currDesc="+escape(currDesc); //get the currDesc value in your action class like request.getParameter("currDesc")
        httpObject.open( "Post", URL, true );
        httpObject.onreadystatechange = cbFn;
        httpObject.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded");
        httpObject.send(queryString);
    //callback fn
    function cbFn() {
        if (httpObject.readyState == 4)
             if (httpObject.status == 200)
              var result = httpObject.responseText;
              alert(result);
    </script>

  • Help with XML, display data on swipe/click

    Hello.
    I am trying to create a moibile app that displays XML data. It's basically a phone book. I want the data to change when swiped. I can get the data in just fine. I can get it to display fine. I am not seeing the correct image first, however. I think it's a problem with my imagenum variable.
    Then, I want to change what is displayed when the user clicks/swipes on the screen. How do I do that?
    stop();
    var nameArray:Array = new Array();
    var countryArray:Array = new Array();
    var portraitArray:Array = new Array();
    var flagArray:Array = new Array();
    var jobtitleArray:Array = new Array();
    var imageNum:Number=0;
    var totalImages:Number;
    //Load XML
    var XMLURLLoader:URLLoader = new URLLoader();
    XMLURLLoader.load(new URLRequest("recbook.xml"));
    XMLURLLoader.addEventListener(Event.COMPLETE, processXML);
    function processXML(event:Event):void {
    var theXMLData:XML = new XML(XMLURLLoader.data);
    totalImages=theXMLData.name.length();
    for (var i:Number =0; i < totalImages; i++){
      //push xml data into the arrays
      nameArray.push(theXMLData.name[i]);
      countryArray.push(theXMLData.country[i]);
      portraitArray.push(theXMLData.portrait[i]);
      flagArray.push(theXMLData.flag[i]);
      jobtitleArray.push(theXMLData.jobtitle[i]);
    //data is processed
    loadData();
    function loadData():void {
    var thisPortrait:String = portraitArray[imageNum];
    var thisCountry:String = countryArray[imageNum];
    var thisName:String = nameArray[imageNum];
    var thisJobtitle:String = jobtitleArray[imageNum];
    var thisFlag:String = flagArray[imageNum];
    var dataLoader:Loader = new Loader();
    dataLoader.load(new URLRequest(portraitArray[imageNum]));
    dataLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, dataLoaded);
    function dataLoaded(event:Event):void {
      //I want to start with image 0 (img1.jpg) and cycle through with a mouse click (finger swipe on iOS)
      stage.addEventListener(MouseEvent.CLICK, loadMainImage1);
      function loadMainImage1(event:MouseEvent):void {
       portraitUILoader.source=thisPortrait;
       flagUILoader.source=thisFlag;
       selectedName.text=thisName;
       selectedCountry.text=thisCountry;
       selectedJobtitle.text=thisJobtitle;
    //add to imageNum (1);
    imageNum++;
    if (imageNum < totalImages) {//stopping at img2
      trace("imageNum " + imageNum);
      trace("image name (thisPortrait) " + thisPortrait);//losing image 4 somewhere
      loadData();
      trace("Total Images " + totalImages);
    //click to move past the home screenI'd like to ditch this. don't know how.
    homeScreen_mc.addEventListener(MouseEvent.CLICK, goNext);
    function goNext(event:MouseEvent):void
    nextFrame();
    */here's the output:
    imageNum 1
    image name (thisPortrait) images/img1.jpg
    imageNum 2
    image name (thisPortrait) images/img2.jpg
    imageNum 3
    image name (thisPortrait) images/img3.jpg
    Total Images 4
    Total Images 4
    Total Images 4
    Total Images 4
    It starts the display on image 1 (the second in the series img2.jpg)*/

    Thank you.
    That helped. I get the correct images in the output, but not in the display. I also get the following error. Any chance you could help with that?
    new output after moving the increment:
    imageNum 0
    image name (thisPortrait) images/img1.jpg
    imageNum 1
    image name (thisPortrait) images/img2.jpg
    imageNum 2
    image name (thisPortrait) images/img3.jpg
    imageNum 3
    image name (thisPortrait) images/img4.jpg
    TypeError: Error #2007: Parameter url must be non-null.
    at flash.display::Loader/_load()
    at flash.display::Loader/load()
    at iOS_fla::MainTimeline/loadData()
    at iOS_fla::MainTimeline/loadData()
    at iOS_fla::MainTimeline/loadData()
    at iOS_fla::MainTimeline/loadData()
    at iOS_fla::MainTimeline/loadData()
    at iOS_fla::MainTimeline/processXML()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()

  • Hi there, I want to change the background-color of the browser, when a popup-picture is shown. This picture pops up by clicking a hyperlink in the text...can anyone help me please...thanks a lot

    Hi there, I want to change the background-color of the browser, when a popup-picture is shown. This picture pops up by clicking a hyperlink in the text...can anyone help me please...thanks a lot

    Hi,
    CSS is interpreted by your browser, so server cache seems unlikely in htis case. There is however some hierarchy in CSS, so parts of the APEX CSS, theme CSS or page CSS might overwright or block yours.
    Does changing the CSS on runtime affect your page? Eg, run the following in your browser console and see if your page turns black: $('#uBodyContainer').css("background-color","black")
    Also try moving up your css in the hierarchy labeling it as important:
    div#uBodyContainer { 
      background-color:#000000 !important;  
    See:Assigning property values, Cascading, and Inheritance
    Regards,
    Vincent
    http://vincentdeelen.blogspot.com

  • How to Display a Calender upon clicking the dropdown list inside a table co

    Hi,
    I have a Listbox inside my table control and I need to Display a Calender upon clicking the dropdown list.
    Can any body help.
    Srinivas

    Hi,
    Try this:
    On your customizing screen,
    PROCESS ON VALUE-REQUEST.          
        Field T_ZT-SDATE
          module create_dateselect.
    In your main program:
    module create_dateselect.
    data:p_date like sy-datum.
    CALL FUNCTION 'F4_DATE'
       EXPORTING
         holiday_calendar_id = 'CN'                   
         display = ' '
       IMPORTING
         select_date = p_date
       EXCEPTIONS
         OTHERS = 4.
    t_zt-sdate = p_date.
    endmodule.
    Regards,
    Pole

  • I try to drag a photo folder into lightroom 4 on my MAC, lightroom fails to open and a 'Corrupt Catalog Detected' screen pops up.  Clicking on 'repair catalog' does not work either.  Any suggestions?

    I try to drag a photo folder into lightroom 4 on my MAC, lightroom fails to open and a 'Corrupt Catalog Detected' screen pops up.  Clicking on 'repair catalog' does not work either.  Any suggestions?

    I'll have to get a better instructor on deleting the preferences since when I've doen it in the past nothing is there when I open LR the catalog is gone. I assumed that was what was supposed to happen so I start importing all over again.  But that is a different issue...
    The problem has been happening since at least the beta of 3 came out and I saw other posts back then saying they had similar issues but I assume it was a beta thing...  But since the full version came out and through each incremental change I haven't seen an improvement. If anything it has gotten a little worse with time.
    I have to try to be careful to not be in a hurry and start clicking around in the catalog as it seems fragile until it has cataloged all the photos in the library. When starting you will see the numbers populate the folders very slowly and I try not to click on a folder that hasn't had the number of photos pop up yet. Also draging the slider down to see more of the cataloge can have the same affect and crash the system.
    I wish I had more to go on.. I believe it may be a resources issue but as I went from 3-4 Gig I thought it would get better. I don't have big programs running but did have outlook and word running in the background along with firefox and chrome.
    And yes it only happens on this HP desktop (it's 2+ yrs old) and may be showing it's age a bit. My laptop which has less resources doesn't have the issue.. I have them sharing the catalog. (not at the same time) just when I'm working in other places in the house.
    Jeff

  • FS10N Not display document with double click

    Hi, friends:
    Not display document with double click
    I am in the list of open items in transaction FS10N and when a wont to see a document by doing a double click in the line, instead of showing the document it shows the data of the line.
    Does anybody know the reason behind it? How can I resolve it?
    Thanks in advance.

    Hello,
    There could be two reasons:
    1. The account would not have been maintained with line item display.
    2. In case if the account has been created with line item display, then still you are not able to get the drill down (meaning that you are able to get the line items in FBL3N), in that case, immediately once you get the error, go to transaction code SU53. It will tell you the authorizations you are missing. You can forward that screen shot to your authorization team and they will give your proper authorization for drill down.
    Thanks,
    Ravi

  • Displaying pop-up menu on jsp after clicking a link ?

    Hi all...
    I have an application in which i have a jsp page.. I am displaying some links on it.
    Now i want that when i right click mouse on particular link then it should show me a pop-up aside and should populate that pop-up with the items i want (say some strings like "India","USA","UK" ). When i will select one item from those in pop-up that should replace the link i clicked. Though my page is jsp, it has basic HTML coding with the form which contains all those links.. Shall i write a javascript function for the same or there exist any control which i can use..
    Can someone help in this regard ??
    Thank you for attending the question...
    Regards
    Prasad

    Try this .. It worked for me....
    index.html
    <HTML><HEAD></HEAD>
    <SCRIPT LANGUAGE="JavaScript">
    function openChild(file,window) {
        childWindow=open(file,window,'resizable=no,width=200,height=400');
        if (childWindow.opener == null)
         childWindow.opener = self;
    </SCRIPT>
    <BODY>
    <FORM NAME="parentForm">
    <a href="" title="one" id="one" onContextMenu="openChild('examplejs2.html',this.title); return false;">ONE</a>
    <br>
    <a href="" title="two" id="two" onContextMenu="openChild('examplejs2.html',this.title); return false;">TWO</a>
    <br>
    <a href="" title="three" id="three" onContextMenu="openChild('examplejs2.html',this.title); return false;">THREE</a>
    </FORM>
    </BODY></HTML>examplejs2.html
    <HTML><HEAD>
    <SCRIPT LANGUAGE="JavaScript">
    function updateParent() {
        opener.document.getElementById(window.name).innerHTML = document.childForm.cf1.value;
        opener.document.getElementById(window.name).title = document.childForm.cf1.value;
        opener.document.getElementById(window.name).id = document.childForm.cf1.value;
        self.close();
        return false;
    </SCRIPT>
    </HEAD><BODY>
    <FORM NAME="childForm" onSubmit="return updateParent();">
    <BR><INPUT NAME="cf1" TYPE="TEXT" VALUE="">
    <BR><INPUT TYPE="SUBMIT" VALUE="Update parent">
    </FORM>
    </BODY></HTML>I got it from here - [update parent|http://www.rgagnon.com/jsdetails/js-0066.html]
    And made some changes to it.
    U can use the window name, which is unique and use ajax to go to server and fetch values and then populate the chid window and change the input accordingly...
    Let me know if u have any probs
    Regards,
    Sundar

  • Need Help: JTable POP up menu in a CellEditor to display on a right click

    This was from a previous post:
    I am trying to make a POP menu in a JTextComponent that has a assigned JEditorPane for a HTMLDocument to make use of the HTMLEditorKit to allow modifying HTML by the POP up menu.
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    import javax.swing.table.*;
    import javax.swing.text.html.*;
    import javax.swing.undo.*;
    import javax.swing.border.*;
    import javax.swing.filechooser.*;
    public class SimpleTableDemo extends JFrame {
        public SimpleTableDemo() throws Exception {
            final JTable table = new JTable(new MyTableModel());
            table.setPreferredScrollableViewportSize(new Dimension(500, 70));
            TableColumn fileColumn = table.getColumnModel().getColumn(2);
            FileTableCellEditor editor = new FileTableCellEditor();
            fileColumn.setCellRenderer(editor);
            fileColumn.setCellEditor(editor);
            JScrollPane scrollPane = new JScrollPane(table);
            getContentPane().add(scrollPane, BorderLayout.CENTER);
            addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                System.exit(0);
                table.setRowHeight(100);
            public static void main(String[] args) throws Exception {
                SimpleTableDemo frame = new SimpleTableDemo();
                frame.pack();
                frame.setVisible(true);
            class MyTableModel extends AbstractTableModel {
                String[] columnNames = {"First Name","Last Name","HTML File"};
                public Object[][] data;
                MyTableModel() throws Exception
                    data = createArray();
                private Object[][] createArray() throws Exception
                    Object[][] data = {{"One", "Andrews", createDoc("file1.html")}
                return data;
                private Document createDoc(String url) throws Exception
                    File file = new File(url);
                    URL baseURL = file.toURL();
                    InputStream in = baseURL.openStream();
                    InputStreamReader r = new InputStreamReader(filterTag(in));
                    HTMLEditorKit kit = new HTMLEditorKit();
                Document doc = kit.createDefaultDocument();
                kit.read(r,doc,0);
                return doc;
                } // workaround for HTMLEditorKit.Parser, cant deal with "content-encoding"
                private InputStream filterTag(InputStream in) throws IOException {
                    DataInputStream dins = new DataInputStream( in);
                    ByteArrayOutputStream bos = new ByteArrayOutputStream(10000);
                    DataInputStream din = new DataInputStream(new BufferedInputStream(in));
                    while (din.available() > 0) {
                    String line = din.readLine();
                    String lline = line.toLowerCase();
                    if (0 <= lline.indexOf("<meta ")) // skip meta tags
                    continue;
                    bos.write( line.getBytes());
                    din.close();
                    return new ByteArrayInputStream( bos.toByteArray());
                public int getColumnCount() {
                    return columnNames.length;
                public int getRowCount() {
                    return data.length;
                public String getColumnName(int col) {
                    return columnNames[col];
                public Object getValueAt(int row, int col) {
                    return data[row][col];
                public Class getColumnClass(int c) {
                    return getValueAt(0, c).getClass();
                public boolean isCellEditable(int row, int col) {
                if (col >< 1) {
                    return false;
                } else {
                    return true;
    public class FileTableCellEditor extends JScrollPane implements TableCellEditor , TableCellRenderer
        public JTextComponent jtext;
        JEditorPane editor;
        HTMLEditorKit kit = new HTMLEditorKit();
        HTMLDocument doc = new HTMLDocument();;
        private EventListenerList listenerList = new EventListenerList();
        private ChangeEvent event = new ChangeEvent(this);
        public FileTableCellEditor()
        editor = new JEditorPane();
        editor.setContentType("text/html");
        doc=new HTMLDocument();
        editor.addMouseListener(new MouseHandler());
        editor.setEditorKit(kit);
        editor.setDocument(doc);
        editor.setEditable(true);
        editor.setCaretColor(Color.RED);
        getViewport().setView(editor);
        setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
        setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
        public Component getTableCellRendererComponent(JTable table, Object value,
        boolean isSelected, boolean hasFocus, int row, int column)
            // System.out.println("has focus: "+hasFocus+", isSelected: "+isSelected);
            if (isSelected)
            table.editCellAt(row,column);
        table.editCellAt(row,column);
        return getTableCellEditorComponent(table,value,isSelected, row, column);
        public Component getTableCellEditorComponent(JTable table,
        Object value, boolean isSelected, int row, int column)
        editor.setDocument((Document)value);
        return this;
        public boolean isCellEditable(EventObject anEvent)
        { return true;
        public boolean shouldSelectCell(EventObject anEvent)
        { return true;
        public void cancelCellEditing()
        { fireEditingStopped();
        public boolean stopCellEditing()
        { return true;
        public Object getCellEditorValue()
        { return null;
        public void addCellEditorListener(CellEditorListener l)
        { listenerList.add(CellEditorListener.class, l);
        public void removeCellEditorListener(CellEditorListener l)
        { listenerList.remove(CellEditorListener.class, l);
        protected void fireEditingStopped()
        { Object[] listeners = listenerList.getListenerList();
        for (int i = listeners.length - 2; i >= 0; i -= 2)
        ((CellEditorListener)listeners[i+1]).
        editingStopped(event);
        protected void fireEditingCanceled()
        { Object[] listeners = listenerList.getListenerList();
        for (int i = listeners.length - 2; i >= 0; i -= 2)
        ((CellEditorListener)listeners[i+1]).
        editingCanceled(event);
            ///////////createPopupMenu///////////////
            protected JPopupMenu createPopupMenu()
            JPopupMenu popup =new JPopupMenu();
            popup.add(getTextComponent().getActionMap().get(HTMLEditorKit.cutAction)).setAccelerator(null);
            popup.add(getTextComponent().getActionMap().get(HTMLEditorKit.copyAction)).setAccelerator(null);
            popup.add(getTextComponent().getActionMap().get(HTMLEditorKit.pasteAction)).setAccelerator(null);
            popup.addSeparator();
            popup.add(getTextComponent().getActionMap().get("font-bold"));
            popup.add(getTextComponent().getActionMap().get("font-italic"));
            popup.add(getTextComponent().getActionMap().get("font-underline"));
            //popup.add(getTextComponent().getActionMap().get("break"));
            return popup;
        public JTextComponent getTextComponent()
             return jtext;
        protected class MouseHandler extends MouseAdapter{
           public void mouseReleased(MouseEvent me){
               if(me.getButton()==MouseEvent.BUTTON3){
               Point p=me.getPoint();
               createPopupMenu().show((Component)me.getSource(),p.x,p.y);
    }

    I got the pop up to work, I had to go back to and add a createActionTable editor that is a JEditorPane, vs the JTextComponent!
    Here is the latest version:
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.util.HashMap;
    import javax.swing.*;
    import javax.swing.undo.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    import javax.swing.table.*;
    import javax.swing.text.html.*;
    import javax.swing.undo.*;
    import javax.swing.border.*;
    import javax.swing.filechooser.*;
    public class SimpleTableDemo extends JFrame {
        public SimpleTableDemo() throws Exception {
            final JTable table = new JTable(new MyTableModel());
            table.setPreferredScrollableViewportSize(new Dimension(500, 70));
            TableColumn fileColumn = table.getColumnModel().getColumn(2);
            FileTableCellEditor editor = new FileTableCellEditor();
            fileColumn.setCellRenderer(editor);
            fileColumn.setCellEditor(editor);
            JScrollPane scrollPane = new JScrollPane(table);
            getContentPane().add(scrollPane, BorderLayout.CENTER);
            addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                System.exit(0);
                table.setRowHeight(100);
            public static void main(String[] args) throws Exception {
                SimpleTableDemo frame = new SimpleTableDemo();
                frame.pack();
                frame.setVisible(true);
            class MyTableModel extends AbstractTableModel {
                String[] columnNames = {"First Name","Last Name","HTML File"};
                public Object[][] data;
                MyTableModel() throws Exception
                    data = createArray();
                private Object[][] createArray() throws Exception
                    Object[][] data = {{"One", "Andrews", createDoc("file1.html")}
                return data;
                private Document createDoc(String url) throws Exception
                    File file = new File(url);
                    URL baseURL = file.toURL();
                    InputStream in = baseURL.openStream();
                    InputStreamReader r = new InputStreamReader(filterTag(in));
                    HTMLEditorKit kit = new HTMLEditorKit();
                Document doc = kit.createDefaultDocument();
                kit.read(r,doc,0);
                return doc;
                } // workaround for HTMLEditorKit.Parser, cant deal with "content-encoding"
                private InputStream filterTag(InputStream in) throws IOException {
                    DataInputStream dins = new DataInputStream( in);
                    ByteArrayOutputStream bos = new ByteArrayOutputStream(10000);
                    DataInputStream din = new DataInputStream(new BufferedInputStream(in));
                    while (din.available() > 0) {
                    String line = din.readLine();
                    String lline = line.toLowerCase();
                    if (0 <= lline.indexOf("<meta ")) // skip meta tags
                    continue;
                    bos.write( line.getBytes());
                    din.close();
                    return new ByteArrayInputStream( bos.toByteArray());
                public int getColumnCount() {
                    return columnNames.length;
                public int getRowCount() {
                    return data.length;
                public String getColumnName(int col) {
                    return columnNames[col];
                public Object getValueAt(int row, int col) {
                    return data[row][col];
                public Class getColumnClass(int c) {
                    return getValueAt(0, c).getClass();
                public boolean isCellEditable(int row, int col) {
                if (col < 1) {
                    return false;
                } else {
                    return true;
    public class FileTableCellEditor extends JScrollPane implements TableCellEditor , TableCellRenderer
        JEditorPane editor = new JEditorPane();
        HTMLEditorKit kit = new HTMLEditorKit();
        HTMLDocument doc = new HTMLDocument();;
        private EventListenerList listenerList = new EventListenerList();
        private ChangeEvent event = new ChangeEvent(this);
        HashMap<Object, Action> actions;
        public FileTableCellEditor()
        getContentPane();
        editor.setContentType("text/html");
        doc=new HTMLDocument();
        editor.addMouseListener(new MouseHandler());
        editor.setEditorKit(kit);
        editor.setDocument(doc);
        editor.setEditable(true);
        editor.setCaretColor(Color.RED);
        getViewport().setView(editor);
        createActionTable(editor);
        makeActionsPretty();
        setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
        setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
        public void makeActionsPretty(){
             Action a;
                      a=editor.getActionMap().get(HTMLEditorKit.cutAction);
                      a.putValue(Action.SHORT_DESCRIPTION,"Cut");
                      a.putValue(Action.ACCELERATOR_KEY,KeyStroke.getKeyStroke('X',Event.CTRL_MASK));
                      a=editor.getActionMap().get(HTMLEditorKit.copyAction);
                      a.putValue(Action.NAME,"Copy");
                      a.putValue(Action.SHORT_DESCRIPTION,"Copy");
                      a.putValue(Action.ACCELERATOR_KEY,KeyStroke.getKeyStroke('C',Event.CTRL_MASK));
                      a=editor.getActionMap().get(HTMLEditorKit.pasteAction);
                      a.putValue(Action.NAME,"Paste");
                      a.putValue(Action.SHORT_DESCRIPTION,"Paste");
                      a.putValue(Action.ACCELERATOR_KEY,KeyStroke.getKeyStroke('V',Event.CTRL_MASK));
        public Component getTableCellRendererComponent(JTable table, Object value,
        boolean isSelected, boolean hasFocus, int row, int column)
            if (isSelected)
            table.editCellAt(row,column);
        table.editCellAt(row,column);
        return getTableCellEditorComponent(table,value,isSelected, row, column);
        public Component getTableCellEditorComponent(JTable table,
        Object value, boolean isSelected, int row, int column)
        editor.setDocument((Document)value);
        return this;
        public boolean isCellEditable(EventObject anEvent)
        { return true;
        public boolean shouldSelectCell(EventObject anEvent)
        { return true;
        public void cancelCellEditing()
        { fireEditingStopped();
        public boolean stopCellEditing()
        { return true;
        public Object getCellEditorValue()
        { return null;
        public void addCellEditorListener(CellEditorListener l)
        { listenerList.add(CellEditorListener.class, l);
        public void removeCellEditorListener(CellEditorListener l)
        { listenerList.remove(CellEditorListener.class, l);
        protected void fireEditingStopped()
        { Object[] listeners = listenerList.getListenerList();
        for (int i = listeners.length - 2; i >= 0; i -= 2)
        ((CellEditorListener)listeners[i+1]).
        editingStopped(event);
        protected JPopupMenu createPopupMenu()
            JPopupMenu popup =new JPopupMenu();
            popup.add(getActionByName(DefaultEditorKit.cutAction));
            return popup;
        protected class MouseHandler extends MouseAdapter{
           public void mouseReleased(MouseEvent me){
               if(me.getButton()==MouseEvent.BUTTON3){
               Point p=me.getPoint();
               createPopupMenu().show((Component)me.getSource(),p.x,p.y);
        private void createActionTable(JTextComponent textComponent) {
            actions = new HashMap<Object, Action>();
            Action[] actionsArray = textComponent.getActions();
            for (int i = 0; i < actionsArray.length; i++) {
                Action a = actionsArray;
    actions.put(a.getValue(Action.NAME), a);
    private Action getActionByName(String name) {
    return actions.get(name);

  • How to trigger a pop-up on click of dial button on IC web UI  - CRM 7.0

    I want to enahcne the standard button 'Dial' that is displayed on Interaction center web UI.
    I am trying to show a custom popup with list of phone numbers of the BP for the sales agent to select from.
    I created the custom component to display the data but I am not able to locate the event handler to trigger the pop-up from.
    Can anybody help me with this?
    Thanks in advance,
    Nalini.

    Hi Ram,
    I am still facing problems in the same. I am doing the steps as below.
    Please see if there is anything wrong or anything else that I need to do.   In my case, the method IF_CRM_IC_EVENT_LISTENER~HANDLE_EVENT for the custom controller is not getting triggered where i am handling the event.
    Do I need to call the same explicitly?
    Class: ZL_CRMCMP_I_CUCOHIDDENVIE_IMPL
    Attribute: G_INSTANCE   Static Attribute    Private  Type Ref To     ZL_CRMCMP_I_CUCOHIDDENVIE_IMPL
    Method :  GET_INSTANCE   Static Method   Public
    parameters: RV_INSTANCE   Returning  Type Ref To   ZL_CRMCMP_I_CUCOHIDDENVIE_IMPL
    code:
      if g_instance is not bound.
    create object g_instance.
    endif.
    rv_instance = g_instance.
    Method CONSTRUCTOR.
    Code:
    CALL METHOD SUPER->CONSTRUCTOR
    constants: lc_start_event type string value 'InteractionEnded'.
    data: lr_event_service type ref to cl_crm_ic_event_srv.
    subsrbing for the event.
    lr_event_service ?= cl_crm_ic_services=>get_event_srv_instance( ).
    check whether the service is bound.
    if lr_event_service is bound.
    call method lr_event_service->if_crm_ic_event_srv~subscribe
    exporting
    event_name = lc_start_event
    listener = me.
    endif.
    method IF_CRM_IC_EVENT_LISTENER~HANDLE_EVENT.
    data: name type string.
      name = event->get_name( ).
    CASE name.
      WHEN 'END'.
                 code to create pop up
      WHEN OTHERS.
    ENDCASE.
    Enhanced class : CL_CRMCMP_I_HIDDENVIEW_IMPL
    If i create the post exit for method DO_INIT, it is not triggered when the END button is clicked.
    Post Exit for method IF_CRM_IC_EVENT_LISTENER~HANDLE_EVENT
    code:
    data:lr_inst type ref to zl_crmcmp_i_cucohiddenvie_impl.
    CALL METHOD zl_crmcmp_i_cucohiddenvie_impl=>get_instance
    receiving
    rv_instance = lr_inst
    Please help me. I need to deliver this ASAP. My exact requiremnt is to dispaly a pop up wen END button is clicked. If user selects Yes, the data shall be saved  as per the standard functionality of the END button and I he selects No, then the data shall not be saved
    Thanks in advance,
    Alka Gangal

  • How to prevent java.util.logging from displaying pop-up dialog on SEVERE?

    Hi,
    I'm new to using java.util.logging. I notice that whenever I try to make a call to logger.SEVERE(msg) or logger.WARNING(msg), not only does it write the output to file (which I want), but it also pops up a dialog box displaying the exception. I don't want this pop up to appear. How do I prevent the logger from doing this?

    What are you talking about?
    Hello,
    In order to better assist you with your issue please provide us with a screenshot. If you need help to create a screenshot, please see [[How do I create a screenshot of my problem?]]
    Once you've done this, attach the saved screenshot file to your forum post by clicking the '''Browse...''' button below the ''Post your reply'' box. This will help us to visualize the problem.
    Thank you!

Maybe you are looking for

  • Update a maintenance view.

    Hi , I want to update a maintenance view. Data is coming from a text file which i am uplaoding. Which function module should I use to update the maintenence view. Thanks, Ram.

  • Network Cable Unplugged, even though it is not (this one is fun, I promise!)

    I am plugging my computer into my Linksys router (this computer will not be connecting wirelessly).  Unfortunately my computer believes that the network cable is unplugged.  Allow me to provide some details before we continue! Router: Linksys WRT54GL

  • IC WebClient cookbook - CRM 5.0

    Hi all, Can anyone please send me IC Web Client Cookbook for CRM 5.0. I have the Cook book for 4.0 but there are few things that have been changed in the new release. Thanks, Preethi

  • IMac / Airport Extreme

    My new iMac has Airport Extreme. Currently I use the RJ45 jack to connect to my cable modem. I just purchased an Airport Express for the Airtunes feature. Can I enable Airport Extreme to link with the Express and still be wired to my cable modem? Or

  • Apps stopped updating

    I started updating apps after being away on vacation.  It loaded 11 updates then stopped. Tried to turn phone off but still stuck on page with half the apps updated and the rest not doing anything.  Anyone have this problem before?