To disable first row in a DataGrid

Hi all,
I have a data grid displaying 4 rows.In this data grid i want
to make the first row alone disabled that is the first row should
not be editable but the remaining rows should be editable.Can
anyone please help me out in this issue.
Thanks & Regards,
Lalitha

Hi,
Create a Value Node in the below mentioed structure
TableNode
---value1
---value2
---value3
---TableRowReadOnly(boolean)
Note: - make sure that the attribute TableRowReadOnly is in the same level as the other attributes in the node
Create an Action for the onLeadSelect event for the table and in that action, write the following code:
int leadSelection = wdContext().node<nodename>().getLeadSelection();
if(leadSelection != -1)
     for(int i = 0; i < wdContext.nodeTableNode().size(); i++)
             if(condition)
                      wdContext().nodeTableNode().getTableNodeElementAt(i).setTableReadOnly(true);
            else
                      wdContext().nodeTableNode().getTableNodeElementAt(i).setTableReadOnly(false);
Hope this helps u
Regards,
Poojith MV

Similar Messages

  • How do I set only the first row of a DataGrid as the selected row?

    I have a "Go" button on a search form that fetches data into an already data bound grid.  After the data is fetched, I want to make the first row in the Datagrid the selected row, as if the user clicked on it.  If the result set is empty, I don't want the code to crash.  (I only want one row to be able to be selected at a time)
                protected function btnGo_clickHandler(event:MouseEvent):void
                    getSBJsResult.token = baa_data_svc.getSBJs(cmbSrch.text);
                    grdSBJs. //  ?????  What goes here to select the first row?

    This should do it.
    If this post answered your question or helped, please mark it as such.
    if(myDataGrid.dataProvider.length > 0){
      myDataGrid.selectedIndex = 0;

  • First row trouble with datagrid component

    Dear all,
    I think my question is entirely explained in the topic
    summary of this post. I have a datagrid that uses a item renderer.
    The main app is defined like in the first part of the attached
    code. The itemrenderer looks like the second part of the attached
    code.
    When I run it, the first item of my dataprovider is not shown
    while the first line of my datagrid is always empty... Any idea to
    explain this strange behavior ?
    Thanks in advance...

    Hi WAV;
    You might have better luck posting over in the Front Row Forum.
    Allan

  • How to disable first row selection in a table

    Hi,
    I have three tables which have master child relationship. I need to enable a button for each table based on row selection of corresponding table.But first row is being selected automatically and the buttons are enabled.
    what should i do in order to avoid first row selection in a table.I tried by removing selected Row Keys.But still i am getting the same problem.can anyone suggest on this.
    Thank You,
    Sukumar

    I know a hack but I don't recommend it, anyway here it goes:
    Remove selected Row Keys
    Change selectionListener from the default and create a custom action listener (You can call the default one inside of it) (Tip: use makeCurrent function in this PDF
    This will make sure that there is no selected row highlighted for the first time, but it actually means that the first row is selected, it's just not shown.
    This method is tested with 11.1.1.7

  • Disable First Row in property loader

    Hi,
    TestStand 2.0.1f1
    I am trying to use the property loader with the option 'First Row of Data Specifies Step Property for Each Column' unchecked.
    I have followed the example text as outline in the User manual Ch8 page69.
    But it seems that the step name is always being checked. I have tried a number of varations but I can not get the property loader to ignore the Step Name.
    I have attached an example with a limit file. Any clues anyone.
    Regards
    Ray Farmer
    Regards
    Ray Farmer
    Attachments:
    Disable_the_First_Row.seq ‏26 KB
    Disable_first_row.txt ‏1 KB

    Ray,
    Using the Property Loader and Import/Export Properties Tool, you have to specify the Step Name. There is no way to ignore the Step Name.
    After reading over the help, I think the confusion may be over what the "First Row of Data Specifies Step Property for Each Column" option means. If you do not check that option (it is selected by default), then you can specify the order of the properties and data values that you will read in from the file. This may be of help because the Import/Export Properties tool does not allow you to modify the order of the properties that are exported.
    For example, if you use the Import/Export Properties tool to export Step.Limits.Comp, Step.Limits.High, and Step.Limits.Low properties to a text file, they will always be written to the file in that exact order (Step.Limits.Comp, Step.Limits.High, and Step.Limits.Low).
    Now if you use the Property Loader to read in that file that you just created, it will automatically map those properties to Step.Limits.Comp, Step.Limits.High, and Step.Limits.Low for a specific step name. If you need to switch the values received in the Property Loader step, you can deselect the checkbox for "First Row of Data Specifies Step Property for Each Column" and instead specify which properties should be associated with those columns from the file. For example, you could deselect the checkbox and then type in the text box:
    Comp, Limits.Low, Limits.High
    This would switch the Low and High data values, ignoring the column titles as written from the Import/Export Properties Tool. If you wanted to, you could even delete or modify the column titles in whatever manner you want to.
    Keep in mind that you still need to have an entry in your properties file for each step name in the sequence that has dynamically loaded values. TestStand will not load properties and apply them to generic steps; the step name is the key for the Property Loader tool.
    I hope this answers your question. If you need further clarification or if I missed a point, just let us know!
    Regards,
    Shannon R.
    Applications Engineer
    National Instruments

  • DataGrid ItemRenderer First Row

    Hi,
    I have a DataGrid:
    <mx:DataGrid  id="gamesGrid" x="10" y="81" width="828" variableRowHeight="false">
            <mx:columns>
                <mx:DataGridColumn headerText="Game" itemRenderer="GameContainer"/>
                <mx:DataGridColumn headerText="Starts"  itemRenderer="StartsContainer"/>
            </mx:columns>
    </mx:DataGrid>
    Its dataProvider is an XMLListCollection.
    Its ItemRenderer are VBox objects (either written in Actionscript or in MXML - either way).
    My problem is, that when the XMLListCollection is updated, my ItemRenderer's are either reinstantiated or reinitialised.
    However, the creationComplete handler of the ItemRenderer (in my case a VBox) is only called for the first row of the DataGrid.
    This is a problem, because it clears the display data.
    If i have the ItemRenderer in code, then i see the constructor called when i update the dataProvider.
    If i have ItemRenderera an MXML component, then i see creationComplete called when i update the dataProvider.
    All i want to do is update the contents of the ItemRenderer - not re instantiate it (especially not JUST the first row of ym datagrid).
    How do i get around this and is this a bug?
    Sounds quite similar to:
    http://forums.adobe.com/thread/604259
    Regards, Sam

    Apologies if I've misunderstood your problem.
    But if you just want to update the data displayed in the renderer when the dataProvider data changes, it's normal to override the "set data" function in the renderer. Simple example based on those found in the docs:
    <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
        horizontalAlign="center">
        <mx:Script>
            <![CDATA[
                import mx.events.FlexEvent;
                override public function set data(value:Object):void {     
                    if(value != null)  {
                        super.data = value;
                        // do whatever you need to do here
                        // for example
                        var xml:XML = value as XML;
                        myTextArea.text = xml.myProperty
                    // Dispatch the dataChange event.
                    dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
            ]]>
        </mx:Script>
        <mx:TextArea id="myTextArea"/>
    </mx:VBox>
    As renderer instances are recycled in data grids, I think using creationComplete will have unpredictable results.

  • Getting the current row as the DataGrid is created.

    I want to trap the first row of my DataGrid how can I do
    this?

    Amit, shame you didn't include a code example. The first blog does work...though probably not the most effecient mechanism. The 2nd Blog seems to be missing something as referencing e.site isn't enough. I've included a code sample of what it should be. Please include the routine DeleteNil as you can't assign a value to a null node. If theres a more effecient way..by all means post a blog. Cheers
    public void Items_UnitGross_Changed(object sender, XmlEventArgs e)
    // Check if value has changed and not a table insertion
    if (e.Operation == XmlOperation.ValueChange)
    // Get Current Row
    XPathNavigator xNavigator = e.Site;
    bool bParent = xNavigator.MoveToParent();
    // Get Reference to the Gross Value
    XPathNavigator xField = xNavigator.SelectSingleNode("boc:UnitGross", this.NamespaceManager);
    DeleteNil(xField);
    double dGross = Convert.ToDouble(xField.Value);
    // Get Reference and set the Net Value
    xField = xNavigator.SelectSingleNode("boc:UnitNet", this.NamespaceManager);
    DeleteNil(xField);
    xField.SetValue(getNet(dGross).ToString());
    public void DeleteNil(XPathNavigator node)
    if (node.MoveToAttribute("nil", "http://www.w3.org/2001/XMLSchema-instance"))
    node.DeleteSelf();
    private double getNet(double Gross)
    // Calculates the Net Value (without Tax) from the Gross value
    double dNet = Gross / C_VATRATE_DIV;
    return dNet;

  • How to disable the first row of an ALV Grid?

    Hi All,
          I am working on a module pool programme. I am displaying ALV grid. I have to give some default values in the first row and disable it. I have to disable the third column and fourth row value. How can i achieve this?
    Help will be appreciated.
    Thanks,
    Ibrahim.

    here is the code i have written....but its not working...
    TYPES : BEGIN OF tp_grid,
            fname(25)   TYPE c,
            reqd,
            seqno       TYPE n,
            tl_styl TYPE lvc_t_styl,
            edit,
            END OF tp_grid.
    DATA : wl_styl TYPE lvc_s_styl.
    DATA : wl_layout TYPE lvc_s_layo.
    DATA : lt_celltab TYPE lvc_t_styl.
      READ TABLE tl_grid INTO wl_grid INDEX 1.
      wl_styl-fieldname = 'TAG NUMBER'.
      wl_styl-style = cl_gui_alv_grid=>mc_style_disabled.
      INSERT wl_styl INTO TABLE lt_celltab.
      INSERT LINES OF lt_celltab INTO  wl_grid-tl_styl index 1.
      MODIFY tl_grid INDEX 1 FROM wl_grid.
      wl_layout-stylefname = 'TL_STYL'.
      CALL METHOD l_initgrid->set_table_for_first_display
        EXPORTING
          is_layout                     = wl_layout
        CHANGING
          it_outtab                     = tl_grid
          it_fieldcatalog               = tl_init_fcat
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          OTHERS                        = 4.
    ENDFORM.                    " display_initgrid
    Help will be appreciated....
    Thanks,
    Ibrahim

  • Textinput in all the colums of the first row of datagrid

    Hi
    i need Textinput in all the colums of the first row of
    datagrid.
    can ayone tell me the solution..
    Thx in advance.

    This will not be easy. i see two possible solutions.
    You could use a custom itemRenderer. This will require that
    you find some way to identify the dataProvider collection index
    from within the renderer, and set the renderer to editable when
    that index is 0.
    Or you could create a composite component using two
    dataGrids, one with a single row for the editable columns. There
    are examples available on combining two DGs this way.
    Again, this will be difficult, so be sure that it is
    absolutely required and consider some other UI approach if posible.
    Tracy

  • 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

  • Adding new data row(s) to DataGrid control

    My requirement is to provide the ability to add a new row to
    the datagrid when tabbed out of the (last cell of the last row of
    the datagrid. I have made my datagrid editable and in the
    'itemEditEnd' handler I am adding a new object (with empty values)
    to the data provider for the Grid and setting focus to the Grid and
    then setting the new row index as the Selected Index for the Grid.
    None of this activating itemEditor for the first cell of the new
    row.
    I have seen somewhere that dispatching the itemEditBeginning
    will do this for me. But not sure how to do this. Appreciate if can
    point me to a sample woring example.

    Perfect - Have been looking for a solution since few days.
    You just made my day. Thank you so much.

  • af:table, only the first row of the table is effect

    Hi experts,
    I have an issue about using the <af:table, needs your help:
    1.The default selected line is the first line of the table(This should be ok).
    2.Only the first line can react to my manipulate, such as select one line and click delete button.
    3.While choosing the other line-->click the command button, the page will be refreshed and the selected one will turned to the first line. (Now the selected row, will be the first row). And will do nothing ,and has no action with the command button.
    I have an page OVS_Server.jspx, parts of it is :
    <af:table value="#{backVS.serverList}"
    var="row" rows="20"
    emptyText="#{globalRes['ovs.site.noRows']}"
    binding="#{backing_app_broker_OVS_Server.serverListTable}"
    id="serverListTable" width="100%"
    partialTriggers="poll1 commandButton_refresh commandButton_searchServer"
    selectionListener="#{backing_app_broker_OVS_Server.onSelect}">
    <f:facet name="selection">
    <af:tableSelectOne text="#{globalRes['ovs.site.selectAnd']}" autoSubmit="true"
    id="tableSelectOne" required="false">
    <af:commandButton text="#{globalRes['ovs.site.server.poweroff']}"
    id="commandButton_powerOff"
    action="#{backing_app_broker_OVS_Server.powerOffAction}"
    partialTriggers="tableSelectOne"
    disabled="#{backing_app_broker_OVS_Server.unreachableServer}"
    />
    <af:commandButton text="#{globalRes['ovs.site.edit']}"
    id="commandButton_edit"
    action="#{backing_app_broker_OVS_Server.editAction}"
    />
    <af:commandButton text="#{globalRes['ovs.site.delete']}"
    id="commandButton_delete"
    action="#{backing_app_broker_OVS_Server.deleteAction}"
    />
    </f:facet>
    <af:column sortProperty="ip" sortable="true"
    headerText="#{globalRes['ovs.site.serverHost2']}"
    id="column_ip">
    <af:commandLink text="#{row.ip}"
    id="commandLink_ip"
    shortDesc="#{globalRes['ovs.site.viewUpdateDetails']}"
    action="#{backing_app_broker_OVS_Server.viewAction}"
    immediate="true"/>
    </af:column>
    <af:column sortProperty="serverName" sortable="true"
    headerText="#{globalRes['ovs.site.serverName']}"
    id="column_serverName">
    <af:outputText value="#{row.serverName}"/>
    </af:column>
    </af:table>
    One JavaBean OVS_Server.java,and part of it is :
    public class OVS_Server {
    private CoreTable serverListTable;
    private VirtualServer selectedServer;
    public void onSelect(SelectionEvent selectionEvent) {
    selectedServer = (VirtualServer)serverListTable.getSelectedRowData();
    public String deleteAction(){
    if (selectedServer!=null) {
    deleteServerOper.execute();
    return "deleteServer";
    Would anyone show some lights on it?
    Thank you very much.

    Thank you for your reply!
    But the example you mentioned also has the issue like one of the comments :
    "Hi, on selecting the first row it displays the correct value, when navigating to another row still it displays the old value and not fetching the new selected row, actually I can see this on your sample screen shots... is there any way we can fix??"
    Is there any resolution?

  • Making first row checkbox enable

    Hi all,
    I have a scenario where i had a af:table with status field with values ('failed' or 'blocked') ,id field(not a primary key) and a checkbox column( i.e.,Transient attribute).
    here i had a searchcriteria where i should mention id for that id i will get all the transactions .
    In the transactions i need to disable the checkbox of 'blocked' status and enable the checkbox of 'failed' status.this i was able achieve using af:switcher with two facets
    <af:switcher facetName="#{row.TransactionStatus}">
    <f:facet name="Failed">
    <af:selectBooleanCheckbox id="sbc1" />
    </f:facet>
    <f:facet name="Blocked">
    <af:selectBooleanCheckbox id="sbc2" disabled="true" />
    </f:facet>
    In the transactions if i get only blocked then i need to make firstrow checkbox to be enabled and rest should be disabled. here i was able to find whether i have only blocked or not.By using
    ViewObjectImpl empDeptVO = this.getBlockedTransactionsView1();
    Row[] selectedRows=empDeptVO.getFilteredRows("TransactionStatus", "Failed");
    if(selectedRows.length == 0)
    How can i enable the first row check box when i get only blocked transactions
    thanks in advance

    Duplicate of: Enabling the First Row Check Box in af:table
    Frank

  • Table- Why first row Selected from itself

    Hi,
    i have a jspx that have some fields and a button ,
    the user should fill this fields with data then click the button
    the button pass those values to a function that call a Stored Proceudre in the DB
    then the last code in that button is to refresh a table (by execute param) that read the inserted data
    why everytime the table refreshed give me the data with the first row SELECTED!!!!!!!!
    i am using ADFBC + JSF
    thanks in advance

    Hi,
    hope you handled the case where a user hits submit - or performs some other action that is performed on the current row - because you are now in an unpredictable state. Ideally you disable all related command buttons until a user selects a row
    Frank

  • Give some hints that in a table control , first row will be editable and

    pls,
    give some hints that in a table control , first row will be editable and
    rest of the rows will be non-editable.

    Hi,
    Take the group1 for all the textboxes in table control as 'ABC'.
    Use this code, its working:-
    it_zekpo is my internal table w/o header line,
    wa_zekpo is work area.
    Name of input/output fields on screen are:-
    wa_zekpo-field1,
    wa_zekpo-field2, and so on...
    At screen flow-logic
    PROCESS BEFORE OUTPUT.
    *  MODULE status_8003.
      LOOP WITH CONTROL po_tb.
        MODULE read_data.
      ENDLOOP.
    PROCESS AFTER INPUT.
    *  MODULE user_command_8003.
      LOOP WITH CONTROL po_tb.
        MODULE modify_data.
      ENDLOOP.
    In PBO
    *&      Module  READ_DATA  OUTPUT
    MODULE read_data OUTPUT.
      READ TABLE it_zekpo INTO wa_zekpo INDEX po_tb-current_line. "po_tab is table control name
      "enable only first row and disable rest rows in table control.
      IF sy-subrc EQ 0.
        IF sy-tabix GE 2.
          IF screen-group1 = 'ABC'.
            LOOP AT SCREEN.
              SCREEN-INPUT = 0.
              SCREEN-ACTIVE = 0.
            ENDLOOP.
            MODIFY SCREEN.
          ENDIF.
        ENDIF.
      "disable empty rows
      ELSE.
        IF screen-group1 = 'ABC'.
          LOOP AT SCREEN.
            SCREEN-INPUT = 0.
            SCREEN-ACTIVE = 0.
          ENDLOOP.
          MODIFY SCREEN.
        ENDIF.
      ENDIF.
      data : line_count type i.
      describe it_zekpo
      lines line_count.
      po_tb-lines = line_count + 10.
      "to increase the number of lines in table control dynamically
    ENDMODULE.                 " READ_DATA  OUTPUT
    In PAI
    *&      Module  MODIFY_DATA  INPUT
    MODULE MODIFY_DATA INPUT.
      MODIFY IT_ZEKPO FROM WA_ZEKPO INDEX po_tb-currentline.
    ENDMODULE.                 " MODIFY_DATA  INPUT
    Hope this solves your problem.
    Thanks & Regards,
    Tarun Gambhir

Maybe you are looking for

  • I am tired with portal favorites

    Hi, We have installed enterprise portal and added a couple of favorites, scenario: I logged in as a super admin, went to user adminstration tab and added "create user" page to the Portal favorites. so I was able to see the corresponding link in the p

  • Crystal Reports and ODBC (RDO) connection

    Hi, I'm using SQL Server 2005 and Crystal Reports 2008. I connected my Crystal Report to the SQL database using an ODBC (RDO) connection. In the past I was able to add a field to a table in the database, and I was able to see the new field immediatel

  • Trim up to a certain character

    hi everyone, i hope someone can help me with this. i have a string that I need to trim up to a pipe character ("|"). the problem is, the length of the characters before this pipe character varies greatly. How can I trim the string (for example, abcde

  • Help: PDF with Internet Link alike

    Hi guys, I asked this question to the General Acrobat Forum and Dave told me to ask for hints here. "I did manage to put a hyperlink in my PDF but now how can i make it change color to blue and show an underscore when mouse over ike a normal website?

  • Can any one tell me Regarding Withholding Tax

    Actually ,While making a transaction in A/P invoice ,I have activativated  the subject to withholding tax in the BP Master Data.And in the item master data tab page for the particular item I have also activated thebwithholding tax liable.So the real