phtmlb:comboBox example?

Hello,
Has anyone used this tag yet? I have been able to fill it full of values and show it on the screen but I can only select one value at a time and even then it really doesn't save the value in the table specified in the tables attribute. Anybody have an examples to share? Any documentation too? I downloaded the PHTMLB documentation but comboBox isn't in there. Guess this tag came out in a SP pack greater than the PHTMLB documentation.
Thanks alot,
Rich

Hi Richard,
I am on SP Level 35. I am pasting the code of formLayoutSample.htm in BSP Application SBSPEXT_PHTMLB.
<%@page language="abap" %>
<%@extension name="bsp" prefix="bsp" %>
<%@extension name="htmlb" prefix="htmlb" %>
<%@extension name="phtmlb" prefix="phtmlb" %>
<htmlb:content design="design2003" >
  <htmlb:page>
    <htmlb:form>
      <htmlb:tray id                = "tray"
                  width             = "100%"
                  hasMargin         = "false"
                  title             = "<%= page->get_page_name( ) %>"
                  hasContentPadding = "true" >
        <phtmlb:formLayout labelAlignment         = "<%= labelAlignment %>"
                           design                 = "<%= design %>"
                           verticalLineSeparation = "<%= verticalLineSeparation %>"
                           fieldToLabelFactor     = "<%= fieldToLabelFactor %>"
                           customizationKey       = "<%= customizationKey %>" >
          <phtmlb:formLayoutColumnHeader text = "Personal Data"
                                         pos  = "colspan=2" />
          <phtmlb:formLayoutInputField id       = "firstName"
                                       label    = "First Name"
                                       value    = "Mary"
                                       required = "true" />
          <phtmlb:formLayoutInputField id       = "lastName"
                                       pos      = "asNeighbour,tiedTo=firstName"
                                       label    = "Last Name"
                                       required = "true"
                                       value    = "Schaurhofer" />
          <phtmlb:formLayoutInputField id    = "email"
                                       label = "E-Mail"
                                       value = "[email protected]" />
        <b>  <phtmlb:formLayoutDropDownListBox id                = "gender"
                                            label             = "Gender"
                                            table             = "<%= table %>"
                                            nameOfKeyColumn   = "NAME"
                                            nameOfValueColumn = "VALUE" /></b>
          <phtmlb:formLayoutCheckBox id    = "married"
                                     label = "Married" />
          <phtmlb:formLayoutItem idOfItem = "address"
                                 label    = "Adress"
                                 pos      = "row=+1,col=2,rowspan=3"
                                 id       = "fli_address" >
            <htmlb:textEdit id       = "address"
                            text     = "Address"
                            width    = "100%"
                            disabled = "<%= fli_address->is_readonly %>" />
          </phtmlb:formLayoutItem>
          <phtmlb:formLayoutTextEdit id    = "comments"
                                     label = "Comments"
                                     pos   = "row=+1,col=1,colspan=2,rowspan=3" />
          <phtmlb:formLayoutColumnHeader id   = "A"
                                         text = "Column A"
                                         pos  = "col=1" />
          <phtmlb:formLayoutInputField id    = "A1"
                                       label = "A1" />
          <phtmlb:formLayoutInputField id    = "A2"
                                       label = "A2" />
          <phtmlb:formLayoutColumnHeader id   = "B"
                                         text = "Column B"
                                         pos  = "row=+1,col=+1" />
          <phtmlb:formLayoutInputField id    = "B1"
                                       label = "B1" />
          <phtmlb:formLayoutInputField id    = "B2"
                                       label = "B2" />
          <phtmlb:formLayoutInputField id    = "B3"
                                       label = "B3" />
          <bsp:bee xml="<%= xmlBee %>" />
        </phtmlb:formLayout>
      </htmlb:tray>
    </htmlb:form>
  </htmlb:page>
</htmlb:content>
Message was edited by: Subramanian Venkateswaran

