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!!!

Similar Messages

  • End User SPAM Quarantine checkbox to select all messages not working

    We are running SPAM Quarantine on M670 running 8.1.0-476 and accessing with Internet Explorer 9.0.   After logging into the SPAM Quarantine there is a top row check box that normally we can check to select all messages.  This stopped working in IE for us, any idea what setting/option we could adjust to enable it again?
    In Chrome 29, FireFox 23 it works as expected.
    Jason

    I think this is a know bug in 8.0, see below:
    CSCuj42166
    Selecting all messages in ISQ at once not possible with IE 8.0/7.0/6.0
    Symptom:
    When accessing the spam quarantine on ESA using IE 8.0/7.0/6.0 and trying to select all messages at once, an error occurs and no message is checked. At the bottom of the browser we see an "Error on page"
    Conditions:
    ESA running 8.0.0-671 and Internet Explorer 8.0 (same valid for 6.0 and 7.0)
    Workaround:
    Using a different browser to access the Centralized Spam Quarantine like for example Safari, Mozilla Firefox, Google Chrome, Internet Explorer 9
    Further Problem Description:
    Details
    Known Affected Releases: (2)
    8.0.0(Venetian)-671 | 8.5.0(FourQueens)-0
    Known Fixed Releases: 0
    Release Pending
    Product: Cisco Email Security Appliance

  • 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

  • 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..

  • 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 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.

  • Dragging keywords from HUD to group of selected images suddenly not working.

    Have used this method for a long time but tonight it is not working?  Only drops keyword on a single image even though multiple images are selected.  Any ideas?

    You may have the "Primary only" flag selected, see this user tip:
                     Keywords or ratings are applied only to one of the selected images - why?
    Regards
    Léonie

  • Some bidirectional binding not works

    Hello!
    Maybe I do something wrong, but bidirectional binding in thic simple code not works properly.
    package simple;
    import javafx.application.Application;
    import javafx.scene.GroupBuilder;
    import javafx.scene.Scene;
    import javafx.scene.SceneBuilder;
    import javafx.scene.control.CheckBox;
    import javafx.scene.control.CheckBoxBuilder;
    import javafx.scene.paint.Color;
    import javafx.stage.Stage;
    public class BiDiBug extends Application {
      CheckBox checkBoxResizable;
      public static void main(String[] args) {
        Application.launch(args);
      @Override
      public void start(Stage stage) {
         stage.setResizable(true);
        Scene scene  = SceneBuilder.create()
          .width(200)
          .height(100)
          .fill(Color.TRANSPARENT)
          .root(
            GroupBuilder.create()
                 .children(
                    checkBoxResizable = CheckBoxBuilder.create()
                      .selected(stage.isResizable())
                      .text("Is Stage resizable")
                      .build()
                  .build()
           .build();
        checkBoxResizable.selectedProperty()
                .bindBidirectional(stage.resizableProperty());
        // This code not works too:
        //stage.resizableProperty()
        //          .bindBidirectional(checkBoxResizable.selectedProperty());
        stage.setScene(scene);
        stage.show();
    }Is it bug or feature?

    The binding seems to work, in the sense that stage.resizable gets updated accordingly. Try adding the following:
        stage.resizableProperty().addListener(new ChangeListener<Boolean>() {
          @Override
          public void changed(ObservableValue<? extends Boolean> observable,
              Boolean oldValue, Boolean newValue) {
            System.out.printf("stage.resizable changed from %s to %s%n", oldValue, newValue);
        });and you'll see that the resizable property does indeed change when you check/uncheck the checkbox.
    On my setup (Mac OSX 10.7.5), under JavaFX 2.2.7, JDK 1.7.0_17, I observe the same behavior as you: the resize behavior of the stage does not correspond to the value of its property. The [url http://docs.oracle.com/javafx/2/api/javafx/stage/Stage.html#resizableProperty]Javadocs for stage.resizable do say "This is a hint which allows the implementation to optionally make the Stage resizable by the user." So in fairness, there is no guarantee given that changing this value will have the desired effect.
    Interestingly, under JavaFX 8, JDK 1.8.0 (early access, b80), your code works. However, the Javadocs for the stage.resizableProperty() in JavaFX 8 additionally state
    >
    Warning: Since 8.0 the property cannot be bound and will throw RuntimeException on an attempt to do so. This is because the setting of resizable is asynchronous on some systems or generally might be set by the system / window manager.
    so while bindBidirectional(...) seems to work, bind(...) does indeed throw a RuntimeException.
    Given all that, I would not try to bind to the resizable property at all. If you only need unidirectional binding, Shakir's solution above will work. If you genuinely need bidirectional binding (for example, if the stage's resizable property might be changed elsewhere in the application, and you need the checkbox to update accordingly), you can "do it by hand":
        checkBoxResizable.selectedProperty().addListener(new ChangeListener<Boolean>() {
          @Override
          public void changed(ObservableValue<? extends Boolean> obs,
              Boolean oldValue, Boolean newValue) {
            if (stage.isResizable() != newValue.booleanValue()) {
              stage.setResizable(newValue);
        stage.resizableProperty().addListener(new ChangeListener<Boolean>() {
          @Override
          public void changed(ObservableValue<? extends Boolean> obs,
              Boolean oldValue, Boolean newValue) {
            if (checkBoxResizable.isSelected() != newValue.booleanValue()) {
              checkBoxResizable.setSelected(newValue);
        }); which seems to work in all versions (again, on my system).

Maybe you are looking for