Pages

Friday, September 27, 2013

Dynamic Region Refresh Issue


In general when we use dynamic region, we have multiple buttons/links which change the taskflowId and partial trigger on dynamicRegion . This refreshes the taskflow loaded in dynamic Region. Recently I encountered a usecase where dynamic region is not refreshing or reset is not happening.




InputText fields has required="true" and CommandButtons in the above page have immediate="true" so that it is able to navigate to another taskflow. Now as we go ahead with implementation of changing the taskflowId and partialTrigger on dynamicRegion, the value in the inputText field is retained, even though taskflow is reloaded .

Finally I was able to resolve this reset issue with help on Jdeveloper And ADF Forum..https://forums.oracle.com/thread/2585988 . Thanks to Frank.

Solution is to switch the taskflow using below code :
oracle.adf.view.rich.util.ResetUtils.reset(regionId_in_here);

Download the sample from here


Wednesday, September 4, 2013

How to get the current userName in UCM Service Handler


It is very often that current user's username is required in UCM service. Username of the user executing the service can be retrieved using below code :


import java.util.Properties;
import intradoc.shared.UserData;
import intradoc.server.Service;

    private String getCurrentUsername(Service service) {
        UserData userData = service.getUserData();
        Properties properties = userData.getProperties();
        String userName = userData.getProperty("dName");
        return userName;
    }

Enjoy