7 Replies Latest reply: Dec 27, 2013 12:54 AM by vinaykumar2 RSS

Table jumps to top of page when row is clicked - autoHeightRows="0"

956778 Newbie
Currently Being Moderated
Hi there

I'm experiencing some very bizarre behaviour with the code below. I have autoHeightRows set to 0 on a table so that the scrolling happens at the page level instead of at the table level. The issue is that when I scroll down in the page and click on any row in the table, the browser viewing pane "jumps" to the top of the page, so that the table header is at the top of the viewing pane. This behaviour is very unexpected and undesirable to users.

<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<f:view>
<af:document id="d1">
<af:form id="f1">
<af:panelGroupLayout id="pgl1">
<af:table value="#{pageFlowScope.tableTestBean.collection}" var="row" rowBandingInterval="0" id="t1"
autoHeightRows="0" rowSelection="none" fetchSize="100">
<af:column sortable="false" headerText="Name" align="start" id="c1">
<af:outputText value="#{row.name}" id="ot2"/>
</af:column>
<af:column sortable="false" headerText="Value" align="start" id="c2">
<af:outputText value="#{row.value}" id="ot1"/>
</af:column>
</af:table>
</af:panelGroupLayout>
</af:form>
</af:document>
</f:view>
</jsp:root>

pageFlowScope.tableTestBean.collection is just an ArrayList of POJOs containing a name and a value (both Strings). I'm using JDev 11.1.1.5.0 and the problem is consistently reproducible in IE 7/8/9.

Does anyone know if this is a known ADF defect? If so can you please point me to any information about it? I've been searching for hours and haven't found anything even remotely related. Much appreciated!

My suspicion is that the cause has something to do with the ADF javascript code that sets the row to be "focused". Perhaps the javascript is setting focus on the entire table, causing it to move to the top. I haven't tested my theory though since I can't find the code that handle row clicks.

It should also be noted that this is a very simplified version of the actual web page I am working on. I created it specifically to isolate the problem.

Thanks for any help!!

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points