Similar Messages

  • ComboBox phtmlb

    Hi
    I am trying to use phtmlb combobox, but it is not working.
    What happens:
    - Combobox list values that are loaded in table: OK
    - When I try to select one value, it does not accept. Field is blue, as it was readonly/disabled: Why?
    - There is no possibility of input, as a combo: Why?
    Code below. Any suggestion?
    Regards,
    Ronaldo.
    <phtmlb:comboBox  
      id                = "tipo_doc"
      table             = "<%= t_ZBSP_01_05 %>"
      selection         = "<%= tipo_doc %>"
      nameOfKeyColumn   = "NAME"
      nameOfValueColumn = "VALUE"
      readOnly          = "FALSE"
      enabled           = "TRUE"
    />

    there seems to be a OSS note for this check out this thread
    Re: Combo Box Event
    Regards
    Raja

  • Set PHTML ComboBox Selected Value in JavaScript?

    I've created a combobox as follows:
    <phtmlb:comboBox id                = "sdm_cnis"
      selection        = "<%= L_CIP_DETAILS_WA-GBSCIND %>"
       table             = "<%= l_cnis %>"
       readOnly       = "<%= l_display_mode %>"
       width             = "50px"
       nameOfKeyColumn   = "VALUE"
       nameOfValueColumn = "NAME"
       onClientSelect    = "javascript:sdm_toggle_required();return false;"
       behavior          = "DROPDOWNSELECT" />
    Based on the selected value of another dropdown combobox, I want to use JavaScript to select the value of this comboBox. For example, if the user changes the first comboBox, I want to automatically select the first option in this combobox. I really do not want to use dropdownListBoxes because they are not used anywhere else in our application. I also do not want to make a round trip to the server in order to resolve this issue as our uses will complain too much about that.
    Some other things I've learned/tried:
    I know I can get the selected value as follows:
    sapUrMapi_ComboBox_getSelectedKey('sdm_cnis');
    I have also tried to do the following, which sort of sets the value, but when you pull the list it appears as though the old selected value is still selected:
    window.document.getElementById('sdm_cnisKEY').value = cnis_key;
    window.document.getElementById('sdm_cnis').value = cnis_value;
    Any help is appreciated.
    Rick

    Managed to come up with a solution:
    window.document.getElementById('sdm_cnisKEY').value = cnis_key;
    window.document.getElementById('sdm_cnis').value = cnis_value;
    var o=sapUrMapi_ComboBox_getObject("sdm_cnis");
    o.txt.setAttribute("k",cnis_key);
    o.txt.setAttribute("ks",cnis_key);
    I'm not sure, but I would imagine that this solution is not supported by SAP and any patches or service pack upgrades could potentially break the code, so if you use it, be cautioned about this.
    I have tested it on our server, and it works for my current scenario. That said, if there is a better way to do this in JavaScript, I'd love to hear it. For now, I'll leave the question open and assign full points if someone can come up with something that I feel is better than this (i.e. a JavaScript solution that is supported by SAP).
    Rick

  • ComboBox  with databinding

    Hi there,
    i got some problems with phtml:comboBox with the attribute “freetext” set. Any manual entered values doen’t show up in my model when using data binding. The selected values work fine.
    I found one posting regarding this problem, but wonder whether there a been a “official” solution from SAP in the meantime. I couln’d not find anything in SAP Notes.
    phtmlb:comboBox & data binding
    How do you work with comboBox – freetext ? How do you get the value manual entered? I case this is not a SAP-bug -> what is this freetext attribute then for?
    I though of creating a solution that works for all comboBoxes without having to know all IDs but I have no idea how to get dynamically the IDs of all comboBoxes and moreover the Get_Data Method doesn’t work here (returns wrong/empty object) although I use the “long ID”.
    View:
    <phtmlb:comboBox id = "SCC2SYNCLASSLOW"
                                     selection         = "//model/SCC_OVERLONGTEXT.SYN_CLASSLOW"
                                     table             = "//f4_model/F4HELP_SYN_CLASS"
                                     nameOfKeyColumn   = "KEY"
                                     nameOfValueColumn = "KEY"
                                     nameOfValue2Column = "VALUE"
                                     behavior           = "FREETEXT"
                                     />
    Handle_Event( ):
      comboBox ?= CL_HTMLB_MANAGER=>GET_DATA( request = request   name = 'phtmlb:comboBox' id = 'ccctrl_sccctrl_ccsearchctrl_SCC2SYNCLASSLOW' ).
    Frustrated I am…Thanks for any help!!
    Stefan.
    6.20 SP49

    Hi
    If you write a Bindable tag and change that variable  it will reflect automatically wherever you assigned that variable. so here the combobox will change whenever you change the array not the inside objects.
    Hope this helps.
    Rush-me

  • How to add lines in combobox?

    I want to add very thick colored lines in this combobox so ..
    how do i do that..
    thanks
    public class NewJFrame extends javax.swing.JFrame {
        /** Creates new form NewJFrame */
        public NewJFrame() {
            initComponents();      
        // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
        private void initComponents() {
            jComboBox1 = new javax.swing.JComboBox();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            getContentPane().add(jComboBox1, java.awt.BorderLayout.NORTH);
            pack();
        // </editor-fold>
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new NewJFrame().setVisible(true);
        // Variables declaration - do not modify
        private javax.swing.JComboBox jComboBox1;
        // End of variables declaration
    }

    I am exaplaining the code here.Please check once again.
    import java.awt.Component;
    import java.awt.FlowLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.util.Vector;
    import javax.swing.JComboBox;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JList;
    import javax.swing.JSeparator;
    import javax.swing.ListCellRenderer;
    import javax.swing.UIManager;
    import javax.swing.border.EmptyBorder;
    * @version 1.0 12/25/98
    public class BlockComboBoxExample extends JFrame {
      final String SEPARATOR = "SEPARATOR";
      public BlockComboBoxExample() {
        super("Block ComboBox Example");
        String[][] str = { { "A", "B", "C" }, { "1", "2", "3" },
            { "abc", "def", "ghi" } };
        JComboBox combo = new JComboBox(makeVectorData(str));
        combo.setRenderer(new ComboBoxRenderer());
        combo.addActionListener(new BlockComboListener(combo));
        getContentPane().setLayout(new FlowLayout());
        getContentPane().add(combo);
        setSize(300, 100);
        setVisible(true);
    /*This method makes a vector of data to be added to the combo box by iterating through the String array and after each element of array,the needSeparator is made true indicating a separator must be added*/
    private Vector makeVectorData(String[][] str) {
        boolean needSeparator = false;
        Vector data = new Vector();
        for (int i = 0; i < str.length; i++) {
          if (needSeparator) {
            data.addElement(SEPARATOR);
          for (int j = 0; j < str.length; j++) {
    data.addElement(str[i][j]);
    needSeparator = true;
    return data;
    public static void main(String args[]) {
    try {
    UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
    } catch (Exception evt) {}
    BlockComboBoxExample frame = new BlockComboBoxExample();
    frame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    /*This class is used to render the elements in ComboBox.When adding elements it checks for Separator,and if it is SEPARATOR then it returns a JSeparator object,causing a separator to be added in combo box.*/
    class ComboBoxRenderer extends JLabel implements ListCellRenderer {
    JSeparator separator;
    public ComboBoxRenderer() {
    setOpaque(true);
    setBorder(new EmptyBorder(1, 1, 1, 1));
    separator = new JSeparator(JSeparator.HORIZONTAL);
    public Component getListCellRendererComponent(JList list, Object value,
    int index, boolean isSelected, boolean cellHasFocus) {
    String str = (value == null) ? "" : value.toString();
    if (SEPARATOR.equals(str)) {
    return separator;
    if (isSelected) {
    setBackground(list.getSelectionBackground());
    setForeground(list.getSelectionForeground());
    } else {
    setBackground(list.getBackground());
    setForeground(list.getForeground());
    setFont(list.getFont());
    setText(str);
    return this;
    class BlockComboListener implements ActionListener {
    JComboBox combo;
    Object currentItem;
    BlockComboListener(JComboBox combo) {
    this.combo = combo;
    combo.setSelectedIndex(0);
    currentItem = combo.getSelectedItem();
    public void actionPerformed(ActionEvent e) {
    String tempItem = (String) combo.getSelectedItem();
    if (SEPARATOR.equals(tempItem)) {
    combo.setSelectedItem(currentItem);
    } else {
    currentItem = tempItem;
    Now you can use the same concept to add separator to ur combobox.

  • Empty ComboBox Custom Control.

    What am I missing here? This displays an empty combobox when
    called as
    such: <Ctrl:statusComboBox id="te_status" />. It works
    if I create an
    inline ComboBox, but I will want to use this same control in
    multiple
    locations in my application.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:ComboBox xmlns:mx="
    http://www.adobe.com/2006/mxml">
    <mx:Script>
    <![CDATA[
    [Bindable]
    public var status:String = '';
    ]]>
    </mx:Script>
    <mx:ArrayCollection>
    <mx:String>Reported</mx:String>
    <mx:String>Assigned</mx:String>
    <mx:String>Closed</mx:String>
    </mx:ArrayCollection>
    </mx:ComboBox>

    Solved my issue, had to use dataProvider not ArrayCollection
    as was
    shown in the ComboBox examples in the Developer's Guide.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:ComboBox xmlns:mx="
    http://www.adobe.com/2006/mxml">
    <mx:Script>
    <![CDATA[
    [Bindable]
    public var status:String = '';
    ]]>
    </mx:Script>
    <mx:dataProvider>
    <mx:String></mx:String>
    <mx:String>Reported</mx:String>
    <mx:String>Assigned</mx:String>
    <mx:String>Closed</mx:String>
    </mx:dataProvider>
    </mx:ComboBox>

  • PHTML Combobox and Firefox

    Hi,
    we're trying to use the phtmlb:combobox in a BSP page. In IE everything works fine, the user can select the data (or type in freeform data). When using Firefox however, the list of items is selected, but the user can't select an item (when selecting an item from the list -> nothing happens -> the item is not selected). Anyone experiencing the same behaviour?
    Thanks
    Daniel

    do you know a tutorial on this?Did you read the API for either JComboBox or JList????????
    Both contain links to the Swing tutorial.
    And why is it so difficult to post a Swing related question in the Swing forum???????

  • Does anyone have any suggestions to improve the performance to improve Firefox for andoid (more details).

    I'm using it on a Samsung Captivate SGHi-897 with Jellybean 2.2 (I'm unable to upgrade the OS @this time). Firefox was recommended by a freind, however, so far I've been very disappointed with it, as, it is extremely slow and constanly crashes. I've tried all of the suggestions provided, but there is no improvememt. I realize it may be not all that compatible with this properly working device or OS. I have Samsung Galxaxy SGHi-727 Skyrocket with IC 4.1, however, I've been waiting for a part for it coming from Aisa, which seems to be taking forever, so in the meantime I'm.stuck with this. I was wondering if you may have any suggestions on how to speed it up and prevent it from crashing so much, other than what's on your help guide since those changes I've tried make no improvement in it's performance. I would very much prefer to use Firefox on this device, as well as, after I repair my other device for a number of other reasons, but if I'm unable to improve it, I'll just go back to what I was using. Thank you and be well.
    twich83115
    [ed. removed email]

    Suggestion for improvement:
    I'd like <select size="1" multiple> to provide a dropdown with checkboxes like this:
    http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/checkboxes/defaultcs.aspx
    Can that be done?
    Thanks

  • Cascading filters not working in Design Studio with Universe

    Hi,
    I am trying to create cascading filters in Design Studio 1.2.
    I have one data source
    DS_P2 which returns two measures:
    (product code)
    (investment code)
    2 drop down boxes:
    PRODUCTCODEDROPDOWN_2 (product code)
    DROPDOWN_1 (investment code)
    1 crosstab component (to display DS_P2)
    Connecting to a BO Universe, Single Connection, relational SQL database
    Script On Startup:
    //To populate the product dropdown list & Set default value
    PRODUCTCODEDROPDOWN_2.setItems(DS_P2.getMemberList("_Rd3rMcNtEeOlu9zFKasaVQ", MemberPresentation.EXTERNAL_KEY, MemberDisplay.TEXT, 50,"All"));
    PRODUCTCODEDROPDOWN_2.setSelectedValue("All");
    //To populate the Investment dropdown list & set default value
    DROPDOWN_1.setItems(DS_P2.getMemberList("_9HY_4cBvEeOMbdZh-4RtVw", MemberPresentation.EXTERNAL_KEY, MemberDisplay.TEXT, 50, "All"));
    DROPDOWN_1.setSelectedValue("All");
    "On Select" script for PRODUCTCODEDROPDOWN
    //Filter data set P2
    DS_P2.setFilterExt("_Rd3rMcNtEeOlu9zFKasaVQ", PRODUCTCODEDROPDOWN_2.getSelectedValue());
    //Re-populate the Investment dropdown list & set default value
    DROPDOWN_1.setItems(DS_P2.getMemberList("_9HY_4cBvEeOMbdZh-4RtVw", MemberPresentation.EXTERNAL_KEY, MemberDisplay.TEXT, 50, "All"));
    DROPDOWN_1.setSelectedValue("All");
    The image below shows that the second dropdown box is not filtering correctly based upon the selection made in the first drop down box, the second box should display list, E_CASHUP, E_GWROTH, E_STABLE, S_GROW_ACT,ZZZZZZ, P_BAL_IDX
    Does any one know if there is a limitation to creating a cascading filter when using universes?
    Am I doing something wrong?
    ARRRGGGHHH any help appreciated

    Penny,
    You can try using SDK to achieve your goal.
    I posted once a ComboBox example, i know it does not do what you want right now, but it could be a starting point.
    ComboBox with custom items
    Mike also has some great examples here.
    entmike/Design-Studio-Repository · GitHub
    Good Luck.
    Best
    Leandro

  • Disabled foreground color in JComboBox

    what's the correct way to set the disabled foreground color of a jcombobox? i don't want to set the disabled color for the entire ui to the same color, but for one jcombobox specifically. i searched the web and found many posts with the same question, but no real solution. this one has been giving me nightmares and i thought i'd share what i've found. the solution seems to be quite simple: wrap the combobox label in a panel. that way the panel gets the disabled colors, but the coloring of the label of the combobox remains. here's the solution in short in case others need it:
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.FlowLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.DefaultListCellRenderer;
    import javax.swing.JButton;
    import javax.swing.JComboBox;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JList;
    import javax.swing.JPanel;
    import javax.swing.ListCellRenderer;
    public class MyComboBox extends JComboBox {
      public MyComboBox() {
        super();
        setRenderer( new ColorCellRenderer());
      public static void main(String s[]) {
        JFrame frame = new JFrame("ComboBox Example");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        final JComboBox cb = new MyComboBox();
        cb.addItem( "ComboBox Item 1");
        cb.addItem( "ComboBox Item 2");
        cb.addItem( "ComboBox Item 3");
        cb.setForeground( Color.blue);
        final JButton bt = new JButton ("disable");
        bt.addActionListener( new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            cb.setEnabled( !cb.isEnabled());
            if( !cb.isEnabled()) {
              cb.setForeground( Color.red);
              bt.setText( "enable");
            } else {
              cb.setForeground( Color.blue);
              bt.setText( "disable");
        frame.getContentPane().setLayout( new FlowLayout());
        frame.getContentPane().add( bt);
        frame.getContentPane().add( cb);
        frame.pack();
        frame.setVisible(true);
      class ColorCellRenderer implements ListCellRenderer {
        protected DefaultListCellRenderer defaultRenderer = new DefaultListCellRenderer();
        public Component getListCellRendererComponent(JList list, Object value,
            int index, boolean isSelected, boolean cellHasFocus) {
          JLabel label = (JLabel) defaultRenderer
              .getListCellRendererComponent(list, value, index,
                  isSelected, cellHasFocus);
          JPanel wrapper = new JPanel();
          wrapper.setLayout( new BorderLayout());
          wrapper.add( label, BorderLayout.CENTER);
          return wrapper;
    }if anyone knows a way to remove the dropdown button of a disabled combobox without leaving a blank space when you simply hide the button, feel free to extend this :-)
    Edited by: Lofi on Mar 20, 2010 10:46 PM

    i thought i'd share what i've found. the solution seems to be quite simple: wrap the combobox label in a panel.Brilliant! I'm sure this will be useful to others who find this solution here.
    Your code does have some unnecessary overheads though, like constructing a new JPanel in every call to getListCellRendererComponent, and holding a separate renderer as a field. I've attempted to clean it up for brevity and efficiency.import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.DefaultListCellRenderer;
    import javax.swing.JCheckBox;
    import javax.swing.JComboBox;
    import javax.swing.JFrame;
    import javax.swing.JList;
    import javax.swing.JPanel;
    import javax.swing.SwingUtilities;
    public class DisabledForegroundListCellRenderer extends DefaultListCellRenderer {
      private final JPanel wrapper = new JPanel(new BorderLayout());
      public DisabledForegroundListCellRenderer() {
        wrapper.add(this);
      @Override
      public Component getListCellRendererComponent(JList list, Object value,
              int index, boolean isSelected, boolean cellHasFocus) {
        super.getListCellRendererComponent(list, value,
                index, isSelected, cellHasFocus);
        return wrapper;
      // Test rig
      public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
          @Override
          public void run() {
            new DisabledForegroundListCellRenderer().makeUI();
      public void makeUI() {
        String[] data = {"One", "Two", "Three"};
        final JComboBox combo = new JComboBox(data);
        combo.setRenderer(new DisabledForegroundListCellRenderer());
        final JCheckBox check = new JCheckBox("Combo enabled");
        check.addActionListener(new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            boolean selected = check.isSelected();
            combo.setForeground(selected ? Color.BLUE : Color.RED);
            combo.setEnabled(selected);
        check.doClick();
        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setLocationRelativeTo(null);
        frame.add(check, BorderLayout.NORTH);
        frame.add(combo, BorderLayout.SOUTH);
        frame.pack();
        frame.setVisible(true);
    }I've also changed the class name, as to me "ColorCellRenderer" would rather imply something that renders either the foreground or the background (or both) on the basis of the value parameter.
    if anyone knows a way to remove the dropdown button of a disabled combobox without leaving a blank space when you simply hide the buttonThat would require a custom UI delegate, not a custom renderer. And really, I wouldn't bother -- I would just use a JComboBox and a disabled (or maybe uneditable) JTextField, held in a CardLayout, and swap them instead of disabling the combo.
    Shall take a look at how the combo UIs reserve space for the button though :)
    luck, db
    Edited by: DarrylBurke -- changed wrapper to private final, it shouldn't be static

  • Database feat java _combobox loading

    Good Morning
    I want to send value from an database into a combox box which is inside a GUI that is called from a main menu, but I don't know how to do this. ;-{ I have the code to retreive the information from the database, but how do I load the combo box.
    Connection conn = DriverManager.getConnection(URL, user, password);
        String SQL = "SELECT title FROM MOVIE";
        Statement stat = conn.createStatement();
        ResultSet rs = stat.executeQuery(SQL);
        while (rs.next())
          System.out.println(
            rs.getString(1)
        stat.close();
        conn.close();  I have two tables: "Movie" and "Customer". On the movie side I want to retreive the movie title and place that into a combo box that will allow me to select the title and press on a delete button that will delete this entry from the database. In the customer table I would like to achieve the same result but the only difference is that I have two combo boxes to select from. I did create a "Refresh" button, that will have to be pressed before any of the other buttons can be used, to load the combo boxes . This is the first statement before executing others which will UPDATE or DELETE records inside the database.
    How do I declare the combo boxes and how do I load the values from the database into the combo box?
    Please help
    Many Thanx
    SGT

    This is not a question about serialization, perhaps it is a question about swing.
    I suggest you search for examples of how to use a combo box.
    [http://www.google.co.uk/search?q=swing+combobox+example]

  • Tool Tip Text and JcomboBox/JList

    Is it possible to attach and display a different Tool Tip message for each item in a combobox or jlist.

    Hi try this code it will work
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.plaf.basic.*;
    public class ToolTipComboBoxExample extends JFrame {
    String[] items = {"Swing", "Applet", "RMI", "JDBC"};
    String[] tooltips = {"Swing ", "Applet", "RMI", "JDBC"};
    public ToolTipComboBoxExample() {
    super("ToolTip ComboBox Example");
    JComboBox combo = new JComboBox(items);
    combo.setRenderer(new MyComboBoxRenderer());
    getContentPane().setLayout(new FlowLayout());
    getContentPane().add(combo);
    class MyComboBoxRenderer extends BasicComboBoxRenderer {
    public Component getListCellRendererComponent( JList list,
    Object value, int index, boolean isSelected, boolean cellHasFocus) {
    if (isSelected) {
    setBackground(list.getSelectionBackground());
    setForeground(list.getSelectionForeground());
    if (-1 < index) {
    list.setToolTipText(tooltips[index]);
    } else {
    setBackground(list.getBackground());
    setForeground(list.getForeground());
    setFont(list.getFont());
    setText((value == null) ? "" : value.toString());
    return this;
    public static void main (String args[]) {
    ToolTipComboBoxExample frame = new ToolTipComboBoxExample();
    frame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
         System.exit(0);
    frame.setSize(300, 200);
    frame.setVisible(true);
    Thanks
    Paddy

  • JCombox custom size (reduced width) and popup size default (full width)

    Hi there ppl,
    Could somebody help me out of this pot hole? I have a JComboBox that has a reduced width:
    combo.setPreferredSize(new Dimension(100,25);
    but I want the popup to have a default size so it shows the full width of all the combo items.
    Thanks.

    Check out these [url http://www.senun.com/Left/Programming/Java_old/Examples_swing/SwingExamples.html]ComboBox Examples.

  • Country State combo on BSP

    hi all,
    I want to implement two combos one for country and the other for state.
    If I change the country,  then the corresponding states should get filled in the state combo.
    any suggestions how do I achieve the same. If possible without refreshing the page.
    thanks in advance.

    Hi,
    Here is the code:
    Layout:
              <phtmlb:comboBox id                = "state"
                                 behavior          = "FREETEXT"
                                 enabled           = "X"
                                 nameOfKeyColumn   = "name"
                                 nameOfValueColumn = "Value"
                                 width             = "90px"
                                 selection         = "<%= seleccted_state"
                                 table             = "<%= state_TAB %>" />
                <phtmlb:comboBox id                = "country"
                                 behavior          = "FREETEXT"
                                 enabled           = "X"
                                 nameOfKeyColumn   = "name"
                                 nameOfValueColumn = "Value"
                                 width             = "90px"
                                 onSelect          = "country_changed"
                                 selection         = "<%= selected_country"
                                 table             = "<%= country_TAB %>" />
    DO_HANDLE_EVENT/ONINITIALIZATION
    Note: state_tab is type of TIHTTPNVP.
    data:
          i_t005u  TYPE TABLE OF T005U,
          wa_t005u TYPE T005u,
          wa_kv    TYPE IHTTPNVP.
       DATA: t TYPE , entry TYPE .
      IF EVENT = '"country_changed'.      "Triggered when 'Country' Dropdown list selected
    if selected_country is initial.
    selected_country = 'US'
    endif.
    SELECT * FROM T005U INTO TABLE i_t005u
      WHERE SPRAS EQ SY-LANGU
      AND   LAND1 EQ selected_country.
    LOOP AT i_t005u INTO wa_t005u.
      CLEAR wa_kv.
      wa_kv-name = wa_t005u-bland.
      wa_kv-value = wa_t005u-bezei.
      CONDENSE wa_kv-value.
      IF NOT wa_kv-value IS INITIAL.
        APPEND wa_kv TO state_tab.
      ENDIF.
    ENDLOOP.
    SORT state_tab AS TEXT BY value ASCENDING.
    CLEAR wa_kv.
    wa_kv-name = ''.
    wa_kv-value = '        '.
    INSERT wa_kv INTO  state_tab INDEX 1.
    endif.
    Let me know if you any issue.
    <b>* Reward each useful answer.</b>
    Raja T
    Message was edited by:
            Raja T

  • MVC: DO_HANDLE_EVENT

    Ok this is a silly one and I'm just too close to it I think.
    I have a View/Controller: header.htm/header.do and one View/Controller: admin.htm/admin.do
    In my header I put a dropdownlist and I call header from inside my admin.do
    <bsp:call url="header.do" comp_id="hd" />
    But the DO_HANDLE_EVENT for header.do never activates when I select from the dropdownlist only DO_REQUEST,  dispatch_input( ) never goes into DO_HANDLE_EVENT??
    What am I doing wrong?

    OK I am calling ADMIN.DO via the URL
    ADMIN.DO loads the VIEW "admin/default.htm" which has a BSP call
    <%@page language="abap" %>
    <%@extension name="bsp" prefix="bsp" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <%@extension name="xhtmlb" prefix="xhtmlb" %>
    <htmlb:content design="design2003" >
      <htmlb:page title="Solution Central" >
        <htmlb:form method = "POST"
                    id     = "frmDetail" >
          <bsp:call comp_id = "hd" />
          <htmlb:group id      = "myG"
                       design  = "sapcolor"
                       tooltip = "Input selection"
                       width   = "100%" >
            <htmlb:groupHeader>
              <htmlb:textView text   = "Administration Tasks"
                              design = "HEADER1" />
            </htmlb:groupHeader>
            <htmlb:groupBody>
            </htmlb:groupBody>
          </htmlb:group>
          <xhtmlb:protectDoubleSubmit text   = "Loading..."
                                      active = "true"
                                      title  = "Please Wait" />
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    The DO_INIT of ADMIN.DO (ZCL_C_ADMIN)
      model ?= create_model( class_name = 'ZSC_CL_M_MAIN'
                               model_id = 'mf' ).
      header_controller ?= create_controller( controller_name = 'header.do'
                                              controller_id   = 'hd' ).
    DO_REQUEST (ADMIN.DO)
    * Object definitions
      data: iterator TYPE REF TO ZSC_TABLE_ITERATOR_SYSTEMS.
    * Create objects
      CREATE OBJECT iterator TYPE ZSC_TABLE_ITERATOR_SYSTEMS.
    * Create pointer to model
      model ?= get_model( 'mf' ).
    * Data definitions
      data: default_view type ref to if_bsp_page.
    * Start event handling
      dispatch_input( ).
    * Create view
      default_view = create_view( view_name = 'admin/default.htm' ).
    * Call view
      call_view( default_view ).
    DO_REQUEST (HEADER.DO)
    * Data definitions
      data: default_view type ref to if_bsp_page.
    * Create view
      default_view = create_view( view_name = 'header.htm' ).
    * Set Attributes
      default_view->set_attribute( name = 'lv_name'
                                   value = m_usrname ).
      default_view->set_attribute( name = 'lv_fullname'
                                   value = m_usrfullname ).
      default_view->set_attribute( name = 'lv_lang'
                                   value = m_usrlang ).
      default_view->set_attribute( name = 'lv_lang_graphic'
                                   value = m_usrlang_graphic ).
      default_view->set_attribute( name = 'lv_id'
                                   value = m_usrid ).
      default_view->set_attribute( name = 'lv_dept'
                                   value = m_usrdept ).
      default_view->set_attribute( name = 'lv_global_menu'
                                   value = m_global_menu ).
    * Call view
      call_view( default_view ).
    My page displays wonderfully and I see everything with all my data.
    It's just not jumping in to process that dropdownlistBox
                          <phtmlb:comboBox id                 = "MyGlobalMenu"
                                           table              = "<%= lv_global_menu %>"
                                           nameOfKeyColumn    = "menu_id"
                                           nameOfValueColumn  = "menu_img"
                                           nameOfValue2Column = "menu_text"
                                           onSelect           = "MyGlobalMenuSelect" />
    Here the code is ComboBox but either way.  The DO_HANDLE_EVENT just doesn't fire.

Maybe you are looking for