JTextField.select(int, int) not working in modal JDialog

Hi
I have discovered something peculiar. When I have a JDialog, and it is modal, then the select method of any JTextfield will surely fail. (Only tested on win32)
What the owner is does not matter (even null will give the same result). I made a JFrame for your convenience.
import javax.swing.*;
public class MyDialog extends JDialog
     private JTextField     tf     = new JTextField("not selected >selected< not selected");
     public static void main(String[] args)
          JFrame f = new JFrame("Some parent frame");
          f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          f.setVisible(true);
          new MyDialog(f);
     public MyDialog(JFrame parent)
          super(parent, "Child dialog", /*Selecct modality*/ true);
          // super();
          super.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
          super.add(this.tf);
          super.pack();
          super.setLocation(0, 50);
          super.setVisible(true);
          // Selection does not work when dialog is modal.
          this.tf.select(14, 22);
          this.tf.requestFocus();
}I did not find a bug in the database concerning this.
Did I do something wrong, or should I post this as a bug?

1) Please do not dredge posts that are months or years old. If you have something important to say, create your own thread.
2) If you have the same problem, then use the same solution.
3) If this doesn't work, then show your problem: show your code. We don't want to see all of it, but rather you should condense your code into the smallest bit that still compiles, has no extra code that's not relevant to your problem, but still demonstrates your problem, in other words, an SSCCE (Short, Self Contained, Correct (Compilable), Example). For more info on SSCCEs please look here:
http://homepage1.nifty.com/algafield/sscce.html
Also, when posting your code, please use code tags so that your code will be well-formatted and readable. To do this, either use the "code" button at the top of the forum Message editor or place the tag &#91;code&#93; at the top of your block of code and the tag &#91;/code&#93; at the bottom, like so:
&#91;code&#93;
  // your code block goes here.
&#91;/code&#93;

