Autocomplete popup list menu

Hi,
I am impressed by the autocomplete feature when I type in text editor of the netbeans. You know, when I type javax.swing. then I wait for seconds, or press Ctrl-Space, it will popup menu. The popup menu will offer me some word to complete the word "javax.swing.", maybe word like border, JTextField, JTable. So you just press arrow to choose the word. Very convenient. How do I make that kind of popup menu but this time I want to make in cell of the jtable. So if I type something in cell of the jtable, it will check the word I type and popup autocomplete list menu with scrollpane too according the word I type. If I type "wel" then it will offer word "come".
Thank you.
Regards,
akbar

Hello.
I have something that might help you. Here is the story : I use IntelliJ IDEA at work and I like very much its auto-completion feature (much better than that of Visual Studio). I like it and use it so much that I often find myself hitting control+space in almost any type text editor.
At one point, I said to myself : why not exporting the concept to a text editor and enable auto-completion for normal text (not just code). This is why I coded the following class (and later completely forgot about it until now).
It requires a lexicon file containing the words subject to auto-completion. You can easily modify it and pass a String[].
Hope it'll help you.import javax.swing.*;
import javax.swing.text.BadLocationException;
import javax.swing.text.JTextComponent;
import javax.swing.event.DocumentListener;
import javax.swing.event.DocumentEvent;
import javax.swing.border.BevelBorder;
import javax.swing.border.CompoundBorder;
import java.awt.event.*;
import java.awt.*;
import java.io.*;
import java.util.Set;
import java.util.TreeSet;
import java.util.Iterator;
* <dl>
* <dt><b>Creation date :</b></dt>
* <dd> 8 oct. 2003 </dd>
* </dl>
* @author Pierre LE LANNIC
public class PowerEditor extends JPanel {
     private Set theSet;
     private WordMenuWindow theWordMenu;
     private JTextComponent theTextComponent;
     private Window theOwner;
     private static final char[] WORD_SEPARATORS =
               {' ', '\n', '\t', '.', ',', ';', '!', '?', '\'', '(', ')', '[', ']', '\"', '{', '}', '/', '\\', '<', '>'};
     private Word theCurrentWord;
     private class Word {
          private int theWordStart;
          private int theWordLength;
          public Word() {
               theWordStart = -1;
               theWordLength = 0;
          public void setBounds(int aStart, int aLength) {
               theWordStart = Math.max(-1, aStart);
               theWordLength = Math.max(0, aLength);
               if (theWordStart == -1) theWordLength = 0;
               if (theWordLength == 0) theWordStart = -1;
          public void increaseLength(int newCharLength) {
               int max = theTextComponent.getText().length() - theWordStart;
               theWordLength = Math.min(max, theWordLength + newCharLength);
               if (theWordLength == 0) theWordStart = -1;
          public void decreaseLength(int removedCharLength) {
               theWordLength = Math.max(0, theWordLength - removedCharLength);
               if (theWordLength == 0) theWordStart = -1;
          public int getStart() {
               return theWordStart;
          public int getLength() {
               return theWordLength;
          public int getEnd() {
               return theWordStart + theWordLength;
          public String toString() {
               String toReturn = null;
               try {
                    toReturn = theTextComponent.getText(theWordStart, theWordLength);
               } catch (BadLocationException e) {
               if (toReturn == null) toReturn = "";
               return toReturn;
     private class WordMenuWindow extends JWindow {
          private JList theList;
          private DefaultListModel theModel;
          private Point theRelativePosition;
          private class WordMenuKeyListener extends KeyAdapter {
               public void keyPressed(KeyEvent e) {
                    if (e.getKeyCode() == KeyEvent.VK_ENTER) {
                         onSelected();
          private class WordMenuMouseListener extends MouseAdapter {
               public void mouseClicked(MouseEvent e) {
                    if ((e.getButton() == MouseEvent.BUTTON1) && (e.getClickCount() == 2)) {
                         onSelected();
          public WordMenuWindow() {
               super(theOwner);
               theModel = new DefaultListModel();
               theRelativePosition = new Point(0, 0);
               loadUIElements();
               setEventManagement();
          private void loadUIElements() {
               theList = new JList(theModel) {
                    public int getVisibleRowCount() {
                         return Math.min(theModel.getSize(), 10);
               theList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
               theList.setBackground(new Color(235, 244, 254));
               JScrollPane scrollPane = new JScrollPane(theList, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
               scrollPane.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
               setContentPane(scrollPane);
          private void setEventManagement() {
               theList.addKeyListener(new WordMenuKeyListener());
               theList.addMouseListener(new WordMenuMouseListener());
          private void onSelected() {
               String word = (String)theList.getSelectedValue();
               setCurrentTypedWord(word);
          public void display(Point aPoint) {
               theRelativePosition = aPoint;
               Point p = theTextComponent.getLocationOnScreen();
               setLocation(new Point(p.x + aPoint.x, p.y + aPoint.y));
               setVisible(true);
          public void move() {
               if (theRelativePosition != null) {
                    Point p = theTextComponent.getLocationOnScreen();
                    setLocation(new Point(p.x + theRelativePosition.x, p.y + theRelativePosition.y));
          public void setWords(String[] someWords) {
               theModel.clear();
               if ((someWords == null) || (someWords.length == 0)) {
                    setVisible(false);
                    return;
               for (int i = 0; i < someWords.length; i++) {
                    theModel.addElement(someWords);
               pack();
               pack();
          public void moveDown() {
               if (theModel.getSize() < 1) return;
               int current = theList.getSelectedIndex();
               int newIndex = Math.min(theModel.getSize() - 1, current + 1);
               theList.setSelectionInterval(newIndex, newIndex);
               theList.scrollRectToVisible(theList.getCellBounds(newIndex, newIndex));
          public void moveUp() {
               if (theModel.getSize() < 1) return;
               int current = theList.getSelectedIndex();
               int newIndex = Math.max(0, current - 1);
               theList.setSelectionInterval(newIndex, newIndex);
               theList.scrollRectToVisible(theList.getCellBounds(newIndex, newIndex));
          public void moveStart() {
               if (theModel.getSize() < 1) return;
               theList.setSelectionInterval(0, 0);
               theList.scrollRectToVisible(theList.getCellBounds(0, 0));
          public void moveEnd() {
               if (theModel.getSize() < 1) return;
               int endIndex = theModel.getSize() - 1;
               theList.setSelectionInterval(endIndex, endIndex);
               theList.scrollRectToVisible(theList.getCellBounds(endIndex, endIndex));
          public void movePageUp() {
               if (theModel.getSize() < 1) return;
               int current = theList.getSelectedIndex();
               int newIndex = Math.max(0, current - Math.max(0, theList.getVisibleRowCount() - 1));
               theList.setSelectionInterval(newIndex, newIndex);
               theList.scrollRectToVisible(theList.getCellBounds(newIndex, newIndex));
          public void movePageDown() {
               if (theModel.getSize() < 1) return;
               int current = theList.getSelectedIndex();
               int newIndex = Math.min(theModel.getSize() - 1, current + Math.max(0, theList.getVisibleRowCount() - 1));
               theList.setSelectionInterval(newIndex, newIndex);
               theList.scrollRectToVisible(theList.getCellBounds(newIndex, newIndex));
     public PowerEditor(Set aLexiconSet, JFrame anOwner, JTextComponent aTextComponent) {
          super(new BorderLayout());
          theOwner = anOwner;
          theTextComponent = aTextComponent;
          theWordMenu = new WordMenuWindow();
          theSet = aLexiconSet;
          theCurrentWord = new Word();
          loadUIElements();
          setEventManagement();
     public JTextComponent getTextComponent() {
          return theTextComponent;
     private void loadUIElements() {
          add(theTextComponent, BorderLayout.CENTER);
     private void setEventManagement() {
          theTextComponent.addFocusListener(new FocusAdapter() {
               public void focusLost(FocusEvent e) {
                    theTextComponent.requestFocus();
          theTextComponent.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, InputEvent.CTRL_MASK), "controlEspace");
          theTextComponent.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_HOME, InputEvent.CTRL_MASK), "home");
          theTextComponent.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_END, InputEvent.CTRL_MASK), "end");
          theTextComponent.getActionMap().put("controlEspace", new AbstractAction() {
               public void actionPerformed(ActionEvent e) {
                    onControlSpace();
          theTextComponent.getActionMap().put("home", new AbstractAction() {
               public void actionPerformed(ActionEvent e) {
                    theWordMenu.moveStart();
          theTextComponent.getActionMap().put("end", new AbstractAction() {
               public void actionPerformed(ActionEvent e) {
                    theWordMenu.moveEnd();
          theTextComponent.addMouseListener(new MouseAdapter() {
               public void mouseClicked(MouseEvent e) {
                    super.mouseClicked(e);
                    if (theWordMenu.isVisible()) {
                         theWordMenu.setVisible(false);
          theTextComponent.addKeyListener(new KeyAdapter() {
               public void keyPressed(KeyEvent e) {
                    if (e.isConsumed()) return;
                    if (theWordMenu.isVisible()) {
                         if (e.getKeyCode() == KeyEvent.VK_ENTER) {
                              theWordMenu.onSelected();
                              e.consume();
                         } else if (e.getKeyCode() == KeyEvent.VK_DOWN) {
                              theWordMenu.moveDown();
                              e.consume();
                         } else if (e.getKeyCode() == KeyEvent.VK_UP) {
                              theWordMenu.moveUp();
                              e.consume();
                         } else if (e.getKeyCode() == KeyEvent.VK_PAGE_DOWN) {
                              theWordMenu.movePageDown();
                              e.consume();
                         } else if (e.getKeyCode() == KeyEvent.VK_PAGE_UP) {
                              theWordMenu.movePageUp();
                              e.consume();
          theOwner.addComponentListener(new ComponentAdapter() {
               public void componentHidden(ComponentEvent e) {
                    theWordMenu.setVisible(false);
               public void componentMoved(ComponentEvent e) {
                    if (theWordMenu.isVisible()) {
                         theWordMenu.move();
          theTextComponent.getDocument().addDocumentListener(new DocumentListener() {
               public void insertUpdate(DocumentEvent e) {
                    if (theWordMenu.isVisible()) {
                         int beginIndex = e.getOffset();
                         int endIndex = beginIndex + e.getLength();
                         String newCharacters = theTextComponent.getText().substring(beginIndex, endIndex);
                         for (int i = 0; i < WORD_SEPARATORS.length; i++) {
                              if (newCharacters.indexOf(WORD_SEPARATORS[i]) != -1) {
                                   theCurrentWord.setBounds(-1, 0);
                                   theWordMenu.setWords(null);
                                   theWordMenu.setVisible(false);
                                   return;
                         theCurrentWord.increaseLength(e.getLength());
                         updateMenu();
               public void removeUpdate(DocumentEvent e) {
                    if (theWordMenu.isVisible()) {
                         theCurrentWord.decreaseLength(e.getLength());
                         if (theCurrentWord.getLength() == 0) {
                              theWordMenu.setWords(null);
                              theWordMenu.setVisible(false);
                              return;
                         updateMenu();
               public void changedUpdate(DocumentEvent e) {
     private String[] getWords(String aWord) {
          aWord = aWord.trim().toLowerCase();
          Set returnSet = new TreeSet();
          for (Iterator iterator = theSet.iterator(); iterator.hasNext();) {
               String string = (String)iterator.next();
               if (string.startsWith(aWord)) {
                    returnSet.add(string);
          return (String[])returnSet.toArray(new String[0]);
     private static boolean isWordSeparator(char aChar) {
          for (int i = 0; i < WORD_SEPARATORS.length; i++) {
               if (aChar == WORD_SEPARATORS[i]) return true;
          return false;
     private void onControlSpace() {
          theCurrentWord = getCurrentTypedWord();
          if (theCurrentWord.getLength() == 0) return;
          int index = theCurrentWord.getStart();
          Rectangle rect = null;
          try {
               rect = theTextComponent.getUI().modelToView(theTextComponent, index);
          } catch (BadLocationException e) {
          if (rect == null) return;
          theWordMenu.display(new Point(rect.x, rect.y + rect.height));
          updateMenu();
          theTextComponent.requestFocus();
     private void updateMenu() {
          if (theCurrentWord.getLength() == 0) return;
          String[] words = getWords(theCurrentWord.toString());
          theWordMenu.setWords(words);
     private Word getCurrentTypedWord() {
          Word word = new Word();
          int position = theTextComponent.getCaretPosition();
          if (position == 0) return word;
          int index = position - 1;
          boolean found = false;
          while ((index > 0) && (!found)) {
               char current = theTextComponent.getText().charAt(index);
               if (isWordSeparator(current)) {
                    found = true;
                    index++;
               } else {
                    index--;
          word.setBounds(index, position - index);
          return word;
     private void setCurrentTypedWord(String aWord) {
          theWordMenu.setVisible(false);
          if (aWord != null) {
               if (aWord.length() > theCurrentWord.getLength()) {
                    String newLetters = aWord.substring(theCurrentWord.getLength());
                    try {
                         theTextComponent.getDocument().insertString(theCurrentWord.getEnd(), newLetters, null);
                    } catch (BadLocationException e) {
                    theCurrentWord.increaseLength(newLetters.length());
          theTextComponent.requestFocus();
          theTextComponent.setCaretPosition(theCurrentWord.getEnd());
          theCurrentWord.setBounds(-1, 0);
     private static Set loadLexiconFromFile(File aFile) throws IOException {
          Set returnSet = new TreeSet();
          BufferedReader reader = new BufferedReader(new FileReader(aFile));
          String line = reader.readLine();
          while (line != null) {
               returnSet.add(line);
               line = reader.readLine();
          reader.close();
          return returnSet;
     public static void main(String[] args) {
          try {
               File lexiconFile = new File("./lexicon.txt");
               Set lexicon = loadLexiconFromFile(lexiconFile);
               final JFrame frame = new JFrame("Test");
               frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
               JTextPane textArea = new JTextPane();
               PowerEditor powerEditor = new PowerEditor(lexicon, frame, textArea);
               JScrollPane scrollpane = new JScrollPane(powerEditor);
               scrollpane.setBorder(new CompoundBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10),
                                                                 BorderFactory.createBevelBorder(BevelBorder.LOWERED)));
               frame.addWindowListener(new WindowAdapter() {
                    public void windowClosing(WindowEvent e) {
                         System.exit(0);
               frame.setContentPane(scrollpane);
               SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                         frame.setSize(500, 500);
                         frame.setVisible(true);
          } catch (IOException e) {
               e.printStackTrace();

Similar Messages

  • HotFixes for autocomplete popup location

    Hi ,
    As you all know the popup location is appearing outside the grid panel when u place ajax autocomplete ajax component inside grid panel/ table / group panel .
    i wonder when the hotfixes for this will be ready or is there any workaround?
    Thanks.

    yea.
    i think that is the problem.
    i have a autocomplete textfield under groupPanel and this groupPanel is located under gridPanel
    and the resultiing popup list is located outside the panel itself.
    Thanks.
    Can u refer me to the bug URL?
    is there any workaround for this?
    Thanks

  • Eliminating the null values from popup list item

    Dear All,
    i create a popup list,at runtime it shows a null blank value among the values i specified while the combo box is not,
    i want to eleminate the blank null value from the popup list.
    Need Help.
    Thanks & Regards.

    Okay,
    i create a popup list, populate it in runtime with create_group_from_query builtin.
    now when i run the form and click the list item, it display a null value among the other values which are
    return from the create_group_from_query .
    the procedure is below
    procedure Department_proc is
    rg recordgroup;
    n number;
    begin
    remove_record_group('RG');------  this is another procedure which checks for Record group existance and remove it.
    rg=:=create_group_from_query('RG4','SELECT NAME,TO_CHAR(DEPT_ID) FROM TAB_DEPT_SECTION
    UNION
    SELECT '||'''All Departments'''||'as name,'||'''0'''||' as name from dual');
    n:=populate_group(rg4);
    populate_list('control_block.department',rg4);
    end;
    it display a null value among the other values for the first time is run the form,but when i click it and select a value from it
    and the onward click dont show the null value.i want to eleminate the null value even for the first time when the user run the
    from.
    Best Regards

  • JComboBox popup list remains open after losing keyboard focus

    Hi,
    I have noticed a strange JComboBox behavior. When you click on the drop down arrow to show the popup list, and then press the Tab key, the keyboard focus moves to the next focusable component, but the popup list remains visible.
    I have included a program that demonstrates the behavior. Run the program, click the drop down arrow, then press the Tab key. The cursor will move into the JTextField but the combo box's popup list is still visible.
    Does anyone know how I can change this???
    Thanks for any help or ideas.
    --Yeath
    import java.awt.*;
    import javax.swing.*;
    import java.util.*;
    public class Test extends JFrame
       public Test()
          super( "Test Application" );
          this.getContentPane().setLayout( new BorderLayout() );
          Box box = Box.createHorizontalBox();
          this.getContentPane().add( box, BorderLayout.CENTER );
          Vector<String> vector = new Vector<String>();
          vector.add( "Item" );
          vector.add( "Another Item" );
          vector.add( "Yet Another Item" );
          JComboBox jcb = new JComboBox( vector );
          jcb.setEditable( true );
          JTextField jtf = new JTextField( 10 );
          box.add( jcb );
          box.add( jtf );
       public static void main( String[] args )
          Test test = new Test();
          test.pack();
          test.setVisible( true );
          test.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
    }

    ran your code on 1.5.0_3, observed problem as stated.
    even though the cursor is merrily blinking in the textfield, you have to click into
    the textfield to dispose the dropdown
    ran your code on 1.4.2_08, no problems at all - tabbing into textfield immediately
    disposed the dropdown
    another example of 'usual' behaviour (involving focus) breaking between 1.4 and 1.5
    the problem is that any workaround now, may itself be broken in future versions

  • How do I pass a username form variable from a drop down list/menu to another page?

    Hi,
    I have a login_success.php page that has a drop down list/menu (which lists usernames). I want the user to click on their user name, and when they click the submit button the username information to be passed over to the username.php page which will contain a recordset, sorted by username.
    How do I pass the username info from the drop down list/menu to the username.php page?
    The drop down menu is connected to a recordset listUsername, I have filtered the recordset with the Form Variable = username, and I have used the POST method to send the username to the page username.php. I'm not sure how to structure the php or which page to place it on.
    <form id="form1" name="form1 method="post" action="username.php">
         <label for="username_id">choose username:</label>
         <select name="username_id" id-"username_id">
              <option value="1">username1</option>
              <option value="2">username2</option>
              <option value="3">username3</option>
              <option value="4">username4</option>
         </select>
         <input type="submit" name="send" id="send" value="Submit" />
         <input type="username" type="hidden" id="username" value="<?php echo $row_listUsername['username']; ?>" />
    </form>
    Could somebody help me please?
    Thanks.

    I would not post the variable over, In this case I personally would send it through the URL and use the $_GET method to retreve it. For Example.
    <html>
         <head>
              <title>Test Page</title>
              <script type="text/javascript">
                   function userID(){
                        //var ID = form1.userIDs.selectedIndex;
                        var user = form1.userIDs.options[form1.userIDs.selectedIndex].value;
                        window.location = "test.html?userID=" + user;
              </script>
         </head>
         <body>
              <form id="form1">
                   <select name="userIDs" id="userIDs" onchange="userID();">
                        <option>Select a User</option>
                        <option value="1">User 1</option>
                        <option value="2">User 2</option>
                        <option value="3">User 3</option>
                        <option value="4">User 4</option>
                   </select>
              </form>
         </body>
    </html>
    //PAGE TO RETRIEVE THE USERNAME
    <?php
    if(isset($_GET['userID'])
         $userID = $_GET['userID'];
         echo $userID;
         die;

  • How do I make my form (list/menu) items open in the same window (self).

    Hello, the kind, brilliant people on this forum have always been able to help me in the past, so I thought I'd give it a try today. Items in a form (list/menu) that I've created are opening in a blank window (pop-up) when clicked. I would like them to open in "self" mode so that pop up blockers on various computers don't become a challenge for site visitors. Can anyone please tell me how I could make that adjustment? I selected the entire form "red dotted line" around the list and changed the "target" in the properties menu to "self". Then I selected everything on the page and still not correct. I am inserting the code below. Any assistance to get me on the right track would be GREATLY appreciated!! BTW I also made the form a library item (just in case that fact is needed). Also if you need to see the actual link it is http://www.graphicmechanic.com/DEKALBCOUNTY/index.html. The "I WANT TO" list is the part I'm referring to.
    CODE BELOW:
    <form action="" method="post" name="form1" target="_self" class="style26" id="form1">
                       <a href="#" target="_self"><span class="style26">
                       <label FOR="iwantto">I WANT TO:</label>
                       <br />
                        <img src="../images/5x5.gif" alt="layout graphic" width="5" height="5" /><br />
                        <select name="iwantto" id="iwantto" class="style55" onchange="MM_jumpMenu('window.open()',this,0)">
                          <option value="http://web.co.dekalb.ga.us/voter/#">REGISTER TO VOTE</option>
                          <option value="https://govaffiliate.ezgov.com/ezutility/index.jsp?agency=3411">PAY MY WATER BILL</option>
                          <option value="../humanserv/hs-osa-facilities.html">FIND A SENIOR CENTER</option>
                          <option value="../humanserv/hs-lou-walker.html">GET INFO ABOUT LOU WALKER CENTER</option>
                          <option value="http://www.dekalbstatecourt.net/">FILE A RESTRAINING ORDER</option>
                          <option value="http://www.dekalbcountyanimalservices.com/">REPORT A LOOSE DOG</option>
                          <option value="http://web.co.dekalb.ga.us/courts/recorders/payment.asp">GET TRAFFIC CITATION INFO</option>
                          <option value="http://web.co.dekalb.ga.us/courts/probate/pistol.htm">APPLY FOR A PISTOL LICENSE</option>
                          <option value="http://web.co.dekalb.ga.us/courts/probate/marriage.htm">GET A MARRIAGE LICENSE</option>
                          <option value="http://www.co.dekalb.ga.us/dekalbflic/Centers.htm#service">FILE FOR A DIVORCE</option>
                          <option value="http://www.co.dekalb.ga.us/superior/index.htm">GET INFORMATION ABOUT JURY DUTY</option>
                          <option value="http://web.co.dekalb.ga.us/taxcommissioner/search.asp">PAY MY TAXES</option>
                        </select>
                       </span>
                       </a>
    </form>

    Looks like it still isn't working. When I removed those items the drop down menu stopped working as well. I went ahead and posted yours as the correct answer. I'm convinced it's my skill level. i'm gonna do some javascript searches to see where the js code should go, it's very confusing to me. Here is that code in case anything sticks out to you or anyone else.
    <link href="../cssfiles/lbistyles.css" rel="stylesheet" type="text/css"/>
    <form action="" method="" name="form1" class="style26" id="form1">
                     <span class="style26">
                       <label FOR="iwantto">I WANT TO:</label>
                       <br />
                        <img src="../images/5x5.gif" alt="layout graphic" width="5" height="5" /><br />
                        <select name="iwantto" id="iwantto" class="style55">
                        <option value="#" onClick="MM_goToURL('self','http://web.co.dekalb.ga.us/voter');return document.MM_returnValue">REGISTER TO VOTE</option>
                          <option value="https://govaffiliate.ezgov.com/ezutility/index.jsp?agency=3411">PAY MY WATER BILL</option>
                          <option value="../humanserv/hs-osa-facilities.html">FIND A SENIOR CENTER</option>
                          <option value="../humanserv/hs-lou-walker.html">GET INFO ABOUT LOU WALKER CENTER</option>
                          <option value="http://www.dekalbstatecourt.net/">FILE A RESTRAINING ORDER</option>
                          <option value="http://www.dekalbcountyanimalservices.com/">REPORT A LOOSE DOG</option>
                          <option value="http://web.co.dekalb.ga.us/courts/recorders/payment.asp">GET TRAFFIC CITATION INFO</option>
                          <option value="http://web.co.dekalb.ga.us/courts/probate/pistol.htm">APPLY FOR A PISTOL LICENSE</option>
                          <option value="http://web.co.dekalb.ga.us/courts/probate/marriage.htm">GET A MARRIAGE LICENSE</option>
                          <option value="http://www.co.dekalb.ga.us/dekalbflic/Centers.htm#service">FILE FOR A DIVORCE</option>
                          <option value="http://www.co.dekalb.ga.us/superior/index.htm">GET INFORMATION ABOUT JURY DUTY</option>
                          <option value="http://web.co.dekalb.ga.us/taxcommissioner/search.asp">PAY MY TAXES</option>
                        </select>
                       </span>
                       </a>
    </form>

  • Switch List Menu in G/L & Vendor Line Item Display

    Hi Dear All Experts,
    I've 2 problems.
    The first one is in the Vendor line item display program.
    copied RFITEMAP and create custom program and then I create new structure (like FAGLPOSX) to show extra fields. (eg. Vendor, User)
    New extra fields are shown when i execute but if I click switch menu from the setting menu, it is shown by the old fields not including new fields.
    The second one is in the GL Line Item display program.
    Even the Switch List menu is enable in the Vendor Line Item display custom program without changing anything for gui status, the switch list menu in my new custom program is disable.(copied from fagl_account_items_gl).
    Thks all in advance..
    TRA

    the second question is now solved.
    Include ZFAGL_ACCOUNT_ITEMS_DEF (C_REPID_GL     LIKE SY-REPID  VALUE  'FAGL_ACCOUNT_ITEMS_GL') I put custom program name in this field.
    When I changed to std program name, the switch list menu is enable..
    Only the first question is left..
    Please let me know is there any way to solve...
    Best Regards
    TRA

  • How to change a list/menu to a text field when 'Other' is chosen?

    Hi there. I've been trying to solve this for a week now and I have depleted all my resources, that is why I'm here. I even went to jquery but nothing works and I think I was over-complicating this way too much.
    In short: I have a contact form, which have a list/menu with validation, and one of the options of that list/menu is "other". What I want is that when the user select "other" automatically change to a text field in order to let the user put his custom color. This is what I have:
    <form method="post" action="process.php">
    <span id="spryselect1">
    <label for="colors"></label>
    <select name="colors" id="colors">
    <option selected="option1">Blue.</option>
    <option value="option2">White</option>
    <option value="option3">Red</option>
    <option value="other">other</option>
    </select>
    <span class="selectRequiredMsg">Please select a colour.</span></span>
    <input type="submit" value="Send">
    </form>
    I know now that the approach is to show/hide a separate textbox besides the other... well. I don't know how to implement that, I think I really need your help guys. I'm completely frustrated.
    Thanks in advance.

    Have a look at the following
    <!DOCTYPE HTML>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Untitled Document</title>
    <link href="http://labs.adobe.com/technologies/spry/widgets/selectvalidation/SpryValidationSelect.css" rel="stylesheet">
    <link href="http://labs.adobe.com/technologies/spry/widgets/textfieldvalidation/SpryValidationTextField.css" rel="stylesheet">
    <style>
    .hidden {display:none;}
    </style>
    </head>
    <body>
    <form action="" method="post">
      <span id="spryselect1">
      <label for="colors">Colours:</label>
      <select name="colors" id="colors" onchange="MyOnClickHandler(this.value)">
        <option value="">Please select...</option>
        <option value="blue">Blue</option>
        <option value="white">White</option>
        <option value="red">Red</option>
        <option value="other">other</option>
      </select>
      <span class="selectRequiredMsg">Please select a colour.</span></span><span id="sprytextfield1">
      <input name="other" id="other" class="hidden" type="text">
      <span class="textfieldRequiredMsg">A value is required.</span></span>
      <input name="" type="submit">
    </form>
    <script src="http://labs.adobe.com/technologies/spry/includes_minified/SpryDOMUtils.js"></script>
    <script src="http://labs.adobe.com/technologies/spry/includes_minified/SpryValidationSelect.js"></script>
    <script src="http://labs.adobe.com/technologies/spry/includes_minified/SpryValidationTextField.js"></script>
    <script>
    var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1");
    var sprytextfield1;
    function MyOnClickHandler(value) {
         if(value =='other') { //show text field and set validation
              if(!sprytextfield1){
              sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
              Spry.$$('input#other').removeClassName('hidden');
         } else { //hide textfield and destroy validation
              if(sprytextfield1 && sprytextfield1.destroy){
                   sprytextfield1.resetClasses();
                   sprytextfield1.destroy();
                   sprytextfield1 = null;
              Spry.$$('input#other').addClassName('hidden');
         return false;
    </script>
    </body>
    </html>
    Gramps

  • List/Menu (multiple selected)  insert into MySQL

    I have been building a feedback form and I am running into a
    issue that when I place a list/menu that allows multiple selections
    when I submit my form in my MySQL database it collected the
    information but only on the last multiple selection.
    For example, this is what my list/menu looks like.
    <select name="occasion" size="5" multiple="MULTIPLE"
    id="occasion">
    <option value="Spur of the moment,">Spur of the
    moment</option>
    <option value="Family dinner">Family
    dinner</option>
    <option value="Special occasion (i.e.
    birthday)">Special occasion (i.e. birthday)</option>
    <option value="Office get together">Office get
    together</option>
    <option value="Romantic dinner">Romantic
    dinner</option>
    <option value="Night out with friends">Night out with
    friends</option>
    <option value="Business meeting">Business
    meeting</option>
    <option value="Other">Other</option>
    </select>
    And my MySQL database I have it set up as...
    Field Type
    occasion mediumtext
    I do not know why I cannot have more than one selection
    inputed into my field, what must I do to correct this? Everything
    works perfectly expect the multi selected list/menu. I want to
    place all that is selected in the list/menu in that one database
    field called occasion.

    .oO(MikeL7)
    >>You should also test with isset() and is_array() if
    $_POST['occasion']
    >>is available at all and of the expected type. The
    code above will also
    >>throw a notice if $insert_string is not initialized
    before the loop.
    >
    > I use both isset and is_array in my code, When you say
    notice, you dont mean
    >a script stoppiong error?
    Nope. An E_NOTICE error won't terminate the script, but
    shouldn't happen
    nevertheless. While developing, the error_reporting directive
    should be
    set to E_ALL|E_STRICT and _all_ reported problems should be
    solved. It's
    not only better coding style, but also helps to prevent real
    errors. In
    this particular case it was just a guess, because it was only
    a part of
    the code. But using an uninitialized variable with a '.='
    operator for
    example would lead to a notice, which should be fixed.
    >>But of course this is a really bad DB design, as it
    already violates the
    >> first normal form (1NF). Just some ideas for queries
    that might come to
    >> mind, but would be really hard to do with such a
    comma-separated list:
    >
    > A better table design would be to have column for |
    list_ID | user_ID |
    >song_ID | and do a insert for each song selected.
    Yes, something like that.
    >Thanks for the input, i like escaping the variables from
    a string as they
    >stand out more in code view, is the single quote method
    faster? And which one
    >will be or is already deprecated?
    All are correct and won't be deprecated. IMHO it's more or
    less just
    personal preference. It also depends on the used editor and
    its syntax
    highlighting capabilities. For example I use Eclipse/PDT for
    all my PHP
    scripts, which can also highlight variables inside a string.
    But if the
    above is your preferred way, there's nothing really wrong
    with it.
    Just some additional thoughts:
    Personally I prefer as less escaping and concatenating as
    possible,
    because such a mixture of single quotes, double quotes, dots
    and
    sometimes even escaped quote signs (for example when printing
    HTML)
    _really_ confuses me. I like to keep my code clean and
    readable.
    Something like this:
    print "<img src=\"".$someVar."\" ...>\n";
    not only hurts my eye, it is also quite error-prone. It's
    easy to miss a
    quote or a backslash and get a parse error back, especially
    in editors
    with limited syntax highlighting (or none at all). So I would
    prefer
    print "<img src='$someVar' ...>\n";
    or even
    printf("<img src='%s' ...>\n", $someVar);
    When it comes to performance issues, of course there's a
    difference
    between the various methods. But for me they don't really
    matter. In
    practice you usually won't notice any difference between an
    echo, a
    print or a printf() call for example, as long as you don't
    call them
    a million times in a loop.
    So I always just use the method that leads to the most
    readable code.
    In many cases, especially when a lot of variables or
    expressions are
    involved, (s)printf() wins. Not for performance, but for
    readability.
    But as said - personal preference. YMMV.
    Micha

  • How to delete empty element in popup list

    I have a question about a suspicious behaviour in Forms Builder 10.1.2.0.2.
    When I have a list object (pop up list) I can define some values in the attribute palette of the object.
    So you can set a shown name and a value behind. In this little window to set the items of the popup list you get automatically a white empty item at the end of the list. When I click now on this empty item (you do so, when you want to add an item) Forms Builder automatically adds an new empty item at the end.
    When I click this new empty item, Forms Builder adss another empty one ... and so on.
    It´s very suspicious because, when I end this dialog with "OK", it will be saved and when I open the form (over web) I have at the end of the list one, two (or more) empty elements in list.
    But I can´t delete this empty ones from the list in Forms Builder.
    So my question:
    how can I delete empty items in a popup list??
    I try it with hit "del" button at keyboard or delete the set value for the item (I hope Forms Builder delete items without value). But all does not help.

    Thanks jwh for this great solution! :)
    On my german keyboard it is:
    ctrl+< for deleting a line
    ctrl+> (= ctrl+shift+<) for adding a new line
    Thanks! :)
    I have another question (you can maybe help me, too?).
    On this popup lists you can have several items. When you open a form (via web) and the list has more than x items (maybe 5 or 6) the form shows a scroll bar on the right side.
    Is there any poosibility to set how much items has to show and only show a scroll bar when there are more items in the list?
    Or other way: set the maximum of shown items so big, that there will be no scroll bar.
    Message was edited by:
    ulfk

  • How to add a popup list in the requisitioner field in PR

    Have to add a popup list containing the list of employee vendors in the requisitioner field of Purchase Requisitioner. As client is in need of adding the employee vendor list so that it will be easier for them to locate the correct employee for whom the material to be ordered.

    Hi ramesh
    Yeah .....we want F4 help for that field..
    ABAPer has to do it in User exit or BAPI ????????
    Regards
    Siva

  • How can I show tree's nodes in a Popup List of values

    I have a tree and in a different form for an item I want to write nodes together for example
    computer/desktop/asus/....
    computer/pda/hp/... this must be shown in a popup list of values can you help?
    thanks

    Simon's suggestion sounds good - Connect By Prior sounds like what you want. Assuming you have a parent/child relationship in your data, you could use SQL like the following for the source of your Popup LOV (this will deal with a hierarchy of any number of levels):
    SELECT SYS_CONNECT_BY_PATH(person_name, '/') d, person_id r
    FROM persons
    START with parent_id = 0
    connect by prior id = parent_id
    You will need to adapt the above to fit in with the structure of your table. The above assumes a PERSONS table with 3 columns: person_id | person_name | parent_id. It will output something like:
    John
    John/Adam
    John/Adam/Julie
    John/Adam/Steven
    John/Adam/Steven/Wally
    John/Bob
    John/Karen
    Hope that helps,
    Andy

  • Please help! How can I validate Radio Buttons and List Menu with PHP.

    Hello everyone, I have been learning PHP step by step and
    making little projects.
    The point is I find it easy to learn by doing "practical
    projects."
    I have been reading the David Powers's Book on PHP Solutions
    and it's really great, however there is nothing mentioned regarding
    Validating Radio buttons. I know the book cannot cover every aspect
    of PHP and maybe someone in here can help.
    I have been learning how to process HTML forms with PHP.
    The problem is every book or tutorial I have read or
    encountered fall short on validation.
    I'm wondering how I can learn to validate Radio Buttons and
    Select List Menu.
    I have managed to create validation for all other fields but
    have no clue as to how I can get validation for Radio Buttons and
    List Menu.
    I would also like an error message echoed when the user does
    not click a button or make a selection and try to submit the form.
    I would appreciate any help.
    Patrick

    It's not that default value is "None." In fact it's not. It
    will only be
    "none" when the form is submitted.
    Also if your submit button is names 'send' then
    $_POST['send'] will only be
    set if the form was submitted.
    Make sure you didn't hit the refresh button on your browser
    which usually
    reposts the information. Also make sure you did not reach the
    form from
    another form with the same button names.
    Otherwise paste the snippet.
    Also you can check what fields are set in the post array by
    adding this to
    the top of (or anywhere on) your page:
    print_r($_POST);
    Cosmo
    "Webethics" <[email protected]> wrote in
    message
    news:[email protected]...
    >
    quote:
    Originally posted by:
    Newsgroup User
    > Off the top of my head this should be no different than
    your radio buttons
    > except that 'productSelection' will always fail the
    !isset check when the
    > form is submitted since the default value is "None", and
    therefore always
    > set. :-)
    >
    > So how about this..?
    > <?php
    > if (isset($_POST['send']) and
    ($_POST['productSelection'] == "None"))
    > {echo "Please select a product.";}
    > ?>
    >
    >
    >
    >
    > "Webethics" <[email protected]> wrote
    in message
    > news:[email protected]...
    > > Another question - how do i applied the code you
    just showed me to
    > > select
    > > menu
    > > or select list?
    > >
    > > This is the list:
    > >
    > > <div class="problemProduct">
    > > <label for="productSelection"><span
    class="product_label">Product
    > > Name.</span></label>
    > > <select name="productSelection" id="products"
    class="selection">
    > > <option value="None">-------------Select a
    product----------</option>
    > > <option value="Everex DVD Burner">Everex DVD
    Burner</option>
    > > <option value="Vidia DVD Burner">Vidia DVD
    Burner</option>
    > > <option value="Excerion Super Drive">Excerion
    Super Drive</option>
    > > <option value="Maxille Optical Multi
    Burner">Maxille Optical Multi
    > > Burner</option>
    > > <option value="Pavilion HD Drives">Pavilion
    HD Drives</option>
    > > </select>
    > > </div>
    > >
    > > I thought I could just change the name is the code
    from operatingSystem
    > > to
    > > productSelection.
    > >
    > > Something like this:
    > >
    > > From this:
    > >
    > > <?php
    > > if (isset($_POST[send]) and
    !isset($_POST['operatingSystem']))
    > > {echo "Please select an operating system.";}
    > > ?>
    > >
    > > To this:
    > >
    > > <?php
    > > if (isset($_POST[send]) and
    !isset($_POST['productSelection']))
    > > {echo "Please select an operating system.";}
    > > ?>
    > >
    > > But this does not work, any ideas?
    > >
    > > Patrick
    > >
    >
    >
    >
    >
    > Hey, I tried this about but as you mentioned, since the
    default product
    > value
    > is "None" an error message appears when the page loads.
    >
    > Is there a way to code this things so that even though
    the default value
    > is
    > "None" there ia no error message untle you hit the
    submit?
    >
    > When I applied the code, it messes up the previous code,
    now the operating
    > system is requiring an entry on page load.
    >
    > When I remove the code from the list menu everything
    goes back to normal.
    >
    > I know this is a little much but I have no other
    alternatives.
    >
    > Patrick
    >

  • List/menu options from database

    Hello
    I need help trying to populate 2 list/menu with some database information.
    Let's suppose that this is my table:
    Id
    Brand
    Model
    1
    ford
    f1
    2
    citroen
    c1
    3
    citroen
    c2
    4
    citroen
    c3
    5
    toyota
    t1
    6
    toyota
    t2
    7
    volvo
    v1
    I have 2 list/menu. One is  the brand menu, which extracts the values  in the brand column of the database (using the DISTINCT statement in MySql). So when you click the menu, these options appear:
    ford
    citroen
    toyota
    volvo
    The  code for that menu is something like  this:
    <select name="menu_marque" id="menu_marque">
    <option value="null">select</option>
    <?php do {  ?>
    <?php
    print '<option  value="'.$row_marque_recordset['marque'].'">'.$row_marque_recordset['marque'].'</option>' ;
    ?>
    <?php } while ($row_marque_recordset =  mysql_fetch_assoc($marque_recordset)); ?>
    </select>
    Now,  I want to do the same for the model menu.  The problem is that I don't know how to write in the Sql, that it  should take the selected value of the brand menu.  I have something like this:
    SELECT modele FROM test WHERE marque  = 'colname' ORDER BY modele ASC
    (where colname is:  $_POST['menu_marque']..... Obviously I am not getting the value by a  POST method, but I tried changing it to something like:
    menu_marque.selectedIndex
    but  it doesn't work...... Any tips on how can I solve this

    Hi DanielAtwood,
    Thanks for your reply...
    Actually when i send the variable in 'WHERE Clause' in Db Adapter query it will retrieve more than one record as the output.
    I want to put that values to a 'SelectOneChoice' component and list down all the values..
    First I tried with data control. But i couldn't find the way to pass the value to the variable(in WHERE clause) to the query in data control view.
    Thanks,
    Nir

  • JComboBox fails to popup list - mouse/keyboard coordinate problem?

    Have discovered the following phenomenon:
    my JComboBox is placed in a hierarchy of panels, the top of which
    is packaged via sun.beans.ole.Packager as ActiveX. THe ActiveX'ed
    bean is used in an MFC application, which uses the plugin as VM.
    The JComboBox failed to popup its selection list when the user
    clicked on the popup button or used the appropriate key combination.
    I found out, that if the application is resized/moved so that the JComboBox
    is not in the upper left quarter of the screen, then it can display its popup list
    without problem. Have not investigated on whether the "upper left" corner
    also means "including popup bounds", but it seems like it.
    Happens only in the plugin, not within regular Java application.
    Anyone out there with a similar problem? Or better, a solution?
    Have cross-posted to the Plugin group.
    And, of course, I am desperate for a solution! (Project release date lurking...)
    Sylvia

    Nubz,
    actually I'm still using a standard wired apple keyboard, wt the magic mouse, because the wire goes under my desk, and I was actually considering getting a trackpad. Still since my Yosemite upgrade, I'm having problem after problem, so I'm not sure I will even stay wt Mac. Honestly I've examined any and all solutions, in that support article, but none of them were relevant to my problem.
    I did check & repair my Yosemite Disk Permissions using Disk Utility, and although it found only a few things wrong, and none were related to my keyboard, or mouse (most were for my HP printer), repairs seemed to rectify the problem.

Maybe you are looking for

  • HT3275 I cannot restore from Time Machine. Error 8003.

    This is what happened in sequence: • I had problems with Microsoftt Word. I checked the disk utilities and got a message saying that I needed to reformat the disk. I erased the disk and reinstalled Lion. * I restored all my files from my external dis

  • RAR Rules - DEV and QA

    Hi, Our RAR Dev has two active connectors to SAP Dev as well as QA. We have uploaded a Rule Set for QA which is working fine. We can do a risk analysis and we get results. However we are struggling to get results for Dev. How do we go about uploading

  • Rescue and Recovery error message

    Hello everyone, I hope someone can assist me. I have a 3000 J series desk top computer that has a error message that comes up several times a day. It says Rescue and Recovery has failed and I need to click the site to upgrade Rescue and Recovery. I c

  • SBO Presales certification

    Hi all kindly let me know isn't there any certification for Presales Condultant for SAP Business One? i checked the following link, but there isn't a mention for Presales consultant. https://websmp105.sap-ag.de/~sapidb/011000358700000451812008E if an

  • Entering a link?

    A "long" time ago I could enter a link by simply typing the url adress. Now it does not work (for me at least) any more. Can some one explain to me how to insert a link in the Apple Support forum, or at least show me where I can find this. thx, peter