Dynamic JPopup Menu

Can anybody help me in developing Dynamic JPopup Menu. I want to create a different pop-ups for different nodes of JTree.
Any help in this regard is highly appreciable.
Regards
Raheel

Well, you could store the name of a popup class with each node
in the XML so that when you load the xml to generate the nodes
you save off the popup class name and when you right click on
a node you popup the node specific popup. That way you could add
popup menus without having to change any code. The other way
would be to look at the node when the user right clicks and create
the popup dynamically based on the node. If you have many
different popup configurations, loading them with the XML would
probably be the easiest to maintain, assuming you have control
over the XML.
Have fun!
Matt

Similar Messages

  • Setting the Default Value for a dynamic select menu

    Hi I have a php page with 2 forms on it, one feeds the other to achieve a drill down (manufacturer > model). In the second select menu I have a default static value "Select Aircraft Model", I want to set a value for the first dynamic select menu to read "Select Aircraft Manufacturer". When I add a static value to my list it tells me I alreay have a dynamic behavior on this menu and to choose a different one. I have included the code for both menus. Thank you in advance, I know this must be a stupid question, but it's got me stumped.
    Tom
    //This is the menu I want to add the default static value to//
    <td width="667"><select name="airMake" style="width: 200px;"onchange="this.form.submit();" id="airMake">
            <?php
    do {
    ?>
            <option value="<?php echo $row_rsAirManufacturer['aircraft_manufacturer']?>"<?php if (!(strcmp($row_rsAirManufacturer['aircraft_manufacturer'], ((isset($_POST["airMake"]))?$_POST["airMake"]:"")))) {echo "selected=\"selected\"";} ?>><?php echo $row_rsAirManufacturer['aircraft_manufacturer']?></option>
            <?php
    } while ($row_rsAirManufacturer = mysql_fetch_assoc($rsAirManufacturer));
      $rows = mysql_num_rows($rsAirManufacturer);
      if($rows > 0) {
          mysql_data_seek($rsAirManufacturer, 0);
          $row_rsAirManufacturer = mysql_fetch_assoc($rsAirManufacturer);
    ?>
          </select>
          </td>
      </tr>
    </table></form>
        <form action="quoteResult.php" method="post" name="quoteForm">
          <table width="100%" border="0" cellpadding="5px">
            <tr>
              <td width="260"style="color: #000; text-align: right;">Aircraft Model:</td>
              <td colspan="2"><span id="spryselect2">
    //This is the menu that works correctly//
                <select name="airModel" style="width: 200px;" id="airModel">
                  <option value="" <?php if (!(strcmp("", ((isset($_POST["airMakeField"]))?$_POST["airMakeField"]:"")))) {echo "selected=\"selected\"";} ?>></option>
                  <?php
    do { 
    ?>
                  <option value="<?php echo $row_rsAirModel['aircraft_model']?>"<?php if (!(strcmp($row_rsAirModel['aircraft_model'], ((isset($_POST["airMakeField"]))?$_POST["airMakeField"]:"")))) {echo "selected=\"selected\"";} ?>><?php echo $row_rsAirModel['aircraft_model']?>Select Aircraft Model</option>
                  <?php
    } while ($row_rsAirModel = mysql_fetch_assoc($rsAirModel));
      $rows = mysql_num_rows($rsAirModel);
      if($rows > 0) {
          mysql_data_seek($rsAirModel, 0);
          $row_rsAirModel = mysql_fetch_assoc($rsAirModel);
    ?>
                  </select>

    Change this -
    <select name="airMake" style="width: 200px;"onchange="this.form.submit();" id="airMake">
    to this -
    <select name="airMake" style="width: 200px;"onchange="this.form.submit();" id="airMake">
    <option value="-1">Select Aircraft Manufacturer</option>
    Then if the value of 'airMake' is -1 you know that no choice was made.

  • How to put a jpopup menue in a cell of jtable

    Hello,
    I want to make a jtable in which I want in one of the columns each cell when clicked(with right button) to pop up a jpopu menu with 3 actions. First I thought to make it with combobox but because I want to be activated with right button and then with the left i have changed my mind to jpopup menu.
    Can you tell me what kind of render and editor to use? I will be very grateful if you can send me some examples because I am new to the swing.
    Thanx,
    Miroslav

    You probably want to add a mouse listener to the JTable itself.
    There is some sample code below. It adjusts the location of the
    menu, and it's source component so that the menu can opperate
    on the proper object, rather than the source of the event.
    On your table add the menu as follows:
        table.addMouseListener(new PopupMouseListener(menu));You will have to decode the location to determine which column
    the "Right Click" occurred on. You may then have to decode the
    menu you want, (if you have different menus for different
    columns/cells).
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.*;
    import com.ovotron.util.Debug;
    public class PopupMouseListener extends MouseAdapter {
        private JPopupMenu menu    = null;
        private Component  invoker = null;
        public PopupMouseListener(JPopupMenu menu) {
            super();
            this.menu = menu;
        public PopupMouseListener(JPopupMenu menu, Component invoker) {
            this(menu);
            this.invoker = invoker;
        public void mousePressed(MouseEvent e) {
             int mod = e.getModifiers();
             if ((mod & MouseEvent.BUTTON3_MASK) == MouseEvent.BUTTON3_MASK) {
                 if (menu == null) {
                     return;
                 int       x     = e.getX();
                 int       y     = e.getY();
                 Component comp  = (Component)e.getSource();
                 if (invoker != null) {
                     // Event (X,Y), are relative to the source, need to
                     // re-calculate to be relative to the invoker.
                     Point src = comp.getLocationOnScreen();
                     Point loc = invoker.getLocationOnScreen();
                     x = x - (loc.x - src.x);
                     y = y - (loc.y - src.y);
                     comp = invoker;
                 menu.show(comp, x, y);
    }

  • DYNAMIC SIMULATION MENU IN SEM BPS PLEASE ANSWER

    DYNAMIC SIMULATION MENU IN SEM BPS PLEASE ANSWER
    Hi everbody,
    I cannot see menu "dynamic simulation" and planning function "dynamic simulation" in our company's SEM System. Installation details are so:
    Component version : Netweaver 04
    Database: Oracle 9.2.0.5.0
    SAP_ABA     640     0010     SAPKA64010     
    SAP_BASIS     640     0010     SAPKB64010
    PI_BASIS     2004_1_640     0006     SAPKIPYI66     
    SAP_BW     350     0010     SAPKW35010     
    FINBASIS     300     0012     SAPK-30012INFINBASIS
    SEM-BW     400     0012     SAPKGS4012     
    BI_CONT     353     0005     SAPKIBIFP5
    Does SAP not support integration with Powersim in this new version of SEM or is there another way to integrate Powersim with BPS? I have seen these menus in version SEM 3.20 with underlying BW version of 3.10.
    Thank you very much.
    With best regards.

    Hi again,
    I know that Powersim is sold by own and has seperate license, but to connect Powersim and BPS there is a delivered planning function in SEM-BPS as I read and in "Planning" menu (in screen bps0) was a menu named "dynamic simulation" in Version SEM 3.2, I had seen this menu option in Version SEM 3.2.
    I think these menus are necessary to call simulation model that is prepared by Powersim, otherwise how can I connect my Powersim model to BPS?
    Can be the problem Support Package level or something that is not installed to system?
    Thanks very much

  • Dynamic List/Menu After Update

    Hi All,
    Dreamweaver - ASP
    I have a form to add records. The first field is a dynamic list/menu to select the date.
    After the Add record button is pressed the page reopens but the date menu has reverted to "Select date"
    Is there a way to retain the previously chosen date when the page refreshes?
    Many thanks
    John

    Hi All,
    Solved the problem.
    I set  up a session variable for the date and then used the 'Dynamic' button for the List/Manu, Select Value equal to,  and selected the session variable.
    Regards
    John

  • Dynamic Jump Menu???

    I am trying to create a dynamic jump menu (populated from a database). I have a column in th DB named "url" that contains the path of the page of each option. Any ideas on how to make it so that when the option is selected and the "go" button is pushed it takes the user to the page specified in the "url" of the database? Any help is greatley appriciated.

    "kevinrogers2006" <[email protected]> wrote
    in message
    news:go4va9$lr2$[email protected]..
    > when i click the
    > button to jump to page the .php is missing therefore i
    get page
    > cannot be
    > found.
    It's missing because it's not in the code. The problem lies
    here:
    > <option value="<?php echo
    $row_menuselect['ID']?>"<?php if
    > (!(strcmp($row_menuselect['ID'],".php"))) {echo
    > "selected=\"selected\"";}
    > ?>><?php echo
    $row_menuselect['Name']?></option>
    Change it like this:
    <option value="<?php echo $row_menuselect['ID'] .
    '.php'?>">
    <?php echo $row_menuselect['Name']?></option>
    David Powers
    Adobe Community Expert, Dreamweaver
    http://foundationphp.com

  • JPopup menu can't be shown in linux 7.3

    I attach a jpopup menu to a textarea. It pops up properly in Windows environment. But it can't be shown in linux 7.3. Anyone knows why? Any work around for it? Thanks.

    It doesn't show when it's supposed to show. The mouse action and trigger action can all be captured. There is no error thrown.

  • Dynamic Tree menu with checkbox

    Dear Boss
    Now I am in a problem for some task. But I have not ever done these. Please help me if you possible for you. I need a tree menu in java which has the following attributes:
    v This check box will implement on Oracle form
    v Checkbox Event tracking
    v On check event data will save in database
    v On check event text item of form will be re-query
    I am looking for your reply
    Aktar Chowdhury

    Play around with it, it is simpler than you think! Add a spry menu to a page with a css menu on it, see how it is structured, then make the changes to get the results you want. A Spry menu uses a UL/LI structure very similar to that generated by css_menu, you just need to add a class to the LI.
    //CSS Dynamic Menus required file
    require_once('includes/cssmenus2/gwb_Menu2.inc.php');
    //Begin Menu1
      $Menu1 = new MX_Menu2('MenuBar1');
      $Menu1->setQuery($rs_Menu1);
      $Menu1->setPK("MenuID");
      $Menu1->setFK("ParentID");
      $Menu1->setNameField("MenuLabel");
      $Menu1->setTitleField("Tip");
      //URL parameters
      $Menu1->setLinkField("Link");
      $Menu1->setTargetField("");
      // Layout
      $Menu1->setLevel(-1);
      $Menu1->setSkin("MenuBarVertical");  <---------
    //End Menu1
    body
    <?php  // Dynamic CSS Menu 
      echo $Menu1->render();
    ?>
    css_menu2.inc.php
      foreach($this->DBItems[$id] as $key=>$val){
        $li_class = ' class="MenuBarItemSubmenu"';     <-----
        //the efective row

  • Dynamic List/Menu with 2 columns

    I have created a Dynamic List/Menu box based on a recordset and showing me one field of that recordset ['Firmanaam'].
    <?php
    do { 
    ?>
                <option value="<?php echo $row_klantenselectie['Firmanaam']?>"><?php echo $row_klantenselectie['Firmanaam']?></option>
                <?php
    } while ($row_klantenselectie = mysql_fetch_assoc($klantenselectie));
      $rows = mysql_num_rows($klantenselectie);
      if($rows > 0) {
          mysql_data_seek($klantenselectie, 0);
       $row_klantenselectie = mysql_fetch_assoc($klantenselectie);
    ?>
    First question what is the difference between 'values" and 'labels' in the creation box of the Dynamic List/menu as only the field entered in the 'labels" is shown in the listbox ?
    Secondly I want to display two columns in the List box (one column with the client ID and one column with the clients name). How do I proceed ? Afterwards clicking on the selected client should send the client ID to another field in the form.
    Thank you for your replies.

    Moved to the Develop server-side applications in Dreamweaver forum, which deals with this sort of issue.
    First question:
    The Values field in the Dynamic List/menu dialog box populates the value attribute in the opening <option> tag. Because it's an HTML attribute, it's not displayed when the page is rendered in a browser. The Labels field puts the text that will be displayed in the drop-down menu between the opening and closing <option> tags.
    Put the value you want displayed in the Labels field, and the value you want sent to the server when the form is submitted in the Values field.
    Second question:
    Normally, you would put the ID in the Values field, and the name in the Labels field.
    Because the value attribute will contain the ID, it shouldn't normally be necessary to populate another field with the selected value because the ID will be sent to the server with the rest of the form data when the form is submitted.

  • Created a one page index.php site with dynamic driven menu but have to click thrice before it popula

    Created a one page index.php site with dynamic driven menu but have to click thrice before it populates the content menu
    it has no problem getting the menu information but seems to forget that the content needs to load on first go ie for the Home page
    anyone with any help would be great

    Hey J.S,
    Do you think its a bad idea to have Database admin over them web? How could i make my db admin into a program to run on a certain computer. i.e on the car breaker yard where there is no dreamweaver.
    Thanks J.S

  • Dynamic left menu plus different action on each....

    Hi everyone. I am making a dynamic left menu using a datatable and links in it.
    I am using an xml file to read all the attributes associated with a link like label, id etc.
    <h:dataTable
                        value="#{sampleMB.menu}" var="menu">
    <h:column>
    <h:commandLink value="#{menu.label}" onclick="#{menu.onclick}" styleClass="subItem" action="??????????"></h:commandLink>
    </h:column></h:dataTable>
    The problem is how to assign the action from xml file here because the action attribute accepts a method with
    syntax String mathodname(). So I am not able to put something like #{menu.action} where action is a variable
    whose value I can read from xml.

    Thanks for the reply but can u please elaborate a bit more with some code. I hope u've understood my problem clearly.
    You can directly write a string in action like ::
    <h:commandButton value="Submit" action="myaction"></h:commandButton>
    where myaction can be mapped to anything in your navigation rules in faces-config
    But you cannot do something like this ::
    <h:commandButton value="Submit" action="#{sampleMB.strMyAction}"></h:commandButton>
    where strMyAction is actually a String variable. It gives an error like "Expression must be a method expression but is a value"
    See I am reading all the attributes associated with the commandButton form an xml file. So which action to invoke is also there in the xml. Now all these values including the action can be put in the String variables. The problem is how to invoke the method represented by that action String litral.

  • How to add scrollbar to jpopup menu

    Hi everyone,
    Do u know how to add a scrollbar to jpopup menu ?

    Menus don't scroll, and shouldn't scroll. Given that, you shouldn't try and use JPopupMenu at all... rather, create your own component that implements the look and behavior you want. It will be far easier and less frustrating.
    Either that... or you should re-think what functionality you are trying to provide, and how you are trying to implement it. A scrolling menu just seems like a counterintuitive wacky UI design to me.

  • JPopup menu trouble

    I am developing an application that is requiring that a JPopup menu be triggered when the right mouse button is pressed and that a menu item selection occurr when the right mouse button is released.
    This is simple enough and in a small test app I built, it worked fine - simply put the
    myPopup.show(...)Line in the mousePressed method of my listener.
    However, when I switch over to my Applet, this no longer works. The only way for selection to occurr is to right click and release before making my selection.
    Has anyone else noticed this behavior and if so, is there a work around to provide the Applet similar behavior to the Application?
    I can provide full code if I need to, but the only really applicable part is:
    myPanel.addMouseListener( new MouseAdapter(){
       public void mouseReleased( MouseEvent e_ ){
          if( e_.isPopupTrigger() )
             myPopup.show( e_.getComponent(), e_.getX(), e_.getY() );
    });All of the code is the same in the App/Applet and the behavior difference is described above.

    It doesn't show when it's supposed to show. The mouse action and trigger action can all be captured. There is no error thrown.

  • How to setup a dynamic jump menu field

    I attempted to setup a normal drop down with a button to
    excute the values,
    but that doesnt seem to work very well... even though the
    database has the
    correct links within the tables, regardless of what selection
    you make you
    are taken to the same page all the time.
    Is there a way to use the jump menu dynamically? I want the
    menu to be
    populated from my table, i dont want to have to manually
    build the menu....
    When i try to use it, it doesnt have the dynamic radio button
    to chose a
    recordset.. its all manual entry

    Man that took a long time to come back with?
    But this should work for you.
    Add a standard List Box to your page. Click 'List Values' in
    your Property
    inspector at the bottom of the page. Click the 'lightning
    bolt' to add the
    labels that you want to display from your recordset, and then
    click the
    'lightning bolt' in the values column. Choose the recordset
    and the field
    that contains the ID you want to pass to the detail page. Now
    click ok, and
    Dreamweaver will have put some code in the value column for
    you. You need
    to add a
    prefix to this that will tell it what page and the name of
    the URL parameter
    you want to pass.
    ie
    mydetailpage.asp?ID=<%=the code Dreamweaver Created%>
    Ok so you now have the correct values in the list box.
    Now open up a second page, and add a Jump Menu to it. Just
    add one item
    containing anything.
    Go to the code view and copy into the clipboard the
    JavaScript code that
    Dreamweaver created to make the JumpMenu work. Make sure that
    you get
    everything
    including the <script> tags.
    <script language="JavaScript">
    <!--
    function MM_jumpMenu(targ,selObj,restore){ //v3.0
    some more code here!!!
    //-->
    </script>
    Paste this into a similar place on your other document. (just
    above the
    </head> tag).
    All you need to do now is modify the List Menu you created to
    use the Jump
    Menu code.
    You will have something that says:
    <select name="select">
    Change this to:
    <select name="select"
    onChange="MM_jumpMenu('parent',this,0)">
    That should do it!!!
    Dave
    "Daniel" <[email protected]> wrote in message
    news:[email protected]...
    > DWMX / ASP / SQL
    >
    >
    > "Baxter" <baxter(remove:-)@gtlakes.com> wrote in
    message
    > news:[email protected]...
    > > What server language are you using?
    > > Dave
    > > "Daniel" <[email protected]> wrote in
    message
    > > news:[email protected]...
    > >> I attempted to setup a normal drop down with a
    button to excute the
    > > values,
    > >> but that doesnt seem to work very well... even
    though the database has
    > >> the
    > >> correct links within the tables, regardless of
    what selection you make
    > >> you
    > >> are taken to the same page all the time.
    > >>
    > >> Is there a way to use the jump menu
    dynamically? I want the menu to be
    > >> populated from my table, i dont want to have to
    manually build the
    > > menu....
    > >>
    > >> When i try to use it, it doesnt have the
    dynamic radio button to chose
    a
    > >> recordset.. its all manual entry
    > >>
    > >>
    > >
    > >
    >
    >

  • Dynamic Side menu question!

    Hi All
    Can someone help me with a menu issue I have, basically the problem seems very simple. All I want to do is specify that when a specific 'Entry Point' item is selected the dynamic menu is closed when the page is viewed.
    The reason for this is that on one of my linkes to a page I have a 'dashboard' set up which I want showing on its own without any detailed navagation!
    Any help would be great
    Thanks
    Phil

    Hello Phil,
    Open  the page for which u want to hide the dynamic navigation bar,   there is a property named <b>Initial State of Navigation Panel</b>.
    Just set it to <b>close</b>.
    This will solve the problem.
    Regards
    Deb
    [Rewards points for helpful answers]

Maybe you are looking for