Similar Messages

  • Select() function is not working properly in solaris 10.

    Hi ,
    We are facing an issue with select() in Solaris 10. we had written a sample program to this issue.
    Program name :- sel.cpp
    int main()
    struct timeval sleeptime;
    sleeptime.tv_sec = 60;
    printf("1\n");
    select(0,NULL,NULL,NULL,&sleeptime);
    printf("2");
    return 0;
    When i run this program in Solaris 9, its printing 1 and after one minute its printing 2.
    When i run this program on Solaris 10, its printing 1 and 2 without waiting for 60 seconds.
    When i tried to print tv_usec, its printing as 0 in solaris 9 and some garbage values in solaris 10.
    I think because of that the above select function is not working properly in solaris 10.
    Why the tv_usec is not taking 0 as default values in Solaris 10?
    We are using our legacy code for past 20 years. So, before going to do any changes we are trying to find why this happenig like this.
    Thanks a lot.
    Regards,
    Srikanth.

    haisrig wrote:
    Hi ,
    We are facing an issue with select() in Solaris 10. we had written a sample program to this issue.
    Program name :- sel.cpp
    int main()
    struct timeval sleeptime;
    sleeptime.tv_sec = 60;
    printf("1\n");
    select(0,NULL,NULL,NULL,&sleeptime);
    printf("2");
    return 0;
    When i run this program in Solaris 9, its printing 1 and after one minute its printing 2.
    When i run this program on Solaris 10, its printing 1 and 2 without waiting for 60 seconds.
    When i tried to print tv_usec, its printing as 0 in solaris 9 and some garbage values in solaris 10.
    I think because of that the above select function is not working properly in solaris 10.
    Why the tv_usec is not taking 0 as default values in Solaris 10?
    We are using our legacy code for past 20 years. So, before going to do any changes we are trying to find why this happenig like this.Hi
    It sounds to me that you've been lucky for 20 years then.
    Local POD variables on the stack that aren't explicitly initialized can contain any value. Here's what I see in your app with dbx
    (dbx) run
    Running: sel
    stopped in main at line 9 in file "sel.cpp"
        9      sleeptime.tv_sec = 60;
    (dbx) print sleeptime
    sleeptime = {
        tv_sec  = -4198732
        tv_usec = 0
    }That's on a Solaris 10 SPARC machine. If I try it on a Solaris 10 x86 box then I get
    (dbx) print sleeptime
    sleeptime = {
    tv_sec = -830490588
    tv_usec = 134510556
    and I see the behaviour that you describe.
    Paul

  • Why select query is not working?

    CREATE OR REPLACE TYPE prod_type AS OBJECT (
    pid INT,
    pprice NUMBER,
    MEMBER PROCEDURE display(pid IN NUMBER));
    create table prod of prod_type (pid primary key);
    CREATE OR REPLACE TYPE deal_type UNDER prod_type (
    ctr NUMBER,
    OVERRIDING MEMBER PROCEDURE display (pid IN NUMBER),
    insert into prod values(deal_type(101, 4, 1));
    insert into prod values(deal_type(102, 5, 0));
    ------below given select query is NOT WORKING ---------
    select ctr from prod p where p.pid=101;
    Thanks,
    -Nid

    ------below given select query is NOT WORKINGWondering how you inserted data ...
    SQL> CREATE OR REPLACE TYPE prod_type AS OBJECT (
      2  pid INT,
      3  pprice NUMBER,
      4  MEMBER PROCEDURE display(pid IN NUMBER));
      5  /
    Type created.
    SQL>
    SQL> create table prod of prod_type (pid primary key);
    Table created.
    SQL>
    SQL> CREATE OR REPLACE TYPE deal_type UNDER prod_type (
      2  ctr NUMBER,
      3  OVERRIDING MEMBER PROCEDURE display (pid IN NUMBER),
      4  );
      5  /
    Warning: Type created with compilation errors.
    SQL> sho err
    Errors for TYPE DEAL_TYPE:
    LINE/COL ERROR
    4/1      PLS-00103: Encountered the symbol ")" when expecting one of the
             following:
             , not pragma <an identifier>
             <a double-quoted delimited-identifier> final instantiable
             current order overriding static member constructor map
    SQL> CREATE OR REPLACE TYPE deal_type UNDER prod_type (
      2  ctr NUMBER,
      3  OVERRIDING MEMBER PROCEDURE display (pid IN NUMBER));
      4  /
    Warning: Type created with compilation errors.
    SQL> sho err
    Errors for TYPE DEAL_TYPE:
    LINE/COL ERROR
    1/1      PLS-00590: attempting to create a subtype UNDER a FINAL type
    SQL>You made an attempt to create a subtype UNDER a FINAL type - that the reason why can not work ...
    Avoid deriving a subtype from this FINAL type.
    HTH

  • Select query is not working in BDC Program

    Hi,
    I am working in BDC for update valuation class for T-code mm01.Actually In this BDC i am using two recoding based on material type.
    i am using two internal table : I_DATA and ITAB
    Use I_DATA to hold excle data in which material No, plant , valuation type , valuation No. and ITAB for material No, material type Only.
    So, i am fetching material Type ( MARA-MTART ) through select query. But Select query is not working. and also i did check MARA table according that  Material Number then  material no. exit in Mara Table.
    Note : at run time  I_DATA have 1 row but ITAB have 0 row ....
    DATA: BEGIN OF I_DATA OCCURS 0,
    MATNR TYPE MARA-MATNR,
    WERKS TYPE MARC-WERKS,
    BWTAR TYPE RMMG1-BWTAR,
    VERPR TYPE BMMH1-VERPR,
    BKLAS TYPE MBEW-BKLAS,
    STATUS TYPE C,
    END OF I_DATA.
    DATA : BEGIN OF ITAB OCCURS 0,
    MATNR LIKE MARA-MATNR,
    MTART LIKE MARA-MTART,
    END OF ITAB.
    Loop at I_DATA.
    select matnr mtart from mara into table itab where matnr = I_DATA-matnr.
    endloop.
    Guide me..........

    If you use your
    Loop at I_DATA.
      select matnr mtart from mara into table itab
        where matnr = I_DATA-matnr.
    endloop.
    At end of loop, itab will only contain the result of the last select, so use a
    Loop at I_DATA.
      select matnr mtart from mara APPENDING table itab
        where matnr = I_DATA-matnr.
    endloop.
    better
    if I_DATA[] is not initial.
      select matnr mtart from mara into table itab
        FOR ALL ENTRIES IN i_data where matnr = i_data-matnr.
    endif.
    Some Remarks
    - If actually required (where does I_DATA come from, is it an external format, you need the internal value to use in SELECT statement), check via SE11 the correct [conversion exit|http://help.sap.com/saphelp_nw04/helpdata/en/35/26b217afab52b9e10000009b38f974/content.htm] associated with domain MATNR (Is it truly ALPHA, and not something like MATN1, so [CONVERSION_EXIT_MATN1_INPUT|http://www.sdn.sap.com/irj/scn/advancedsearch?query=conversion_exit_matn1_input])
    - You could try to use BAPI like [BAPI_MATERIAL_SAVEDATA|http://www.sdn.sap.com/irj/scn/advancedsearch?query=bapi_material_savedata] and not BDC
    Regards,
    Raymond

  • Extension in Select-Options is not working

    Hi,
    The extension of select-options is not working for the following statement........
    SELECTION-SCREEN: BEGIN OF BLOCK sel WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_tp_no FOR e070-trkorr.
    SELECTION-SCREEN: END OF BLOCK sel.
    Please Help.......
    Thanks,
    Sheel

    SELECTION-SCREEN: BEGIN OF BLOCK sel WITH FRAME TITLE text-001.
    SELECTION-SCREEN: END OF BLOCK sel.
    Remove the colan ':' from ur code after SELECTION-SCREEN
    write it as
    SELECTION-SCREEN BEGIN OF BLOCK sel WITH FRAME TITLE text-001.
    SELECTION-SCREEN END OF BLOCK sel.

  • Select button will not work

    My 2gb nano's select button will suddenly not work. The rest of the clickwheel and buttons work find, but not the center select button.
    I restored it to original settings. Then after it restarts, you have to select a language. The select button would still not work, but then I slid the "hold" button back and forth and the select button worked to allow me to chose a language. But at the next screen of options (Music/Photos/Extras, etc.) the select button will again not work. Sliding the hold button back and forth doesn't work. I cannot do a menu+select reset because I can't get the select button to respond.
    I have made sure that I have the most updated softward for the nano.
    Any suggestions?

    My select button has not worked for a loong time.. It will occasionally work if I press for long enough or hard enough.. but not very often. This seems to be a common enough problem so there should be a way to fix it..I hope..

  • Select list pagination not working for big tables

    Hi,
    i am trying to view a table with large amount of data using tabular form. the pagination using select list is not working in this page. i have selected select list kind of pagination but it is showing "row range 1-15 16-30(with set pagination)' type of pagination. when i lowered the amount of data in the table the pagination type will automatically change to select list pagination. could you please tell me why this happens and any possible work around if any.
    Thanks,
    Jo

    Hi Jo,
    I don't know what you call a large amount of records, but the effect you describe might be intentional by apex.
    The select list pagination would generate a selection tag with (number of records in table/15) options in your page HTML.
    Although there isn't a hard limit to the number of options a select list can have there certainly is a limit to what your browser/pc can render.
    Think about it
    Let's say you table contains a million rows. this would result to a select list with 66666 options. Which your browser won't handle :)
    I very possible the apex team resolved this by simply reverting to row range pagination when the number of select options would grow to large.
    Geert

  • SELECT DISTINCT does not work - Another Problem!

    Dear All
    Previous Post
    I just posted a thread, which has been answered by an expert. It's here:
    SELECT DISTINCT does not work. Why?
    My original problem was that the Query returned duplicate records, and SELECT DISTINCT did not work.
    The solution was to change this select:
    T0.[U_SupInv]      AS 'Link'
    ... to this:
    CAST(T0.[U_SupInv] as nvarchar(100))      AS 'Link'
    The amended Query worked.
    New Problem
    I just discovered that resolving the problem created a new one.
    The field U_SupInv (Link) is in fact a UDF.
    I created it so that all Suppliers' Invoices could be Scanned to pdf files, and these pdf could be linked
    to the respective AP Invoice.
    Originally, when I clicked 'Link' in my Query results, the pdf scan pops up.
    When the Query is amended by adding CAST, the link becomes dead.
    Help
    Could anyone tell me how I can make SELECT DISTINCT work, as well keeping the LINKS live?
    The main purpose of my Query is to help users view the pdf scans by clicking on the links.
    Thanks
    Leon Lai
    Here's my Original Query
    SELECT
    T0.[UpdateDate] AS 'Update Dt',
    T0.[TaxDate] AS 'Doc Dt',
    CASE T5.[TransType]
         WHEN '18' THEN 'PU ' + CONVERT(VARCHAR(6), T0.[DocNum])
         WHEN '19' THEN 'PC ' + CONVERT(VARCHAR(6), T0.[DocNum])
    END 'SAP Ref.',
    T1.[ImportLog]     AS 'Ship #',
    T0.[CardCode] + '' AS 'Supplier #',
    T0.[CardName]      AS 'Supplier Name',
    T0.[DocTotal]      AS 'Rs',
    T1.[BlockNum]      AS 'Reqn #',
    T0.[DocNum]        AS 'Doc No',
    T0.[U_SupInv]      AS 'Link'
    FROM klship.[dbo].[OPCH] T0
    INNER JOIN klship.[dbo].[PCH1] T1 ON T0.[DocEntry] = T1.[DocEntry]
    INNER JOIN klship.[dbo].[OJDT] T5 ON T0.[TransID] = T5.[TransID]
    WHERE
    (T0.[UpdateDate] >= '[%2]' AND
    T0.[UpdateDate]  <= '[%3]' AND
    T0.[U_SupInv] IS NULL)
    OR
    (T0.[UpdateDate] >= '[%4]' AND
    T0.[UpdateDate]  <= '[%5]' AND
    T0.[U_SupInv] IS NOT NULL)
    FOR BROWSE

    Dear István Korös,
    Thanks a lot for your answer.
    I will test your suggestion tomorrow, as it's night and I am returning home now.
    However, I do not think it will suit my requirements for the foll reasons:
    - I worked hard to get rid of the need to enter anything in the @Scan2 field.
    - This UDF was created solely as a text of instruction for my staff.
       Unfortunately I had to fill in something to make the Query work.
    - The problem is that if the user forgets to click the drop-down arrow and leaves @Scan2
       blank, the query does not work.
    - With the help of another expert, I succeeded in ignoring @Scan2 altogether.
    - I posted only a simplified version of my Query on the forum, without the codes relating to eliminating the
      need to enter something in @Scan2, so you may not be aware of my requirement.
    - I hope you understand my reluctance. But I will try your suggestion nevertheless.
    My Suggestion
    I think using PCH1.VISORDER may be the solution.
    If we select only those rows where visorder = 0, then
       - there will be no duplication
       - I need not use SELECT DISTINCT
       - All my LINKS to pdf files will be live because I need not use CAST
       - I may retain that part of my Query which permits ignoring @Scan2 altogether.
    - A Dream!-
    The problem is that I don't know how and where  to place that VISORDER.
    If you think I may be right, could you help me along that line?
    Best Regards
    Leon Lai

  • Multi-select LOV does not work in forms

    the multi select LOV does not work in the form.
    the LOV works individually but in the form it does not work. it does not allow multiple selection from the list.
    is there a workaround for this or is this a bug ...?
    any ideas ...?
    thanx a lot.
    null

    Right, we cannot store more than one value in a single column in a table :), we were getting a lot of requests to support multiple select LOVs but requirements were contradictory if not mutually exclusive.
    The only sense it makes is when used together with user-defined object types (nested tables for example) but the current [application building]infrastructure we have does not support this. However, we are looking into this and this feature maybe implemented in a future release.

  • Double click select all does not work in web site's search area after going back.

    After updating from Firefox ESR v24.8.1 to v31.20 double click select all does not work in a search area after going back or searching again with the same input. It happens before clicking search icon and searching for something else double click select all does not work except it works for one word that's all.
    This issue is with all new Firefox ESR and None ESR I have tried. Also the issue is on all web sites like www.softpedia.com for example.

    Bugzilla has a different login system, unfortunately.

  • "Select Color Range" not working. "Warning: No pixels were selected" returned when attempting to use. Using Photoshop CS6 on a Mac running OS X Yosemite

    "Select Color Range" not working. "Warning: No pixels were selected" returned when attempting to use. Using Photoshop CS6 on a Mac running OS X Yosemite

    Here are three screenshots in succession from trying to perform the color selection:
    Dropbox - Screenshot 2015-02-12 14.57.40.png
    Dropbox - Screenshot 2015-02-12 15.00.14(2).png
    Dropbox - Screenshot 2015-02-12 15.01.00.png

  • Zen Micro 5gb - Playlist on the fly with "add to selected" often does not work (AD HOC 'playlis

    I've found ad-hoc playlist made from ADD TO SELECTED often does not work. Here are other issues:?. Does not add? at all OR only adds after first song selected played2. Cannot swith from ARTISTS to SONGS w/o killing list. This will kill the ongoing list.3. If I make mistake and hit the PLAY button, it wipes out the entire list I'd already made. Any of these issues resolved in Zen Vision M?

    try reloading the firmware and if that doesnt work try opening the case and cleaning it if there is anything in there. the button may be stuck. and if that doesnt work i dont know what else to sugjest. it seemed to work for me.

  • SetSize(int,int) not working in JTextPane.. Please help

    Hi,
    I want to set size of JTextPane so that by default it should show atleast 2 lines.
    I am using setSize(int, int) , but its not working.
    Can anybody help me?

    hi
    From onwards, I will take care of it.. I will put my query in particular category only.
    Actually I tried this one also...
    Following is my method in which I want to set size of JtextPane
    public JPanel initComponents(Vector columnNames, Vector dbNames, Vector data) {
    fieldrefs = new JTextComponent[columnNames.size()];
    JPanel content = new JPanel();
    content.setLayout(new GridBagLayout());
    content.setSize(900,900);
    // Create Menubar
    JMenuBar menuBar = createMenuBar();
    setJMenuBar(menuBar);
    GridBagConstraints gbc = new GridBagConstraints();
    //some code
    gbc.gridx = 2;
    gbc.gridy = 0;
    gbc.insets = new Insets(SG_SwingUtilities.BORDER_COMP, // (top, left, bottom, right)
    SG_SwingUtilities.BORDER_COMP, 0, 0);
    gbc.anchor = GridBagConstraints.NORTHWEST;
    JLabel pathLabel = new JLabel(stringPath);
    Font font = new Font(null, Font.BOLD, 12);
    pathLabel.setFont(font);
    content.add(pathLabel, gbc);
    // Insert all the fields.
    for (int i = 0, j = 0; i < columnNames.size(); i++, j += 2) {
    int gridy = i + 1;
    String label = (String) columnNames.elementAt(i); // Name of column.
    gbc = new GridBagConstraints();
    gbc.gridy = gridy;
    gbc.insets = new Insets(SG_SwingUtilities.BORDER_COMP, SG_SwingUtilities.BORDER_COMP, 0, 0);
    gbc.anchor = GridBagConstraints.NORTHWEST;
    content.add(new JLabel(label), gbc);
    if ((i == 4 || i == 5) || (i == 2 && (isMacroNode || isSystemNode))) {
    // tagstart and tagend are expanded in HORIZONTAL direction.
    gbc.fill = GridBagConstraints.BOTH;
    gbc.weightx = 1.0;
    gbc.weighty = 1.0;
    if(i==5)
         styledDocEnd = new DefaultStyledDocument();
    fieldrefs[i] = new JTextPane(styledDocEnd);
    }else
    styledDocStart = new DefaultStyledDocument();
    fieldrefs[i] = new JTextPane(styledDocStart);
    if (i == 5) {
         textarea2 = new JTextPane(styledDocEnd); // I want to set this JtextPane size      
    textarea2 = (JTextPane)fieldrefs;
         fieldrefs[i].setSize(100,500);
    tagEndField = new JPanel(new GridBagLayout());
    content.add(tagEndField, gbc);
    normalComponent2 = new JScrollPane(fieldrefs[i]);
    setNormalMode(2);
    // my code
    else {
    // TagStart      
         textarea1 = new JTextPane(styledDocStart); // I want to set this JtextPane size
         textarea1 = (JTextPane)fieldrefs[i];//me
         fieldrefs[i].setSize(100,500);
    tagStartField = new JPanel(new GridBagLayout());
    content.add(tagStartField, gbc);
    normalComponent1 = new JScrollPane(fieldrefs[i]);
    setNormalMode(1);
    /// my code
    fieldrefs[i].addMouseListener(new MouseAdapter() {
    public void mouseClicked(MouseEvent me) {
    // DOUBLE (left) CLICK
    if (data != null && !data.isEmpty()) {
    if (data.elementAt(j) != null) {
    String insertData = data.elementAt(j) + "";
    insertData = insertData.replaceAll("\\&\\{\\}", ""); // remove dummy ref
    insertData = insertData.replaceAll("\r", "");
    fieldrefs[i].setText(insertData);
    if(i==4 || i==2)
    insertLineBreaks(textarea1);
    updateColors(textarea1.getText(),true); //me
    if(i==5)
    insertLineBreaks(textarea2);
         updateColors(textarea2.getText(),false); //me
    else if (i == 5) {
    gbc.fill = GridBagConstraints.BOTH;
    gbc.weightx = 1.0;
    gbc.weighty = 1.0;
    fieldrefs[i] = new JTextArea(3, 10);
    fieldrefs[i].setForeground(new Color(0, 0, 255));
    // ((JTextArea) fieldrefs[i]).setLineWrap(true);
    if (data != null && !data.isEmpty()) {
    if (data.elementAt(j) != null) {
    String insertData = data.elementAt(j) + "";
    insertData = insertData.replaceAll("\\&\\{\\}", ""); // remove dummy ref
    fieldrefs[i].setText(insertData);
    content.add(new JScrollPane(fieldrefs[i]), gbc);
    else {
    fieldrefs[i] = new JTextArea(2, 10); // description field.
    ((JTextArea) fieldrefs[i]).setLineWrap(true);
    if (data != null && !data.isEmpty()) {
    if (data.elementAt(j) != null) {
    fieldrefs[i].setText(data.elementAt(j) + "");
    content.add(new JScrollPane(fieldrefs[i]), gbc);
    //code
    return content;
    } // initComponents
    protected JTextComponent[] fieldrefs = null; is taken from super class
    Message was edited by:
    ring

  • Combo box selected index is not working.

    Hi guys, I have a problem with changing the combo box selected index.
    I load a list of phone types(such as "Home","Office",...) using Remote Object and assign it as a data provider for a combo box.What I need is to select a specific index in the combo but combo.selectedIndex statement doesn't work for the first time, I mean the combo changes its index only if I load the view again.
    I checked different examples, solutions but none of them worked for me!! Can anyone here help me to figure out the problem?
    Here is my Code:
    <mx:Canvas creationComplete="init()"
                 xmlns:mx="http://www.adobe.com/2006/mxml">
         <mx:ComboBox id="comboPhone0"
                    prompt="Type"
                    dataProvider="{phoneTypeList}"
                    />
    <mx:Script>
         <![CDATA[
    [Bindable]
    private var phoneTypeList:ArrayCollection;
    private function init():void
         loadPhoneType();
    private function loadPhoneType():void
         phoneTypeLoaderService.getPhoneType(); //phoneTypeLoaderService is a remote Object to load the phone types
    private function handlephoneTypeLoadResult(ev:ResultEvent):void
         phoneTypeList=ev.result as ArrayCollection;
            comboPhone.selectedIndex = getComboSelectedIndex("HOME");
    private function getComboSelectedIndex(phoneType:String):int
    var index : int= -1;
    var result : int= -1;
         for each (var pt:PhoneType in phoneTypeList)
              if (pt.type == phoneType)
                        result = index;
                        break;
              else{
                   index++;
              return result;
         ]]>
         </mx:Script>
    </mx:Canvas>

    hi
    I think in getComboSelectedIndex() method index should initialized to zero. If that does not work use after assigning the data from result event.
    phoneTypeList.refresh();
    Hope this helps
    Rush-me

  • Checkbox group selected property binding not working

    Hi,
    I've been through all the threads and tutorials relating to this problem and none of them help.
    The Situation
    I have a checkbox group which I have bound the items items property to a MySQL database (value field = int, display field = String). I have bound the Selected property to a sessionbean field which is an int[] array.
    I have a processValueChange event for my checkbox group which grabs the selected boxes values (ie the int value of the checkbox id). Based on these values it does some other processing.
    The Problem
    When the page loads everything is displayed ok. When I select a checkbox within the checkbox group the getSelected() method returns the int value of the selected checkbox and perform other processing as necessary... so far so good.
    However, when the page finishes processing and reloads the selected checkboxes are not ticked. I'm sure it has something to do with the Selected property of the checkboxgroup but I can't for the life of me work out why. For multiselect objects the Selected property must be bound to an array which I have done with my int[] array. I've tried preloading the array with default values (1, 2, etc) to mimic the int values from the database. I've tried changing the array to a boolean array but this throws exceptions. So basically i'm stuck.
    The Source
    Session Bean
        private int[] extras;
        public int[] getExtras() {
            return this.extras;
        public void setExtras(int[] extras) {
            this.extras = extras;
    Page JSP
    <ui:checkboxGroup binding="#{book_package.extras}"
                                                                                    converter="#{book_package.extrasConverter}" id="extras"
                                                                                    items="#{book_package.extrasDataProvider.options['extras.ExtrasID,extras.Name']}"
                                                                                    onClick="common_timeoutSubmitForm(this.form, 'table:tr:td:table:tr:td:table:tr:td:div:div:table:tr:td:extras');"
                                                                                    selected="#{SessionBean1.extras}" valueChangeListener="#{book_package.extras_processValueChange}"/>
    Page Java
        public void extras_processValueChange(ValueChangeEvent event) {
            // TODO: Replace with your code
            getSessionBean1().setExtrasTotal(0);
            try {
                int[] extra = (int[])extras.getSelected();
                int extrasId = 0;
                int extraPrice = 0;
                if (extra.length != 0) {
                    for (int i=0; i < extra.length; i++) {
                        extrasDataProvider.cursorFirst();
                        do {
                            extrasId = new Integer(extrasDataProvider.getValue("ExtrasId").toString()).intValue();
                            if (extrasId == extra) {
    extraPrice = getSessionBean1().getExtrasTotal() + new Integer(extrasDataProvider.getValue("Price").toString()).intValue();
    getSessionBean1().setExtrasTotal(extraPrice);
    break;
    } while (extrasDataProvider.cursorNext());
    } catch (Exception e) {
    log("Exception occurred!!", e);
    error("Error: "+e.getMessage());
    getSessionBean1().setTotalPrice(getSessionBean1().getPackagePrice() + getSessionBean1().getExtrasTotal());
    Any help appreciated.
    Thanks.

    ok, i found the problem. MySQL int value is treated as an Integer in Creator. I changed my SessionBean array from int[] to Integer[] and now it works properly... phew!!!

Maybe you are looking for

  • Worst Customer support

    Worst customer expense ever, three think pad’s and this v570 latter and all they say is try again. After this im done with their products This is my experience over what has become a 2 month long episode and a very bitter ending for me. I recently b

  • Jabber and AIM/.Mac contacts in ONE window

    I would like to have a single iChat window that combines the Jabber and AIM/.Mac buddies. That way I can log on to AIM directly from iChat (and use video/audio) and also be able to log on to google chat MSN via jabber gateways. I hate having two diff

  • Link to download Adobe Design Premium CS5.5

    Hi there, I am looking for a link to download Adobe Design Premium CS5.5 to my new iMac as it doesn't have a disc drive. Can someone please point me in the right direction?! Many thanks Si

  • I am unable to write address in contacts as keyboard does not pop up

    I am unable to write address in contacts as keyboard does not pop up. How do I input address?

  • XML column letter as opposed to column number

    Hi, I upload an XML file to and xstring and used a series of IF_IXML* interfaces to capture it's contents.  Thru these, I'm able to get the column count.  But, I can't seem to find a way to get the corresponding letter of the columns, i.e., A B C, et