We are doing a customization of Webtop (6.5 SP1 version) DRL component. We are adding a custom button called "Locate" similar to View and Edit in the drl.jsp. The functionality on click of Locate button is to search for the document (r_object_id) and its parent Cabinet to be displayed similar to the one in the Webtop Search result set (Browser Tree on the left panel and the searched documents in the workarea frame).
The search is working at the first hit of DRL and all other remaining hits are directly landing in the default main component without invoking the setClientEvent() method described in Step-2 below.
The way we have implemented is as follows.
1) In the custom DRLComponent.java, call Set Component Jump to "main" component.
setComponentJump("main", argumentlist, getContext());
2) I have extended BrowserTree.java to custom layer and doing a setClientEvent() to invoke a client event registered in the classic.jsp page. Please note that I am triggering this setClientEvent() in the onInit() method of BrowserTree.java.
setClientEvent("onLocateDoc", argumentlist);
3) My classic.jsp has got a <script> which follows like this
<script type="text/javascript" language='JavaScript1.2' >
registerClientEventHandler("browser", "onLocateDoc", onLocateDoc);
function onLocateDoc(objectId) {
var bContentReady = frames["workarea"].contentReady;
if (bContentReady != true) {
setTimeout("onLocateDoc(\"" + objectId + "\")", 500);
return;
}
var query = "select * from dm_folder where r_object_id in (select distinct i_folder_id from dm_document where r_object_id='" + objectId + "') union select * from dm_document (all) where r_object_id='" + objectId + "'";
postComponentJumpEvent(null, "nsearch", "content","queryType", "dql", "query", query);
}
</script>
4) I invoke my "nsearch" component using the postComponentJumpEvent() method. The nsearch is a simple search component extending Simple Search Component.
Please let me know whether this approach is right or is there any other approaches for implenting the above mentioned functionality.
The customer requirement is to display the DRL locate search to be displayed in the Main component layout. Otherwise in the Step-1 mentioned above, I can do a setComponentJump("nsearch") and the result is appearing but in a full window.
Your help is greatly appreciated.