cancel
Showing results for 
Search instead for 
Did you mean: 

setting focus on a particular cell of tableview on row selection

Former Member
0 Kudos

Hi Experts,

I have a tableview with some editable fields. On selecting a row, by default the focus should be set to the third cell.

I have tried out many javscript codes like

document.getElementById."tv_"row"_3".focus();. but this is not working. Its throwing a javascript error saying "document.get.ElementById."tv_"row"_3" is null or not an object".

I have even tried with document.form."tv_"row"_3".focus(); but this is also throwing the same error.

The same code is working in a different context but here its throwing error. Can you please suggest?

Thanks and Regards,

Sneha.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sneha,

There were two blogs by Raja T. on using Auto-tabs....This uses the focus method of javaScript....

Maybe you'll be able to draw a few ideas out of this.....

1) <a href="/people/raja.thangamani/blog/2007/02/07/accomplishment-of-tab-and-auto-tab-in-bsp-part-i of Tab and Auto-Tab in BSP: Part-I</a>

2) <a href="/people/raja.thangamani/blog/2007/02/08/accomplishment-of-tab-and-auto-tab-in-bsp-part-ii of Tab and Auto-Tab in BSP: Part-II</a>

Hope this helps.

<b><i>Do reward each useful answer..!</i></b>

Thanks,

Tatvagna.

Answers (1)

Answers (1)

athavanraja
Active Contributor
0 Kudos

document.getElementById."tv_"row"_3".focus();. is wrong

document.getElementById('tv_1_3').focus(); is the correct js syntax

Former Member
0 Kudos

Hi ,

I had tried tv_1_5 but that is also not working.

I have observed that after it goes to server to check the row number selected and when it returns to client, its not identifying document.getElementById('tv_1_5') This is shown as null object.

Thanks and Regards,

Sneha.