如何在 ADF 中设置滚动条位置



我正在使用JDeveloper 11.1.1.7.0。

我有两个面板的jsff片段。左侧面板包含链接,右侧面板将显示数据,具体取决于左侧面板上单击的链接。

左侧面板中的链接使用迭代器呈现,此迭代器驻留在panelGroupLayout中,layout="scroll"。

当我向下滚动到左侧面板的末尾并单击链接时,右侧面板中的内容加载正常,但左侧面板的滚动条重置为顶部。这样我就无法在左侧面板中看到选定的链接。

有没有办法将滚动条固定在同一位置?

<af:panelGroupLayout id="pgl3" layout="horizontal" valign="top" inlineStyle="height:200px;" styleClass="AFStretchWidth">
    <af:panelGroupLayout layout="scroll" halign="left" id="pgl4" inlineStyle="width:100px;"
        partialTriggers="i1:cl1">
        <af:iterator value="#{pageFlowScope.headerBean.links}" id="i1" var="link">
            <af:commandLink actionListener="#{pageFlowScope.headerBean.linkCliked}" id="cl1" inlineStyle="border: solid 1px black;"
                            partialSubmit="true">
                <af:outputText value="#{link}" id="ot6" 
                               styleClass="selectedLinkStyle"
                               rendered="#{pageFlowScope.headerBean.selectedLink}"/>
                <af:outputText value="#{link}" id="ot7" 
                               styleClass="unselectedLinkStyle"
                               rendered="#{not pageFlowScope.headerBean.selectedLink}"/>
                <f:attribute name="selectedLinkName"
                                         value="#{link}"/>
            </af:commandLink>
        </af:iterator>
    </af:panelGroupLayout>
    <af:panelGroupLayout layout="vertical" styleClass="AFStretchWidth" halign="right"
                         id="pgl5" inlineStyle="border: solid 1px black;height:200px;"
                         partialTriggers="i1:cl1">
        <af:outputText value="#{pageFlowScope.headerBean.linkData} id="ot5"/>
    </af:panelGroupLayout>
</af:panelGroupLayout>

尝试删除 pgl4 的 partialTriggers 属性或者考虑使用活动数据

您也可以使用此处所述的scrollComponentIntoViewBehavior,但这是12c中的新功能

最新更新