Skip to main content

Conditional rendering of editor components for a clickToEdit table

A very common use case related to table with 'click-to-edit' mode is to render some custom editor component for some cells, when user selects a row for edit. Newly added (as part of PS2 release) 'activeRowKey' attribute on table component will help us here.

The 'activeRowKey'is the row that is currently active on the client. In click-to-edit mode, the active row will be made editable and is brought into view (if not already visible). Upon initial display, the click-to-edit component defaults the active row to the first visible row.

A bit about the implementation. Please see the below given jsf tag snippet, which may help you to understand the concept better. Here, the EL 'backingBeanScope.TestBean.tbl.rowKey eq backingBeanScope.TestBean.tbl.activeRowKey' checks whether current row is the activeRowKey, and based on that display is flipped between components

<af:column sortProperty="DummyAttribute" sortable="true"
    <af:switcher id="s1" defaultFacet="InActive"
       facetName="#{TestBean.tbl.rowKey eq TestBean.tbl.activeRowKey ? 'Active':'InActive'}">
        <f:facet name="InActive">
            <af:outputText value="#{row.bindings.DummyAttribute.inputValue}"
        <f:facet name="Active">
            <af:commandButton text="I'm Dummy" id="cb1"

You can download the sample workspace from here.
[Runs with Oracle JDeveloper 11g R1 PS2 + HR Schema]


Dear Experts,

I facing the issue for pagination ADF table control. My requirement like first page contain 10 record like that bottom of the table I should show 1 2 3 ... pagination.

Please any suggestion??

This comment has been removed by the author.
Jobinesh said…
ADF Faces table follows 'fetch on scrolling' to simulate the classic/conventional pagination behavior. This seems to be a better approach for most of the usages. That said, however you can try the below link which may help you to get started if you plan to build the pagination in the way you described.
Anonymous said…
Hi Jobinesh,

I have a condition where my adf table based on a VO (filtered rows for a particular location). However, there might be a case where the user creates a new row and wants to assign a location (and modify) the row in the table. But this row may not be unique and may be already present in the db. That means i create the row with parameters, and try to commit, if it already exists i update else insert. however, now i get uniqueness constraint since its creating new row. Do you know how we can create a vo row that will update if exists else create ?

otherwise i can fetch the row independently and put it up in the iterator if it already exists. but i guess i will face the uniquenss error

subra manian said…
i want to show particular row as click to editable.
based on the condition

Popular posts from this blog

Happy New Year 2018 !

We can't go back and change the beginning, but we always can start where we are and change the ending. Believe in yourself and you will be unstoppable!

Wishing you and your family a very happy new year 2018 !!!

How to set Bind Variable Values at runtime ?

In this post I'm sharing a couple of approaches for programmatically setting bind variables values at run time. This post is an attempt to explain 'When to use what ?'[ In case if you are familiar with 'Bind Variables' in ADF BC, please refer Section 5.10, Working with Bind Variables in Fusion Developer's Guide ]

1. Set the Bind Variable value using RowSet::setNamedWhereClauseParam(...)

You can use use the setNamedWhereClauseParam(...) method on the ViewObject interface (which extends oracle.jbo.RowSet) to set the value for bind variables. Please note this sets the value on default RowSet. In other words, this doesn't have any effect on the secondary RowSets that you/system generates.
ViewObject vo = am.findViewObject("EmployeesView1"); vo.setNamedWhereClauseParam("bindVarDeptId", new Number(10)); vo.executeQuery();
2. Set the Bind Variable value using ViewObject's VariableValueManager::setVariableValue(...)

VariableValueManager Ma…