Saturday, September 15, 2012

How to disable adf default row selection in <af:table>?

How to disable adf default row selection in <af:table>?

Problem Definition

In day to day development we faced common issue with using af:table row selection, because adf provide 1 row default selected. Some custom event we defined on row selection are not getting triggered on row if there is single row in table. It cause very big problem in application if those event must be triggered to populate some other data on row selection.

Solution Proposed

Solution I am proposing can solve that issue. I didn't tested every aspect but tested the scenario of making selected row as current row. After making these changes current row is getting set to viewobject properly and returning right values.

Remove the selectedRowKeys from <af:table>

After making these changes you screen looks like:
Here no row is selected in first table but first row is the current row in viewobject hence child table is showing default data for first row. you can make some changes to first view object so that there won't be any current row in viewobject. In that case child table won't display any row.

Anyway lets focus on the selection event triggering on first table. Now I have selected second row form first table and corresponding child record are showing in second table.

 

 Above testcase proved that there is no problem with selection event while removing the selectedRowKeys property of <af:table>

Find the working sample application on Sample Application

11 comments:

  1. Hi Amit!
    You wrote: "Here no row is selected in first table but first row is the current row in viewobject hence child table is showing default data for first row. you can make some changes to first view object so that there won't be any current row in viewobject."
    Could you please explain what kind of changes in the first viewobject I have to do to reset currency. I need the second table to not show any data until the user selects row in first table explicitly.
    Thanks in advance.
    Mike

    ReplyDelete
  2. Hi Amit,

    Excellent it works for me. Thanks you so much for post.

    Srikanth

    ReplyDelete
  3. You wrote: "Here no row is selected in first table but first row is the current row in viewobject hence child table is showing default data for first row. you can make some changes to first view object so that there won't be any current row in viewobject."
    Could you please explain what kind of changes in the first viewobject I have to do to reset currency. I need the second table to not show any data until the user selects row in first table explicitly.

    Thanks
    Raj

    ReplyDelete
    Replies
    1. Wondering you know the solution or want us to work on it :P

      Delete
  4. Not able to download sample application its broken

    ReplyDelete
  5. I appreciate that you produced this wonderful article to help us get more knowledge about this topic.
    I know, it is not an easy task to write such a big article in one day, I've tried that and I've failed. But, here you are, trying the big task and finishing it off and getting good comments and ratings. That is one hell of a job done!



    Selenium training in bangalore
    Selenium training in Chennai
    Selenium training in Bangalore
    Selenium training in Pune
    Selenium Online training
    Selenium interview questions and answers

    ReplyDelete
  6. Thanks you for sharing this unique useful information content with us. Really awesome work. keep on blogging
    python training in chennai
    Python Online training in usa
    python course institute in chennai

    ReplyDelete
  7. Nice post. By reading your blog, i get inspired and this provides some useful information. Thank you for posting this exclusive post for our vision. 
    python training in chennai
    Python Online training in usa
    python course institute in chennai

    ReplyDelete
  8. This is the exact information I am been searching for, Thanks for sharing the required infos with the clear update and required points. To appreciate this I like to share some useful information.

    aws training in bangalore

    aws courses in bangalore

    aws classes in bangalore

    aws training institute in bangalore

    aws course syllabus

    best aws training

    aws training centers

    ReplyDelete

Thanks for your valuable comment. You comment will go live soon.