Tuesday, 27 May 2008

Partial Page Renderring (PPR) fails for commandLink within ADF Table

There are 2 ways to get this to work.

Option #1

Follow the technique shown in the blog entry below.

Dynamically-Updating JSP Graph in JSF Page

In that example the backing bean for the page illustrates how to allow an updateable UIComponent in a table to trigger partial page rendering for other elements in the page by programmatically calling the ADF Faces addPartialTarget API.

Option #2

1. Make sure the af:table containing the af:commandLink has its id set.
2. Set the PartialSubmit property for the af:commandLink to true.
3. Set the PartialTriggers property for the af:outputText to the following.


For example, if the id of the af:table is myTableId and the id for the af:commandLink is cmdTradeName, then the PartialTrigger property for the af:outputText should be set to.


Example as follows.

<af:table value="#{bindings.findAllPipelineData1.collectionModel}"
var="row" rows="#{bindings.findAllPipelineData1.rangeSize}"
emptyText="#{bindings.findAllPipelineData1.viewable ? 'No rows yet.' : 'Access Denied.'}"


<af:column sortProperty="tradeName" sortable="false"
<af:commandLink text="#{row.tradeName}" id="cmdTradeName"
partialSubmit="true" immediate="true">
<af:setActionListener from="#{row.tradeName}"
<af:outputText value="#{sessionUser.data}"

Thursday, 8 May 2008

REF CURSOR parameters in PLSQL Web Services

If you have ever tried to publish a PLSQL package as a Web Service that has a method signature as follows JDeveloper 10.1.3.x doesn't allow you.

procedure test1 (pRefCursor1 out sys_refcursor, prefCursor2 out sys_refcursor);
However the following does work for a function returning a refcursor.

function retrieve_emps return sys_refcursor;
If you press the "Why Not" button in the PLSQL Web Service dialog you get this message.

"Ref cursor type arguments are unsupported due to a JDBC limitation. Ref cursor types are only supported for use as the return type".

Due to this limitation if you have the luxury of developing the PLSQL from scratch you can simple use PLSQL tables to overcome this. So lets assume we have a collection defined as follows.

DROP TYPE employee_list;
DROP TYPE employee_obj;

( empno NUMBER(4)
, ename VARCHAR2(10)
, job VARCHAR2(9)
, sal NUMBER(7,2)
, deptno NUMBER(2)
create or replace TYPE employee_list AS TABLE OF employee_obj;

So now we can use a method signature as follows and this will work fine.

procedure copy_emps (pInEmps in employee_list, pOutEmps out employee_list);