ADF 11g + Select Boolean CheckBox becomes readonly

Hi All,
I have a view object, in which I added a transient attribute called as "InActive". And I added this VO as an ADF:Table on to the JSPX page.
1) My requirement is that if the other column called "EndDate" got any value ( any date value) then the "InActive" checkbox need to be autoselected.
And the users have the option of the de-selecting it.
2) The requirement is such a way that based on this "EndDate" column we are assuming that the current row/records is active or inactive in database.
So using this checkbox attribute, if the checkBox is selected for the row, then we are setting the "EndDate" column with "sysdate" and if they are unselecting any exisiting
checkbox, the same row will get updated with "EndDate" to null. Every thing is working fine for me with the code I have.
3) The road block I'm facing here is that I'm setting the attribute 'selected="#{row.EndDt != null ? true : false}" '. This is properly setting the checkbox "Inactive" values based on the "EndDate" column from the
database. But the entire check box column becomes read only, which does not allow me to edit.
4) If I set the value expression for the "Inactive" transient boolen attribute at the VO level, with the following as the value expression: 'EndDt != null ? true : false', if also sets the checkbox values properly, and moreover
the check box also editable, which is what we are expecting, but on submission of the page, the checkbox attribute is still pointing to the old/default value even though we change the value of the checkbox.
For example if the checkbox was got selected on load of the page, and if I unselects, and submits, it still shows that checkbox value as true.
So it would be greatly help ful to me if some one can provide me any hint on this.
Below is the code snippet I'm using for this in backing bean to process the logic.
int totalRows = this.t1.getRows();
ArrayList InactivatedrowIndexes = new ArrayList();
ArrayList ActivatedrowIndexes = new ArrayList();
for (int i = 0; i < totalRows; i++) {
JUCtrlHierNodeBinding rowData =
(JUCtrlHierNodeBinding)this.t1.getRowData(i);
Boolean check = (Boolean)rowData.getRow().getAttribute("Inactive"); // Inactive is the transient boolean attribute in VO - which has the value expression as EndDt != null ? true : false
if (check == true) {                         
InactivatedrowIndexes.add(i);
if (check == false) {                         
ActivatedrowIndexes.add(i);
System.out.println("******The row indexes to inactivate are: " +InactivatedrowIndexes);
System.out.println("******The row indexes to activate are: " +ActivatedrowIndexes);
Thanks & Regards,
Dharmathej M

Hi All,
I have a view object, in which I added a transient attribute called as "InActive". And I added this VO as an ADF:Table on to the JSPX page.
1) My requirement is that if the other column called "EndDate" got any value ( any date value) then the "InActive" checkbox need to be autoselected.
And the users have the option of the de-selecting it.
2) The requirement is such a way that based on this "EndDate" column we are assuming that the current row/records is active or inactive in database.
So using this checkbox attribute, if the checkBox is selected for the row, then we are setting the "EndDate" column with "sysdate" and if they are unselecting any exisiting
checkbox, the same row will get updated with "EndDate" to null. Every thing is working fine for me with the code I have.
3) The road block I'm facing here is that I'm setting the attribute 'selected="#{row.EndDt != null ? true : false}" '. This is properly setting the checkbox "Inactive" values based on the "EndDate" column from the
database. But the entire check box column becomes read only, which does not allow me to edit.
4) If I set the value expression for the "Inactive" transient boolen attribute at the VO level, with the following as the value expression: 'EndDt != null ? true : false', if also sets the checkbox values properly, and moreover
the check box also editable, which is what we are expecting, but on submission of the page, the checkbox attribute is still pointing to the old/default value even though we change the value of the checkbox.
For example if the checkbox was got selected on load of the page, and if I unselects, and submits, it still shows that checkbox value as true.
So it would be greatly help ful to me if some one can provide me any hint on this.
Below is the code snippet I'm using for this in backing bean to process the logic.
int totalRows = this.t1.getRows();
ArrayList InactivatedrowIndexes = new ArrayList();
ArrayList ActivatedrowIndexes = new ArrayList();
for (int i = 0; i < totalRows; i++) {
JUCtrlHierNodeBinding rowData =
(JUCtrlHierNodeBinding)this.t1.getRowData(i);
Boolean check = (Boolean)rowData.getRow().getAttribute("Inactive"); // Inactive is the transient boolean attribute in VO - which has the value expression as EndDt != null ? true : false
if (check == true) {                         
InactivatedrowIndexes.add(i);
if (check == false) {                         
ActivatedrowIndexes.add(i);
System.out.println("******The row indexes to inactivate are: " +InactivatedrowIndexes);
System.out.println("******The row indexes to activate are: " +ActivatedrowIndexes);
Thanks & Regards,
Dharmathej M

Similar Messages

  • To display a VARCHAR field in database as select boolean checkbox

    Hi,
    i have a table in database having a VARCHAR2(1) field named IsActive with value 'Y' or 'N' , I need to display this field as select boolean check box in the JSF page
    using ADF Entity Object and ViewObject. We have followed the following method for displaying this field as select boolean check box.
    1. Changed the datatype of the IsActive field in the Entity Object as Boolean and the database column type as Varchar2(10)
    2. we have edited the query using case when IsActive='Y' then 1 else 0 end .
    3.and converted the IsActive inputtext to select boolean checkbox.
    Thus we where able to display this field as select boolean check box but the problem is that we where not able to insert the data as 'Y' or 'N' using this method.
    Please help us whether the method we are following is correct or is there any other method to insert and display the similar fields like IsActive as select boolean check box in ADF
    Thanks in Advance
    Anitha

    Anitha,
    Create a transient boolean attribute on your EO. Write the getter to return true/false if the real attribute is Y/N. Write the setter to do the converse. Bind the transient attribute to the checkbox.
    John

  • ADF 11g - Selecting a certain row for a Form

    First of all hello and my apologies if this issues has been discussed here before (tried searching for it for a while. maybe I don't understand the problem right?).
    Let me describe my context a bit : i got 2 tables, table2 contains an attribute(Index_Code) that is a Foreign Key for the attribute Index in Table1.
    I got an ADF:Table in a JSP page with Table2View source(read-only) and I would like to be able to select a row in the table and then move to another JSP page where I i have an ADF:Form (Table2View+Table1View). The problem for me is that the row for Table2View in the 2nd JSP page is not selecting correctly (it always selects the 1st entry and not the entry with the Index_Code that i want). I want to add that in the Data Controls tab if I expand Table1View , i have the appropiate Table2View inside of it. But if i expand the Table2View node I don't have Table1View inside of it.
    I'm pretty sure this is a very simple procedure, and I've been trying to google for a solution for 2 days now and I'm beggining to think it is such a simple solution that no one even bothers explaining it :). So i've posted this thread as my last resort.

    Hi Marius,
    It is not exactly clear for me what do you want but from your description I guess you have two View Objects : Table1View and Table2View and one View Link defining Table1View as master and Table2View as detail.
    So in DataControl palette it is logical that only Table1View node is expandable with Table2View inside. Now if you put Table1View to jspx page as master af:table and Table2View as a detail table the detail table will reflect to change of the row in master table. If you put Table2View as a af:table alone also to second jspx page the framework will remember which row you selected on the first page when you navigate to second one.
    regards,
    Branislav

  • Urgent... Refresh issue in ADF 11g Select One Choice..

    Hi,
    There are some some list boxes in our pages (like Group, Users, Roles....)
    When we select users from the Users list box we can see the same name again appending to the list of values.
    Does any one has faces this issue before?
    Please help me on this..
    Thanks

    Hi,
    I don't understand your question. Also, are you using BC4J and Databindings or are you managed bean based?
    Regards,
    ~ Simon

  • ADF 11g- Selecting Maximum value of a field on Commit Button

    Hi
    I am trying to assign a value to a field on form by selecting max(id)+1 from database table on commit button.
    It assign the value to field but try to commit before assigning value.
    code is like this:-
    public String commandButton2_action() {                  ////////////////a commit button.
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("Commit");
    commandButton3_action();////////////Retrieve the maximum value from database.
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    return null;
    please do guide. what to do.
    Regards
    M Niaz

    Thanks,
    I know, that's why i am try to put this on save button instead on any other.
    But this is not an issue whether to use sequence or max()+1. I can use sequence instead but even then i have to get the nextvalue on form before commit.
    and i have to put that on commit button.
    Commit but try to commit the form before getting anything from DB.
    M Niaz

  • Trapping the selected row in the table using boolean checkbox

    Hi,
    I am using Jdev 11.1.1.2.0 with ADF 11g.
    I have a screen that has a table with an additional column of 'Select boolean checkbox'. I have assigned a valuechangelistener method that helps me know which row has been selected. But the issue is it gets fired for all the rows in the table once I select/de-select a checkbox of 1 single row.
    How can I handle this? Yes I can iterate through the table rows and check the values of the checkbox. But that is not I want, I also want to trap the de-select event.
    What is the way to achieve this?

    Timo Hahn wrote:
    I don't see a bug in this behavior. This is because each row gets stamped when they render.
    The way to do this is to use an attribute (which can be transient) to hold the status of the check box. Exactly this does the link I gave.
    TimoHi,
    Why I am saying it as a bug is because it is not firing the event for the record where the event has occurred. instead the event is fired for each row which should definitely not what is expected. And because of this we have to add an additional variable.
    Now it becomes more complex if I have to handle de-selection as well, b'coz if the valuchangelistener is going to fire for all the records then I need to know which row was previously selected and now de-selected as now the de-selected record will also return a false.
    So any better solution, anyone?

  • ADF 11g can not select and copy data from cell of readonly table in IE

    hi,
    In ADF 11g, when render view object as readonly table with Single RowsSelection, using IE browser can not select and copy data from the cell, but it work in firefox.
    is it a bug?
    Edited by: kent2066 on 2009-5-18 上午8:46

    Hi Timo,
    Sorry forgot to mention versions.
    We are using 11.1.1.7 and IE 9.
    I tried in Google but could not get the solution.
    Kindly let me know solution for this.
    PavanKumar

  • ADF multiple row selection using checkbox

    One of the basic feature missing in ADF 11g is multiple row selection using checkbox (ADF supports multiple row selection by CTRL+CLICK) and business users doesn't like the idea of CTRL+CLICK especially when the volume of click is more. Our requirement is to show the records as selected, on click of checkbox. We implemented multiple row selection by giving a checkbox and on submission, iterate all the rows and filter only selected rows for further processing. The approach works fine,but it is very slow when the volume of data is more, say 10 thousand rows. For 4 thousand records, iterating everything takes more than 200 secs !
    Had the multiple row selection been the ADF standard way using CTRL+CLICK, and retrieving the selected rows using method theTable.getSelectedRowKeys() works much faster (completes in millisecs for 4 thousand records). Somehow ADF fetches the selected records much faster this way. Our requirement is on click of the checkbox, the ADF should select the records ( the same way it is doing CTRL+CLICK) and all such selected rows should be retrievable using the ADF method theTable.getSelectedRowKeys()
    Is there any way it can be done?
    Regards,
    Antony.

    Hi All,
    We have implemented the select and select all using check-box and it is working fine. Issue here is the performance is too slow
    Assume SelectValue is the VO coulmn for the checkbox to select the values. To filter out the selected rows, we use the following line
    Row[] pidRows = pidView.getFilteredRows("SelectValue", Boolean.TRUE);
    it is very taking more than 2 minutes if the total number of rows are *4 thousands* and only if 2 rows are selected.
    Whereas with the CTRL+CLICK standard approach, ADF has a built in API theTable.getSelectedRowKeys(); to get only the selected rows, and the built in API takes only few milliseconds to get the selected rows. Users are not agreeing to the CTRL+CLICK approach as it is not user friendly. Suggest if there is a way to make the select box to make it work the same way as CTRL+CLICK.
    code snippet to do the standard way :
    RowKeySet sk = theTable.getSelectedRowKeys();
    _logger.info("row count of select "+sk.getSize());;+
    Iterator selection =sk.iterator();
    EmpVORowImpl empRow = null;
    +while (selection.hasNext()) {+
    Object rowKey = selection.next();
    theTable.setRowKey(rowKey);
    rowdata = (JUCtrlHierNodeBinding)theTable.getRowData();
    empRow  = (EmpVORowImpl)rowdata.getRow();
    _logger.info("Emp # "+empRow.getEmpno() +" Emp Name : "+empRow.getEname() +" Is selected ? "+empRow.getisChecked());+
    +}+

  • How can only one Checkbox can be Selected in Table with Boolean CheckBoxes?

    I have an editable ADF table where one of the attributes is a Boolean Checkbox... and stores the value with Y or N.
    Is there any way where only one checkbox should be selected at the time of commit ?
    For example, in case its an Answers Table to a Single Choice Question of a Questionnaire application, while adding new answers to the table..., the user inserts 3 rows (answers)... then the boolean checkbox for only one of those 3 rows can be checked.
    Thanks
    DJ

    Thanks... I tried it by writing some code ... But it doesn't seem to work. Can you please have a look... and make the changes.
    public class checkBean {
    public void validateCheck(LaunchEvent launchEvent){
    BindingContext bctx1 = BindingContext.getCurrent();
    DCDataControl dc1 = bctx1.findDataControl("QuestionnaireAMDataControl");
    ApplicationModule service1 = (ApplicationModule)dc1.getDataProvider();
    ApplicationModule am1 = service1.findApplicationModule("QuestionnaireAM");
    ViewObject vo1 = am1.findViewObject("QuestionVO");
    String newValue = (String)vo1.getCurrentRow().getAttribute("QuestionTypeId");
    if(newValue.equals("10881")){
    System.out.println("Inside single");
    BindingContext bctx = BindingContext.getCurrent();
    DCDataControl dc = bctx.findDataControl("QuestionnaireAMDataControl");
    ApplicationModule service = (ApplicationModule)dc.getDataProvider();
    ApplicationModule am = service.findApplicationModule("QuestionnaireAM");
    ViewObject vo = am.findViewObject("QuestionResponseVO");
    int numRows;
    int j=0;
    numRows = vo.getRowCount();
    String rowValue = "a";
    int k = vo.getCurrentRowIndex();
    for (int i=0; i<numRows; i++){                   
    rowValue = (String)vo.getCurrentRow().getAttribute("CorrectResponseFlag");
    if(rowValue.equals("Y")){                           
    j++;
    if(j>1)
    System.out.println("same rows exist");
    FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, null, "Two correct respones!");
    FacesContext.getCurrentInstance().addMessage(null, msg);
    k++;
    vo.next();
    Thanks
    DJ

  • How to make row selection by checkbox in ADF table

    hello,
    using jdev11g TP4 , fusion web application
    when i drag my view object as ADF table into jsf page,
    i want to know how to make row selection by checkbox
    thanks
    greenApple
    Edited by: greenApple on Nov 10, 2008 11:33 AM

    Hi,
    the tree component has changed compared to 10.1.3. You no longer have a tableSelectmany component that renders as checkboxes. Instead you use the ctrl key and select the table rows
    Frank

  • Not able to get ADF select many checkbox working with binding lists

    Hi,
    I have 2binding lists: list A that holds the selected choices and list B for all the choices. When the user opens the page, a list of checkbox should be displayed all the choices from list B with the saved ones pre-checked from list A. When the user changes the selection, the binding list A should be updated.
    I tried to use ADF select many checkbox but could not get it working for this.
    There are 2 big issues:
    1, can get all the choices from binding list B displayed but not able to pre-check the ones from list A.
    2, when the selection changed, not able to updated list A with the new choices
    I find some sample but it is talking about saving the selected choices into the managed bean not into binding object and using valueChangeListener. How to implement this in ADF? Please help.
    Thanks,
    Helen

    Helen,
    I don't think you can do this with a select many checkbox. This component works on one list whereas you want to handle two. You may archive this if you use a managed bean and handle all the list manipulation in java.
    Your use case more looks like a select many shuffle (http://docs.oracle.com/cd/E18196_01/11.1.2.0.0/lovs.html).
    Timo

  • ADF 11g Row Selection in a Table with radio button

    Hi there,
    I need to select one row with a radio button and then take some action on those rows via command buttons.
    I need to use a Radio Button and not the table property rowSelection provided with the latest features of ADF 11g.
    In ADF 10g you can use tableSelectOne component that missing in 11g. How you can implement that with ADF 11g?
    Regards, Alex

    Well, ADF 11g doesn't have that capability, so you have to build it yourself. If don't want to build it yourself, you could use the Trinidad components instead of ADF 11g. If you don't want either of those options, then sorry :)
    John

  • I need to divide selected row into multiple rows when i navigate  ADF 11g

    Hi
    I'm using jdeveloper 11.1.1.2.0 with ADF 11g.
    I need to divide selected row into multiple rows when i navigate to other page . Scenario - in first page i'm displaying some records with columns like empno , empstatus , empworkdepts ,curdepts
    Here empworkdepts gives the numeric number like no of departments work shifts 3 or 4 or 5. when i select any particular employee and fire next button to navigate next page.I have to divide the selected employee with same information into multiple times based on the empworkdepts value.
    empno empstatus empworkdepts curdept
    001 eds 2 TS
    002 hr 1 FO
    003 eds 4 TS
    *004 eds 3 TS*
    now i selected employee 004 , when i navigate to next page.
    Empno EmpStatus EmpWorkDepts CurDept
    004 eds 3 TS
    004 eds 3 TS
    004 eds 3 TS
    i did with java code in bean .but not stable .
    any help............
    thanks advance.............
    Edited by: user9010551 on May 5, 2010 10:48 PM
    Edited by: user9010551 on May 10, 2010 11:31 PM

    user9086775 wrote:
    Hi Experts,
    I have a requirment where i need to fetch parts of a single row into multiple rows from a singlt Query, i am sure it is possible using Pivots but just cant figure out an approach. Any help on this is highly appriciapted.
    Requirment:
    This is a sample set record in a table
    Product     Sub Product          Name    Age
    New Car    Nissan                   Tom        49
    New Car    Nissan                   Jack         36
    Old Car      Audi                     Sam         24
    Old Car      Jaguar                  Pint          26
    Old Car      Audi                     Smith       41
    I need to be able to fetch the above data in the below fashion
    Product     Sub Product          Name    Age
    New Car
    Nissan
    Tom        49
    Jack        36
    Old Car     
    Audi            
    Sam        24
    Smith      41
    Jaguar                   Pint         26Please help with ideas as to how can i achive the above without using PLSQL.
    Thanks in advance!You should be doing this in the client on not in the DB. Use the reporting tool that you use to do this.
    For example if you are in SQL Plus you can use the BREAK command.

  • How to enable row selection conditionally  in ADF 11g Table

    Hi,
    i am using ADF 11g.
    My use cae is:
    we need to display a table component in which only those rows that have a particular value in one of its columns should be selectable, other rows should be viewable but not selectable.
    That is, to say only those rows should be displayed as selectable in which the user name column is having the value same as the logged in user, suppose. And all the other rows having user name other than logged in user should be viewable , but not selectable for the user.
    I know in ADF 10.1.3 it is possible to conditionally enabling selection of rows in af.table by using "selection"-facet. But with 11g there is no such table facet.
    Does anyone have some idea how to do it in 11g?
    Thanks

    Frank,
    thank for your suggestion.
    so i tried to use clientLister like this:
    selectMatCat = function(event) {
    var matCatTable = event.getSource();
    rwKeySet = event.getAddedSet();
    for (rowKey in rwKeySet) {
    firstRowKey = rowKey;
    break;
    var cellhandler = matCatTable.findComponent("matCatCode", firstRowKey);
    if (cellhandler != null) {
    alert (cellhandler.getValue());
    event.cancel();
    but the row in which cellhandler != null is still selected so that i can get its value on the sever side by using code like : "matCatTable.getSelectedRowData()".
    I also noticed that the selection event will not automatically notify the server so the event.cancel() seems like not make so much sense.
    Any suggestion?
    Thanks.
    Peng

  • How can I programmatically select row to edit in ADF - 11g

    Hello,
    I'm having a table with rowSelection="single" and editingMode="clickToEdit". Currently i'm facing two issues.
    First issue: the first click on a table row makes the row selected, on second click it becomes editable. If I click on another row it gets selected, but previously selected row remains editable. I would like to change this, so when I select another row, the previously selected one to become read-only again. By now, I didn't find any solution to set programmatically the 'editable' state of a row.
    The second issue might be a bug and is related to deleting an editable row. I select a row, click to edit it, and then delete it. The next row get's selected, but clicking on it to edit, has no effect unless I press the 'ESC' select another row before. Does anyone have a tip how to workaround it?
    Thank you very much!
    Eniko

    try adding this method in the table selectionListener.
    public void table1_selectionListener(SelectionEvent selectionEvent) {
        public String getCurrentRow() {
            BindingContainer bindings = getBindingsForDCB();
            RichTable table=table1; 
            DCIteratorBinding outListIter = getBindingsForDCB().findIteratorBinding("outlistOutIterator");
            RowKeySet rowSet = table.getSelectedRowKeys();
            Iterator rowKeySetIter = rowSet.iterator();
            while (rowKeySetIter.hasNext()) {
                    List l = (List) rowKeySetIter.next();
                    Key key = (Key)l.get(0);
                    outListIter.setCurrentRowWithKey(key.toStringFormat(true));   
                    Row r = outListIter.getCurrentRow();
            return null;
        }

Maybe you are looking for

  • BT Vision Box is rebooting

    About a month ago I got sent a new BT Vision Box and in the last few days it has started rebooting every 10 minutes or so Beginning to get a little annoying ..... Does anyone have any experience of the same ? thanks

  • New Mac Mini didn't come with Snow Leopard.

    Hi all. I went to the apple store today in Bethesda, MD and bought the $599 Mac Mini. On the site it says "Now Includes Snow Leopard" for the Minis, but this one I bought in the store doesn't have it and none of the DVDs it came with is an upgrade di

  • How to upload the CWIP asset balances at the time of cutover

    Hi all, I want to upload the CWIP assets balances and I tried the same in AS91, but in TAKEOVER VALUE tab all the fields are greyed out (Acq. Value). Then I clicked on TRANSACTION tab but the Asset value date is in greyed out. Kindly guide me on the

  • Quick Selection Tool doesn't work

    This has probably been addressed, but can't seem to find it.  It's driving me nuts. In Elements 6.0,  I have found the Quick Selection Tool quite useful.  However, I often find that it does not work; not creating an outlined selection. Have others fo

  • Web site not displaying correctly in IE7 or lower

    Hi.  I uploaded my site and thought everything was fine with it.  I'm running IE8 and it looks fine for me, but then I checked it on another computer that has IE7 and the formatting looks incorrect.  The main content area is way low - you have to scr