Enabled/Disabled color row Datagrid

Hi all,
I extend class Datagrid to draw rows depending a value.
package comp
     import flash.display.Sprite;
     import mx.controls.DataGrid;
     import mx.core.Application;
     public class DataGridEx extends DataGrid
          public var rowColorFunction:Function;
          public function DataGridEx()
               super();
          override protected function drawRowBackground(s:Sprite, rowIndex:int, y:Number, height:Number, color:uint, dataIndex:int):void
               if ( rowColorFunction != null && dataProvider != null ){
                    var item:Object;
                    if (dataIndex < dataProvider.length){
                         item = dataProvider[dataIndex];               
                    if (item){
                         color = rowColorFunction(item,rowIndex,dataIndex,color);
               super.drawRowBackground(s,rowIndex,y,height,color,dataIndex);
In MXML i wrote this. My purpose is user could chosse if the rows are coloured or not.
          private function colorRow():void{               
               if (colorRowByFile == false){
                    colorRowByFile = true;                    
               if (colorRowByFile == true){
                    colorRowByFile = false;
And finally the code of Datagrid and color:
public function calcRowColor(item:Object, rowIndex:int, dataIndex:int, color:uint):uint
                 if(item.numFile == 1)
                    return 0x49FFAD;
               if(item.numFile == 2)
                    return 0x33CCFF;
               if(item.numFile == 3)
                    return 0xFFCC66;
               if(item.numFile == 4)
                    return 0xFFFF99;
               if(item.numFile == 5)
                    return 0xFF6633;
               if(item.numFile == 6)
                    return 0xFFCCCC;
               if(item.numFile == 7)
                    return 0x996600;
               if(item.numFile == 8)
                    return 0xCCFF99;     
               else return 0xFFFFFF;            
<comp:DataGridEx id="dg_events" width="100%" height="100%"
dataProvider="{eventList.eventCollection}"
rowColorFunction="calcRowColor">
<comp:columns>
<mx:DataGridColumn headerText="Nombre de evento" width="150"
dataField="name"/>
<mx:DataGridColumn headerText="ID" width="40"
dataField="eventId"/>
<mx:DataGridColumn headerText="Propietario" width="120"
dataField="owner"/>
<mx:DataGridColumn headerText="Fecha" width="70"
dataField="date"/>
<mx:DataGridColumn headerText="Hora" width="55"
dataField="time"/>
<!-- <mx:DataGridColumn headerText="N. Parámetros" width="100"
dataField="numParams"/> -->
<mx:DataGridColumn headerText="Parámetros"
labelFunction="eventList.getParams"/>
<mx:DataGridColumn headerText="Archivo" width="40"
dataField="numFile"/>
</comp:columns>
</comp:DataGridEx>
The problem is:
Initially the option are enabled so the rows are correctly coloured depending the value of column numFile. When user clicks to disabled colors, datagrid appears correct (with no color) but if we click again to recoloured row the datagrid still the same state (with no colour).
I dont know the reason.
Thanks in advanced.
Lerogke
PD: sorry for my english

Does your override of drawRowBackground get called?  Maybe the DG doesn't think it is dirty.  There are APIs like invalidateList() that might help
Alex Harui
Flex SDK Developer
Adobe Systems Inc.
Blog: http://blogs.adobe.com/aharui

Similar Messages

  • How to enable /disable the row in ALV?

    Hi Experts,
    I have gone through some threads on this but I did not find useful to my requirement.
    My requirement is:
    Consider two columns : one is set delete column (a button) and another editable field.
    When the user presses on set delete button. The editable field should be disabled and it should be enabled whenever the user presses the button again.
    Kindly let me know the solution.
    Thanks.

    Hi,
    As i am also new to web dynpro abap. I found it a gud thing to learn about ALV grid.
    So, I tried doing it like that and found that its not at all difficult.
    Here is the procedure that i followed.
    1. Create a context node with two attribute from any table structure and one attribute of type wdy_boolean for controlling the
        enable property of input field.
    2. i used the supply function to fill the node. Here is the code for the same.
    data lt_dealer type wd_this->Elements_zdealer.             "My node name is zdealer
    DATA ls_dealer LIKE LINE OF lt_dealer.
    select * from zdealer into corresponding fields of table lt_dealer.
    loop at lt_dealer into ls_dealer.
      ls_dealer-enable = abap_true.                             "to enable all the fields initially
      modify lt_dealer from ls_dealer.
      endloop.
    node->bind_table( lt_dealer ).
    3. create view container UIelment in the view and embed table view of the ALV used comp.
    4.  add interface controller of SALV_WD_TABLE to the used controller in the view and also add comp controller of our
    local comp to the used controller list of interface contrl of Used comp. And then map the data node to the node we have filled in
    the supply function.
    5. go to the wddoinit method to configure the ALV grid. means adding button and input field and binding the enable property of
    input field. Here is the code for the same.
    data lo_cmp_usage type ref to if_wd_component_usage.
      lo_cmp_usage =   wd_this->wd_cpuse_alv( ).
      if lo_cmp_usage->has_active_component( ) is initial.
        lo_cmp_usage->create_component( ).
      endif.
      DATA lo_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .
      lo_INTERFACECONTROLLER =   wd_this->wd_cpifc_alv( ).
        DATA lo_value TYPE ref to cl_salv_wd_config_table.
        lo_value = lo_interfacecontroller->get_model(
    lo_value->IF_SALV_WD_TABLE_SETTINGS~SET_CELL_ACTION_EVENT_ENABLED( abap_true ).
    lo_value->IF_SALV_WD_TABLE_SETTINGS~SET_READ_ONLY( ABAP_FALSE ).
    data btn type ref to cl_salv_wd_uie_button.
    data inp type ref to cl_salv_wd_uie_input_field.
    data col1 type ref to cl_salv_wd_column.
    data col type ref to cl_salv_wd_column.
    data col2 type ref to cl_salv_wd_column.
    call method lo_value->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN
    exporting
      id = 'NAME'                         "col name is NAME (col with button)
      receiving
      value = col.
    call method lo_value->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN
    exporting
      id = 'LOCATION'                "col name is LOCATION (col with input field)
      receiving
      value = col1.
    call method lo_value->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN
    exporting
      id = 'ENABLE'                   "this col is used to control the enable property of input field and we will make it invisible.
      receiving
      value = col2.
    create object btn.
    CREATE OBJECT INP
    EXPORTING
      VALUE_FIELDNAME = 'LOCATION'.
    inp->set_enabled_fieldname( 'ENABLE' ).
    COL1->SET_CELL_EDITOR( INP ).
    btn->SET_TEXT_FIELDNAME( 'NAME' ).
    col->set_cell_editor( btn ).
    col2->set_visible( '01' ).                     " making the enable col invisible
    Now you need to create one eventhanlder for the action of cell action.
    for this create an eventhandler and then even col there select ON_CELL_ACTION for the inerface cntrl of ALV.
    now write the code in this eventhandler for enabling or disabling the input field after checking the current value and
    row number from which the button was clicked. code for the same.
    DATA lo_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .
      lo_INTERFACECONTROLLER =   wd_this->wd_cpifc_alv( ).
        DATA lo_value TYPE ref to cl_salv_wd_config_table.
        lo_value = lo_interfacecontroller->get_model(
    data inp type ref to cl_salv_wd_uie_input_field.
    data col1 type ref to cl_salv_wd_column.
    data str type string.
    str = R_PARAM->COLUMN.
    data indx type i.
      indx = r_param->index.               " this will get the row number
      DATA lo_nd_zdealer TYPE REF TO if_wd_context_node.
      DATA lo_el_zdealer TYPE REF TO if_wd_context_element.
      DATA ls_zdealer TYPE wd_this->element_zdealer.
      DATA lv_value LIKE ls_zdealer-enable.
    * navigate from <CONTEXT> to <ZDEALER> via lead selection
      lo_nd_zdealer = wd_context->get_child_node( name = wd_this->wdctx_zdealer ).    
    lo_el_zdealer = lo_nd_zdealer->get_element( index = indx ).     " get the corresponding element.
    lo_el_zdealer->get_attribute(
        EXPORTING
          name =  `ENABLE`
      importing
          value = lv_value ).
    IF str EQ 'NAME'.
      if lv_value eq abap_true.
    lo_el_zdealer->set_attribute(
        EXPORTING
          name =  `ENABLE`
          value = abap_false ).
    else.
      lo_el_zdealer->set_attribute(
        EXPORTING
          name =  `ENABLE`
          value = abap_true ).
      endif.
    ENDIF.
    this will solve it.
    Thanks and Regards,
    Sarbjeet singh

  • Is it possible to enable/disable table row selection?

    I have a situation where a user can add rows to a "selection" table with a value that is used to perform a query to get a collection of objects associated with that value. Once those objects are available, a second "results" table will be populated with the row(s) returned. When the value is entered in the selection table, a web service call is made to perform the query and return the results. This may take a few moments and I am displaying an indeterminate progress indicator for the selection table row involved to indicate that the data is not yet available - the progress indicator is included as a column in the row; each row has its own indicator. Once the results are received the indicator is hidden to indicate the query for that row has completed. The user may enter as many rows in the selection table as they wish so there is a distinct possibility of multiple queries being executed at a given time. I have also attached a row selection listener to the selection table such that when a given row is selected, the results table will display the corresponding associated row(s).
    What I'd like to be able to do is somehow temporarily disable the selection of any row that has a query in progress, while leaving other rows whose queries have completed be selectable. Once the query completes, the row can then become selectable, thus allowing for the results to be loaded and displayed in the results table. The way it works right now, if the row is selected while the query is still in progress, nothing is displayed (obviously), but then the row has to be re-selected after the query has completed to see the results. This is a viable (though undesirable) solution/workaround if there is at least one other row in the table. However, if the row is the only row in the table and has been selected, it cannot be re-selected (there's no other row to select to allow for re-selection). To boil it down, what I'd like to do is prevent the selection of the row until the query for that row is complete.
    After perusing the JavaFX 2.2 API, I'm not seeing any obvious way to achieve this effect. If anyone has any solutions, suggestions, etc. on how this could be done I'd appreciate it greatly.

    Here's an [url https://github.com/james-d/Conditionally-selectable-table]example. As predicted, keyboard navigation fails if the keyboard presses would result in an unselectable item being selected using the default selection model. The best workaround I can see for this is to register event filters for the appropriate keyboard strokes, as in the previously referenced thread.
    Update: That code won't run in the current (ea b90) release of JavaFX 8.0, and probably a few recent releases; it will however run in the final release (and it runs in JDK 7). See [url https://javafx-jira.kenai.com/browse/RT-30593]RT-30593
    Edited by: James_D on May 22, 2013 7:51 PM

  • ALV Web Dynpro for ABAP enable/disable single row

    hi all,
    is it possible to change the layout of one single row or cell in a alv (component SALV_WD_TABLE) web dynpro for abap?
    i managed to get columns to be editable using the tutorial "Editing ALV in Web Dynpro for ABAP".
    but it is not described how to change a single row or cell in this tutorial. also the example programs i found do not get into this subject.
    did i miss something?
    thanks in advance

    Hi,
    I think you cannot set the focus to the particular cell.
    I think you can  loop at that row of that table and set the the cell design to apply some color to differentiate that way rather than focusing so that user can know that he has to do something in that cell.
    check out this example salv_wd_test_table_focus
    Regards,
    Lekha.

  • Table Control - Input Enabling/Diabling of Rows based on Condition.

    Hi,
    In the TC, I want to Input Enable/Disable the rows based on Conditions. The First row is input enabled always. But the other rows, (2nd onwards) need to be Input Enabled/Disabled based on some conditions. It is possible to make this working. Can you please provide me a suitable solution for this?
    Appreciate Your Help.
    Thanks,
    Kannan

    Hi Kannan...
    If we are talking about "Rows"...
    then identify based on some conditions the row numbers and in PBO...loop at screen with screen name..set thier input properties and modify screen (make them input only)
    If we are taking into consideration "columns"
    There is an internal structure COLS where we can identify column number of screen name ...or we can take except for one particular column..
    if some condition satisfied....
    loop at screen where screen-name <> "Column which is input'.
    Loop at screen...and make other columns display only.
    modify screen
    endif.
    Regards
    Byju

  • Cmfctoolbarcomboboxbutton, how to enable/disable

    Hi,
    I inserted a CMFCToolBarComboBoxButton object in my toolbar. all work fine except enabling and disabling ComboBox according state of my App.
    I used EnableWindow but the control still actived.
    Any idea?
    Tanks.
    My creation code :
    if (wParam == IDR_MAINFRAME24) {
    m_ComboButton = new CMFCToolBarComboBoxButton(ID_MONTH_FILTER, GetCmdMgr()->GetCmdImage(ID_MONTH, FALSE),
    CBS_DROPDOWNLIST);
    CString strMonths, strMonth;
    int i, curPos = 0;
    if (strMonths.LoadStringW(IDS_MONTHS)) {
    i = 1;
    //m_ComboButton->AddItem(_T(""), 0);
    strMonth = strMonths.Tokenize(_T(";"), curPos);
    while (strMonth != _T("")) {
    m_ComboButton->AddItem(strMonth, i);
    strMonth = strMonths.Tokenize(_T(";"), curPos);
    i++;
    m_wndToolBar.ReplaceButton(ID_MONTH, *m_ComboButton);
    CMFCToolBarComboBoxButton * pMonthCombo = CMFCToolBarComboBoxButton::GetByCmd(ID_MONTH_FILTER, FALSE);
    if (pMonthCombo) {
    pMonthCombo->SetCenterVert(false);
    pMonthCombo->SetText(_T("Advanced filter"));
    pMonthCombo->EnableWindow(FALSE);

    Tank you for your help.
    you are right, but a update cammand ui message is not send by CMFCToolBarComboBoxButton object.
    I make a test on my side and mesajflaviu's suggestion really helpful. Using ON_UPDATE_COMMAND_UI macro, I can disable the CMFCToolBarComboBoxButton in the CMFCToolBar. See my test code snippet:
    BOOL m_enable; //use to detect if enable the combo box
    afx_msg void OnUpdateCombo(CCmdUI *pCmdUI);
    ON_UPDATE_COMMAND_UI(IDR_COM, &CMainFrame::OnUpdateCombo)
    void CMainFrame::OnUpdateCombo(CCmdUI *pCmdUI)
    pCmdUI->Enable(m_enable);
    void CMainFrame::OnEditDisable()
    // TODO: Add your command handler code here
    m_enable = FALSE;// use a menuitem to disable the combo box
    ///////create the CMFCToolBarComboBoxButton//////////
    LRESULT CMainFrame::OnToolbarReset(WPARAM wp, LPARAM lp)
    UINT uiToolBarId = (UINT)wp;
    TRACE("CMainFrame::OnToolbarReset : %i\n", uiToolBarId);
    switch (uiToolBarId)
    case IDR_TOOLBAR1:
    m_ComboButton = new CMFCToolBarComboBoxButton(IDR_COM, GetCmdMgr()->GetCmdImage(IDR_COM, FALSE), CBS_DROPDOWNLIST);
    m_ComboButton->EnableWindow(true);
    m_ComboButton->SetCenterVert();
    m_ComboButton->SetDropDownHeight(25);
    m_ComboButton->SetFlatMode();
    m_ComboButton->AddItem(_T("OPTION1"));
    m_ComboButton->AddItem(_T("OPTION2"));
    m_ComboButton->SelectItem(0);
    m_wndToolBar.ReplaceButton(IDR_COM, *m_ComboButton);
    break;
    return 0;
    Check the result screenshot:
    Enable:
    Disable: Color is turning yellow and cannot click
    Best regards,
    Shu
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Enable disable linkbar links in datagrid itemrenderer.

    Hi All,
    I have to show the linkbar in datagrid column as a renderer and enable and disable the links according to attached documents codes.
    here are my sample code
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init();">
    <mx:Script>
        <![CDATA[
            import mx.collections.ArrayCollection;
            [Bindable]
              public var arrColl:ArrayCollection = new ArrayCollection();
              public function init():void{
                  arrColl.addItem(["1,2,3","1,2"]);
                  arrColl.addItem(["1,2,3", "1,3"]);
                  arrColl.addItem(["1,2,3","1,2"]);
                  arrColl.addItem(["1,2,3", "1,3"]);
                  arrColl.addItem(["1,2,3","1,2"]);
                  arrColl.addItem(["1,2,3", "1,3"]);
                  arrColl.addItem(["1,2,3","1,2"]);
                  arrColl.addItem(["1,2,3", "1,3"]);
                  arrColl.addItem(["1,2,3","1,2"]);
                  arrColl.addItem(["1,2,3", "1,3"]);
                  arrColl.addItem(["1,2,3","1,2"]);
                  arrColl.addItem(["1,2,3", "1,3"]);
                  arrColl.addItem(["1,2,3","1,2"]);
                  arrColl.addItem(["1,2,3", "1,3"]);
                  arrColl.addItem(["1,2,3","1,2"]);
                  arrColl.addItem(["1,2,3", "1,3"]);
                  arrColl.addItem(["1,2,3","1,2"]);
                  arrColl.addItem(["1,2,3", "1,3"]);
                  arrColl.addItem(["1,2,3","1,2"]);
                  arrColl.addItem(["1,2,3", "1,3"]);
                  arrColl.addItem(["1,2,3","1,2"]);
                  arrColl.addItem(["1,2,3", "1,3"]);
                  arrColl.addItem(["1,2,3","1,2"]);
                  arrColl.addItem(["1,2,3", "1,3"]);
                  arrColl.addItem(["1,2,3","1,2"]);
                  arrColl.addItem(["1,2,3", "1,3"]);
                  arrColl.addItem(["1,2,3","1,2"]);
                  arrColl.addItem(["1,2,3", "1,3"]);
                  arrColl.addItem(["1,2,3","1,2"]);
                  arrColl.addItem(["1,2,3", "1,3"]);
                  arrColl.addItem(["1,2,3","1,2"]);
                  arrColl.addItem(["1,2,3", "1,3"]);
                  arrColl.addItem(["1,2,3","1,2"]);
                  arrColl.addItem(["1,2,3", "1,3"]);
                  arrColl.addItem(["1,2,3","1,2"]);
                  arrColl.addItem(["1,2,3", "1,3"]);
                  arrColl.addItem(["1,2,3","1,2"]);
                  arrColl.addItem(["1,2,3", "1,3"]);
                  arrColl.addItem(["1,2,3","1,2"]);
                  arrColl.addItem(["1,2,3", "1,3"]);
                  arrColl.addItem(["1,2,3","1,2"]);
                  arrColl.addItem(["1,2,3", "1,3"]);
                  arrColl.addItem(["1,2,3","1,2"]);
                  arrColl.addItem(["1,2,3", "1,3"]);
                  arrColl.addItem(["1,2,3","1,2"]);
                  arrColl.addItem(["1,2,3", "1,3"]);
        ]]>
    </mx:Script>
        <mx:DataGrid id="dg" dataProvider="{arrColl}" width="200" height="500" x="510" y="168" >
            <mx:columns>
                <mx:DataGridColumn  itemRenderer="assets.components.linkbarItemRenderer"  />   
            </mx:columns>
        </mx:DataGrid>
    </mx:Application>
    My item renderer linkbarItemRenderer.mxml as
    <?xml version="1.0" encoding="utf-8"?>
    <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" creationComplete="init();" >
    <mx:Script>
        <![CDATA[
            import mx.controls.LinkButton;
            import mx.collections.ArrayCollection;
            import mx.controls.Alert;
            [Bindable] public var arrColl : ArrayCollection = new ArrayCollection();
            public var arrDocType : ArrayCollection = new ArrayCollection([{data:"1" , label:"AP"},{data:"2" , label:"AR"},{data:"3" , label:"BOL"}]);
            public var attDoccodes : Array;
            public function init():void
                try
                    var requiredDoc :String = data[0];
                    var attachDoc : String = data[1];
                    var reqDocCodes :Array =  requiredDoc.split(",");
                    attDoccodes = attachDoc.split(",");
                    if(reqDocCodes != null)
                        //add the links of required documents.
                        for(var i:int = 0 ; i<reqDocCodes.length; i++ )
                            var obj:Object = new Object();
                            for(var j : int = 0; j < arrDocType.length; j++)
                                if(arrDocType.getItemAt(j).data == reqDocCodes[i])
                                    obj.label = arrDocType.getItemAt(j).label;
                                    obj.data  = reqDocCodes[i];
                            arrColl.addItem(obj);
                    callLater(enableDisalbeLinks);
                catch(error:Error)
                    Alert.show("error ::"+error.getStackTrace());
            public function enableDisalbeLinks():void
                try
                    //disable all links first
                    for(var q:int=0; q< arrColl.length; q++)
                        LinkButton(linkBarId.getChildAt(q)).enabled = false;   
                    if(attDoccodes != null)
                        for(var k:int = 0; k<attDoccodes.length; k++)
                            for(var l:int = 0 ; l<arrColl.length; l++)
                                if(arrColl.getItemAt(l).data == attDoccodes[k])
                                    LinkButton(linkBarId.getChildAt(l)).enabled = true;   
                catch(error:Error)
                    Alert.show("error ::"+error.getStackTrace());
        ]]>
    </mx:Script>
            <mx:LinkBar id="linkBarId" dataProvider="{arrColl}" />   
    </mx:HBox>
    It renderes the link in correct form in datagrid first time.when i scroll the datagrid the rows are miss up with each other and links are not shown propers in enable/disable format.
    Thanks,
    Amol.

    Hi All,
    It was my fault. Got it work now.
    When I redirect to PR, it also calls my page initialization method and clear all data. I added a parameter and issue resolved.
    Thanks & Regards,
    KJ

  • Disable few rows in datagrid.

    Hi,
         I want to disable some rows(no rollover color, no selection) in datagrid. For example if have 10 rows i may need to disable 3 or 4 based on some flag.
    Any idea?

    Hi Moorthi,
    Found Alex Harui’s excellent entry on 'Disabling List Selection' - http://blogs.adobe.com/aharui/2007/06/disabling_list_selection.html.
    Same concept could be applied for datagrid selection.
    Thanks and Regards,
    Pooja Kuber | [email protected] |http://www.infocepts.com

  • Enable/disable lov button in a multi-row bloc

    Hi all,
    I have a form in which there is a multi-row block with some lov buttons related to some items,
    in query mode, user should not be able to modify item, item property update_allowed is set to false, that worked, but user is able to modify item when he clicks on the lov button...so i want to disable the button for query records and for record in (insert or new), button should be enable,
    i tried some tips but don't work, do you have any idea
    Thanks for your help.

    Hi,
    Can you suggest some methods to enable/disable LOVs in my search query? I have a customized VC which performs search and I need to enable/disable the LOVs depending on requirement.
    Abhishek

  • Enable/disable operation buttons according to the selected row in table?

    Hi,
    I used JDev 11.1.1.2.0
    On my main page, it has a query section and display search result to a table component, and also has some operation buttons like (update/delete) on the toolbar.
    I want to enable/disable the operation buttons according to some filed value of the selected row in the table, and I searched the OTN forum, found more questions like this but seemed no found one right solution.
    The table is single selection, and has a status column, its data type is Integer, and I want to enable buttons when the selected row's status field value is 0 or 1, disable buttons when status value is other values.
    Table code like:
    <af:table value="#{bindings.VO1.collectionModel}" var="row"
    rows="#{bindings.VO1.rangeSize}"
    emptyText="#{bindingsVO1.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.VO1.rangeSize}"
    rowBandingInterval="0"
    filterModel="#{bindings.VOCriteriaQuery.queryDescriptor}"
    queryListener="#{bindings.VOCriteriaQuery.processQuery}"
    filterVisible="true" varStatus="vs"
    selectedRowKeys="#{bindings.VO1.collectionModel.selectedRow}"
    selectionListener="#{bindings.VO1.collectionModel.makeCurrent}"
    rowSelection="single" id="resId1">
    Operation buttons code like:
    <af:commandToolbarButton text="Update" id="ctb2" action="editDAF"/>
    Any suggestion will be great help.
    Thanks,
    zeroxin

    Hi,
    create an attribute binding in the PageDef file for the status field. Then setup the button PartialTriggers property to point to the table ID. The button's disabled property then points to the status attribute binding like
    #{bindings.statusField.inputValue=='value'}
    Frank

  • Table Control Enable / Disable Row

    Hi,
    I have a table control with 6 columns also screen contains some header input fields.
    Out of 6 columns first two columns are disabled.
    Depending on value entered in certain field in the header I fill the table control. e.g. if the value in certain field is X, table control is filled with say 15 rows, if value is Y, table control is filled with say 5 rows.
    Now my requirement is only those rows which are filled should be disabled. i.e. If user chooses value Y then all rows after 5 should be input enabled.
    But since I have disabled the columns statically complete column remains disabled.
    Can anybody tell me How to enable a particular row in table control ?
    Thanks n Regards,
    Nitin
    Message was edited by: Nitin Pawar

    Say your Table control in TABCON.
    You screen structure is SC_ITAB.
    Your internal table is ITAB.
    In PBO of screen
       LOOP AT ITAB INTO SC_ITAB WITH CONTROL TABCON.
        module SUPPRESS_ROW.
      ENDLOOP.
    In ABAP Module
    MODULE SUPPRESS_ROW.
    IF SC_TAB IS INITIAL.
    LOOP AT SCREEN.
      SCREEN-INPUT = 0.
      MODIFY SCREEN.
      ENDLOOP.
    else.
      LOOP AT SCREEN.
       SCREEN-INPUT = 1.
       MODIFY SCREEN.
      ENDLOOP.
    endif.
    This will help you suppress at row level.
    You may change the if condition to suit your need .
    Cheers
    ENDMODULE.

  • Is there a way to enable/disable a tabular form item based on the value of a second item?

    Hi Everyone,
    I have a tabular form based on a collection.   The column c050(maps to f30) will be either Y/N.  If it is Y, then I would like to enable column c024( maps to f24) (which happens to be a radio button based on lov).  If the value of c050 = N, then disable c024.   There are potentially many rows, and the item c024 would only be enable/disabled for the specific row.   So if row 1 has c050=Y and row 2 has C050=N then row 1 c024 is enabled, and row 2 c024 is disabled.  Hope that makes sense.
    I have created a dynamic action called enable/disable HMS fields.
    event=CHANGE
    selection type = jquery selector
    jquery selector = input[name='f30']
    condition EQUAL TO
    value Y
    true action1 - enable, jquery selector, input[name='f24']
    true action 2 - alert, You have added an HMS Species.   There may be additional data to enter.  thanks
    false action1 - disable jquery selector, input[name='f24']
    false action2 - alert, no hms worries.
    The alerts in both cases show properly...but nothing seems to happen to f24.....what am I doing wrong?
    thanks

    Agh! This is the first time you mention this is a radio button!  That changes things a lot! As you can see, the format is different (f24_0001_0001) than what we have discussed (f24_0001).
    Radio buttons have their own quirks.  My bad, I should have asked what you had.  But since you said your original selectors on input were working I just thought these were text fields or something like that.
    How about you change it to a drop down list just so that you can see all work?  And fully understand it.
    Then you can work out the radio button option.
    If that doesn't get you there... I'm going to ask you setup an example in apex.oracle.com and give me credentials to log in and take a look.
    I could re-try the js on my side with a radio but it will take some time.
    So just to be clear... f30 is a drop down and f24 is a radio?
    See, this line:
    $x_disableItem("f24_" + row, true);
    Is NEVER going to find the radio buttons because it's missing the 3rd 0001 and 0002 (how many options do you have?)
    So perhaps you try it like this:
    $x_disableItem("f24_" + row + '_0001', true);
    $x_disableItem("f24_" + row + '_0002', true);
    ... keep going for the options...
    Do the same for the false of course.
    But I think this needs a better approach if you'll have radio buttons.  I just need to work it out.
    Ok, go try things...
    Thanks
    -Jorge

  • Button enable/disable in Master-Detail table

    I am using JDeveloper 11.1.1.3.0 and I have a page fragment (.jsff) which includes a Master-Detail table and the Master table has 3 buttons that get enabled/disabled based on the specific string within a column say, if the column has value, 'DRAFT', the buttons should be enabled. In all other cases, the buttons should be disabled.
    The above mentioned scenario works in cases where the table has more than one row in the table; but in two cases the buttons don't get enabled even though the column has 'DRAFT' as its value:
         1. when the table first loads with the data populated in the table; clicking on the first row doesn't trigger the buttons, clicking on any other row triggers the buttons
         2. when there is only one row in the table
    To resolve this, I tried looking at the logs for any specific information regarding the buttons getting enabled or disabled. I couldn't find info on setting up a breakpoint for the commandbutton and the disabled property which would enable me to determine whether it is being triggered as soon as the table gets populated or not.
    How can I get the buttons to work per my requirements? Also, can I set breakpoints for the button and/or evaluate disabled property's EL expression?
    Thanks in advance.

    Navaneeth:
    The buttons are part of panelCollection which exists in panelHeader. As the below code demonstrates,
    1. Buttons are defined in the toolbar (t2) in panelCollection (pc1)
    2. Each buttons' partialTrigger is set to the table (md1)
    3. Tables' (md1) partialTrigger is set to the toolbar (t2).
    <af:panelHeader text="#{viewcontrollerBundle.HISTORIC_PANEL_SPECS__TESTER_S}" id="ph2">
            <af:panelCollection id="pc1" styleClass="AFStretchWidth">
              <f:facet name="menus"/>
              <f:facet name="toolbar">
                <af:toolbar id="t2" partialTriggers="t2">
                  <af:commandButton actionListener="#{bindings.promotePanelSpec.execute}"
                                    text="#{viewcontrollerBundle.PROMOTE_PANEL_SPEC}"
                                    id="cb1" icon="/Images/up16.png"
                                    partialTriggers="md1"
                                    disabled='#{bindings.Status!="DRAFT"}'
                                    immediate="true"/>
                  <af:commandButton text="#{viewcontrollerBundle.ADD_TESTER_SPEC}" id="cb2"
                                    partialTriggers="md1"
                                    icon="/Images/action_add.gif"
                                    actionListener="#{bindings.CreateWithParams.execute}"
                                    action="addTestSpec"
                                    disabled='#{bindings.Status!="DRAFT"}'/>
                  <af:commandButton actionListener="#{PanelSpecTesterSpec.deleteTesterSpec}"
                                    text="#{viewcontrollerBundle.REMOVE_TESTER_SPEC}"
                                    id="cb3" partialTriggers="md1 ::pc2:t1"
                                    icon="/Images/delete.png"
                                    disabled='#{bindings.Status!="DRAFT"}'/>
                </af:toolbar>
              </f:facet>
              <f:facet name="statusbar"/>
              <af:table id="md1"
                        rows="#{bindings.PanelSpecTesterSpecView1.rangeSize}"
                        fetchSize="#{bindings.PanelSpecTesterSpecView1.rangeSize}"
                        emptyText="#{bindings.PanelSpecTesterSpecView1.viewable ? 'No data to display.' : 'Access Denied.'}"
                        var="row"
                        value="#{bindings.PanelSpecTesterSpecView1.collectionModel}"
                        rowBandingInterval="0"
                        selectedRowKeys="#{bindings.PanelSpecTesterSpecView1.collectionModel.selectedRow}"
                        selectionListener="#{bindings.PanelSpecTesterSpecView1.collectionModel.makeCurrent}"
                        rowSelection="single" partialTriggers="::t2"
                        filterVisible="true" displayRow="selected"
                        filterModel="#{bindings.ProductIdPanelSpecVersionToolNameQuery.queryDescriptor}"
                        queryListener="#{bindings.ProductIdPanelSpecVersionToolNameQuery.processQuery}">
                <af:column headerText="#{bindings.PanelSpecTesterSpecView1.hints.ProductId.label}"
                           sortProperty="ProductId" sortable="true" id="c39"
                           filterable="true">
                  <af:outputText value="#{row.ProductId}" id="ot28"/>
                </af:column>
                <af:column headerText="#{bindings.PanelSpecTesterSpecView1.hints.Status.label}"
                           sortProperty="Status" sortable="true" id="c43"
                           filterable="true">
                  <af:outputText value="#{row.Status}" id="ot40"/>
                </af:column>
              </af:table>
         </af:panelCollection>
    </af:panelHeader>The fact that the above code works when there are multiple rows tells me that buttons are having trouble reading the first row of the table.
    Also, I changed the displayRow property for the table from "selected" to "first" but no luck either.

  • Cl_wd_table - enable/disable certain cells

    Hello together,
    I'm looking for a good solution to enable/disable certain cells in a table.
    For example I have the following table (the real table is more complex - with buttons and so on...):
    User
    ToDo
    State
    A
    Todo1
    Done
    B
    Todo2
    In Process
    A
    Todo3
    In Process
    B
    Todo4
    Done
    I have different users which are working on this tabe:
    - Administrator: Can edit whole table (except State column)
    - Employee: Can only edit State Column where he is assigned
    I think it would be difficult to work with context attributs in this case?
    Is it possible to Loop over all table lines an set "enabled" Attribut in the coding?
    Best Regards

    Hi Uwe,
    Check this below links
    How to edit conditionally row of a ALV table in Web Dynpro for ABAP
    ABAP WebDynpro: Can edit a cell in a column?
    Thanks
    KH

  • How to enable /disable a command Button based on a table's selectOne choice

    Hi everyone.
    I am using JDeveloper 10.1.3.3 and wish to enable / disable a commandButton based on the user's selection of the selectOne radio button.
    The idea is that a row of a table may have an associated document so I want to enable or disable the button that downloads it based n the current row selected.
    I have followed the advice on problem with table I defined my selectOne component as follows :
    <af:tableSelectOne text="#{res['tables.selectionFacet.title']}"
        autoSubmit="true"
        attributeChangeListener="#{backing_browseCVs.onSelectionChange}">The function inside the backing bean looks like this
        public void onSelectionChange(AttributeChangeEvent attributeChangeEvent)
            // access the faces context
            FacesContext fc = FacesContext.getCurrentInstance();
            // get value of the expression #{row.hasCVDocument} that indicates
            // if a document has been added
            ValueBinding vb =
                fc.getApplication().createValueBinding("#{row.hasCVDocument}");
            Boolean hasDoc = (Boolean)vb.getValue(fc);
            // enable the doownload button accordingly
            downloadCVDocBtn.setDisabled(!hasDoc);
        }My problem is that the method never fires. I have placed a breakpoint at the first line but it is never reached.
    Any advice will be most welcome.
    Thanassis

    Hi,
    You might need to add 'dataProvider' part in the expression language in your selectionListener:
    #{bindings.CVList.currentRow.[b]dataProvider.hasCVDocument}
    #{bindings.CVList.currentRow} returns an instance of ViewRowImpl which does not have 'getHasCVDocument()' method, but does have:
    Object getCurrentRow()
    method, which returns objects from your CVList list, which do have getHasCVDocument() method...
    Expression language is resolved through reflection, so when you write:
    #{processScope.someClass.someReferencedClass.someAttribute} it is something like:
    Get someClass from processScope map, then:
    someClass.getSomeReferencedClass().getSomeAttribute()
    It's a bit more complex but you get the idea.
    Vladimir

Maybe you are looking for

  • Skydrive for Mac crashes immediately after launch

    Skydrive for Mac crashes immediately after launch Hi and thanks in advance for your help. Recently when I launch Skydrive on Mac 10.8.3 it quits 2 seconds after launch. If I disconnect the internet connection Skydrive won't quit but the icon remains

  • Program was terminated by signal 6 Concurrent Manager encountered an error while running Oracle*Report

    Hi, My concurrent request failed due to Program was terminated by signal 6 Concurrent Manager encountered an error while running Oracle*Report stat_low = 6 stat_high = 0 emsg:was terminated by signal 6 Error occurred during initialization of VM Could

  • Re-downloading purchased but deleted TV programs

    I'm using a 1st-gen Apple TV and iTunes 10 on 10.5.8. The Apple TV tells me I should go to my Purchased page, which I don't seem to have in my config, or at least can't find. Any ideas how I can get these shows back, preferably using the Apple TV. If

  • Some App's Icons Missing

    I yesterday installed Snow Leopard and nearly everything is running well. But there is one issue regarding my favorite database application Panorama. The application icon is missing, and it shows a generic application icon, the documents show generic

  • Browser loses location when backbutton used

    Hi, on my 32gb TouchPad, there appears to be a bug in the internet browser, or maybe a missing thing. When surfing with the web browser, then pressing the BACK button, the internet browser goes to previous page, but goes back up to the page. It does