Access Parent DC

How can I access Parent DCs methods in Child DC?
Suppose I have DC1 is been used in DC2. Now, From DC2 I need to execute methods of DC1 or access an Outplug of DC1.
Please give me some idea
thanks in anticipation,
nikhi∟

Hi
1.First place the method you want to expose in DC1 interface controller.
2. Expose the interface controller as public part in DC1.
3. Add the public part of Dc1 to Dc2.
4. Now add the InterfaceComponentController of DC1 in DC2 .
5. Now you should be able to access to methods in Dc1 interface controller.
                                                                                6.to access outbound plug just writ
wdThis.wdget<interfacecontollername>().wdFireplug<outplugname>();
I am new to webdynpro java up to my knowledge i answered the question if it useful give me points

Similar Messages

  • Not able to access parent instance variable in outside of methods in child

    Hi,
    I am not getting why i am not able to access parent class instance variable outside the child class intance methods.
    class Parent
         int a;
    class Child extends Parent
         a = 1; // Here i am getting a compilation error that Syntax error on token "a", VariableDeclaratorId expected after this token
         void someMethod()
              a = 1;  // Here i am not getting any compilation error while accessing parent class variable
    }Can any one please let me know exact reason for this and what is the error talks about?
    Thanks,
    Uday
    Edited by: Udaya Shankara Gandhi on Jun 13, 2012 3:30 AM

    You can only put assignments or expressions inside methods, constructors or class initializors, or when declaring a variable.
    It has nothing to the with Child extending Parent.
    class Parent {
        int a = 1;
        { a = 1; }
        public Parent() {
            a = 1;
       public void method() {
           a = 1;
    }

  • How to access Parent Message ID

    Hi,
    I am having File – IDOC scenario and also we are having dynamic interface determination where base on some particular value in file we are generating two different IDOCs. The overall scenario is working fine.
    Now in SXMB_moni I am getting one parent node and under that there are two sub nodes.  Also for there are 3 different message ID (one for parent and 2 for sub node.) .
    If we scroll sxmb_moni screen (<b>in alv grid</b>) there we are finding Message ID and Parent Message ID for sub node.  I am able to access message id for subnode but <b>not able to access Parent Message ID</b>.
    To access message ID, I am using following UDF.
    String headerField="";
    java.util.Map map;
    // get constant map
    map = container.getTransformationParameters();
    headerField = (String) map.get(StreamTransformationConstants.MESSAGE_ID);
    return headerField;
    I have already tried all Runtime Constants in  <a href="http://help.sap.com/saphelp_nw04/helpdata/en/b3/9a2aeb24dc4ab6b1855c99157529e4/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/b3/9a2aeb24dc4ab6b1855c99157529e4/frameset.htm</a>
    If anyone guide me to access Parent message id then it would be really great….
    Thanks,
    Sunil

    Hi Bin,
    thanks for reply...
    I have tried this but there is blank output.
    Thanks,
    Sunil Bhavsar

  • How do you access parent component from a child in Flex 4?

    Suppose I have a Component A (as a Spark Group) that generates an event, eventX.  Inside Component A, I add Component B (also a Spark Group) that wants to add itself as an event listener for eventX.  How do I access Component A from Component B to register for the event?
    For reference, this relationship should be similar to the MVC pattern where Component B is the view, and Component A is the model and controller.
    If I were implementing this in ActionScript, I'd have no problem coding this.  However, I am using flex, and am still trying to figure out how the FLEX API works.

    GordonSmith wrote:
    B could "reach up" to A using the parentDocument property. Or you could set a reference-to-A onto B.
    Gordon Smith
    Adobe Flex SDK Team
    B could "reach up" to A using the parentDocument property
    Would you mind explaining that?
    set a reference-to-A onto B.
    That is something I am trying to avoid.  I do not want to create tightly coupled code.
    Here is a generic form of the code I am using.  Feel free to tell me what I'm doing wrong in your explanation of how B can "reach up" to A.  Thanks!
    Component A
    <?xml version="1.0" encoding="utf-8"?>
    <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx" width="837" height="733"
                     creationComplete="componentA_creationCompleteHandler(event)"
                     xmlns:components="components.*">
         <fx:Script>
              <![CDATA[
                   import mx.events.FlexEvent;
                   public static const STATE_CHANGED:String = "stateChanged";
                   private var currentModelState:String;
                   protected function componentA_creationCompleteHandler(event:FlexEvent):void
                        changeModelState("second");
                   public function changeModelState(newState:String):void
                        if (newState != currentModelState)
                             currentModelState = newState;
                        dispatchEvent(new Event(IP_Dragon.STATE_CHANGED));
                   public function getModelState():String
                        return currentModelState;
              ]]>
         </fx:Script>
         <fx:Declarations>
              <!-- Place non-visual elements (e.g., services, value objects) here -->
         </fx:Declarations>
         <components:Component_B id="b" x="0" y="0"/>
    </s:Group>
    Component B
    <?xml version="1.0" encoding="utf-8"?>
    <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx"
               xmlns:components="components.*"
               width="837" height="733" contentBackgroundAlpha="0.0" currentState="first"
               creationComplete="componentB_creationCompleteHandler(event)">
         <fx:Script>
              <![CDATA[
                   import mx.events.FlexEvent;
                   protected function componentB_creationCompleteHandler(event:FlexEvent):void
                        currentState = parent.getModelState;
                        parent.addEventListener(Component_A.STATE_CHANGED, modelStateListener);
                   private function modelStateListener (e:Event):void
                        currentState = parent.getModelState();
              ]]>
         </fx:Script>
         <s:states>
              <s:State name="first"/>
              <s:State name="second"/>
              <s:State name="third"/>
         </s:states>
         <fx:Declarations>
              <!-- Place non-visual elements (e.g., services, value objects) here -->
         </fx:Declarations>
         <components:Component_C includeIn="first" x="220" y="275"/>
         <components:Component_D includeIn="second" x="2" y="0"/>
         <components:Component_E includeIn="third" x="0" y="8"/>
    </s:Group>
    For the record, I know this code does not work.  It has to do with the parent calls in Component B.  Comment out those lines, and the code will compile.

  • Accessing parent window form elements from a JSP file

    Actually I have a JSP page . It calls a popup function to load another JSP file on the event Onclick of a label. In the JSP file loaded on the popup window, I need to access the form elements of the parent.
    Eg: the Parent has a Textarea named "ta_1" in the form "appl_1".
    Now i cannot access this element in the child JSP page using,
    window.opener.document.ta_1.appl_1.value;
    The window.opener is not defined for this HTML page cos the HTML page was generated as an output of the JSP file.
    Please give a JSP code snippet which accesses the parent form element..

    Actually I have a JSP page . It calls a popup function to load another JSP file on the event Onclick of a label. In the JSP file loaded on the popup window, I need to access the form elements of the parent.
    Eg: the Parent has a Textarea named "ta_1" in the form "appl_1".
    Now i cannot access this element in the child JSP page using,
    window.opener.document.ta_1.appl_1.value;
    The window.opener is not defined for this HTML page cos the HTML page was generated as an output of the JSP file.
    Please give a JSP code snippet which accesses the parent form element..

  • Problem in accessing Parent Message ID in Enhanced Receiver determination

    Hello All,
    Following is the scenario.I have a source file and two target receivers.I need to access the Parent Message ID.I am using following code in an UDF.
    String headerField;
    java.util.Map map;
    // get runtime constant map
    map = container.getTransformationParameters();
    // get value of header field by using variable key
    headerField = (String) map.get("MessageId");
    return  headerField;
    But it is returning the message id for the second receivers.
    Any suggestions would be of gr8 help

    Check the description of MessageId.
    MESSAGE_ID
    The message ID. It can change during communication. Response messages get a new message ID.
    If new messages result from a message (the message is copied at multiple receivers), the new messages get new message IDs.
    Reffer this link : http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm

  • Can anyone explain the way to access parents?

    I just don't get it!
    I have
    var parent_mc:AdventCalendar=AdventCalendar(this.parent.parent)
    in a class file for a symbol who's parent's parent is AdventCalandar, so why on earth is it saying TypeError: Error #1009: Cannot access a property or method of a null object reference.  It's not null, it's there.  It's the stage's class file.  Please help someone!

    turns out there was no parent.parent even though I'm sure there shoudl be!

  • Accessing parent or sibling directories in Flex.

    Hello,
    For our project setup I have been asked to read a file from a sibling directory, something like ("../sibling/my-file"). Unfortunately my testing seems to indicate that this is impossible. Consider the following code:
    private function init() : void {
                    resultsArea.text += readDocFile("HelloWorld.txt") + "\n\n";
                    resultsArea.text += readDocFile("child/HelloWorld.txt") + "\n\n";
                    resultsArea.text += readDocFile("../HelloWorld.txt") + "\n\n";
                    resultsArea.text += readDocFile("../sibling/HelloWorld.txt") + "\n\n";
                public function readDocFile(fileName:String):String
                    var data:String = null;
                    try {
                        var file:File = File.applicationDirectory.resolvePath(fileName);
                        data = file.nativePath + " ";
                        data += String(file.exists) + " " + String(file.isDirectory) + " ";
                        var fileStr:FileStream = new FileStream();
                        fileStr.open(file, FileMode.READ);
                        data += fileStr.readUTFBytes(fileStr.bytesAvailable);
                    catch (error:Error) {
                        data += error.message;
                    return data;
    On the following file structure:
    ./.actionScriptProperties
    ./.flexProperties
    ./.project
    ./.settings
    ./.settings/org.eclipse.core.resources.prefs
    ./bin-debug
    ./bin-debug/child
    ./bin-debug/child/HelloWorld.txt
    ./bin-debug/FileTesting-app.xml
    ./bin-debug/FileTesting.swf
    ./bin-debug/HelloWorld.txt
    ./HelloWorld.txt
    ./libs
    ./sibling
    ./sibling/HelloWorld.txt
    ./src
    ./src/child
    ./src/child/HelloWorld.txt
    ./src/FileTesting-app.xml
    ./src/FileTesting.mxml
    ./src/HelloWorld.txt
    With this result:
    C:\eclipse\3.6.1_j2ee\workspace\FileTesting\bin-debug\HelloWorld.txt true false Hello adjacent
    C:\eclipse\3.6.1_j2ee\workspace\FileTesting\bin-debug\child\HelloWorld.txt true false Hello Child
    C:\eclipse\3.6.1_j2ee\workspace\FileTesting\bin-debug true true Error #3006: Not a file.
    C:\eclipse\3.6.1_j2ee\workspace\FileTesting\bin-debug true true Error #3006: Not a file.
    We can see that that everything after the "../" in the path structure is being ignored. I've tried variants using the parent property of the File.applicationDirectory without success.
    If someone could point me to some documentation that confirms that I cannot access a parent directory or otherwise let me know what I am doingwrong it would be greatly appreciated.
    Thanks,
    Philip

    More interesting discoveries:
    private function init() : void {
                    //Works
                    resultsArea.text += readDocFile("HelloWorld.txt") + "\n\n";
                    //Works
                    resultsArea.text += readDocFile("child/HelloWorld.txt") + "\n\n";
                    //Works
                    resultsArea.text += readDocFile("child/../child/HelloWorld.txt") + "\n\n";
                    //Fails
                    resultsArea.text += readDocFile("../HelloWorld.txt") + "\n\n";
                    //Fails
                    resultsArea.text += readDocFile("../sibling/HelloWorld.txt") + "\n\n";
                    //Works
                    resultsArea.text += readDocAbsolute("C:\\eclipse\\3.6.1_j2ee\\workspace\\FileTesting\\sibling\\HelloWorld.txt ") + "\n\n";
                    //Works
                    resultsArea.text += readDocCheating("../sibling/HelloWorld.txt") + "\n\n";
                    //Works
                    resultsArea.text += readDocFinal("../sibling/HelloWorld.txt") + "\n\n";
                public function readDocFile(relativePath:String):String
                    var data:String = null;
                    try {
                        var file:File = File.applicationDirectory.resolvePath(relativePath);
                        data = file.nativePath + " ";
                        data += String(file.exists) + " " + String(file.isDirectory) + " ";
                        var fileStr:FileStream = new FileStream();
                        fileStr.open(file, FileMode.READ);
                        data += fileStr.readUTFBytes(fileStr.bytesAvailable);
                    catch (error:Error) {
                        data += error.message;
                    return data;
                public function readDocCheating(relativePath:String) : String {
                    var data:String = null;
                    try {
                        var basePath:String = File.applicationDirectory.nativePath;
                        var file:File = new File(basePath + "/" + relativePath);
                        data = file.nativePath + " ";
                        data += String(file.exists) + " " + String(file.isDirectory) + " ";
                        var fileStr:FileStream = new FileStream();
                        fileStr.open(file, FileMode.READ);
                        data += fileStr.readUTFBytes(fileStr.bytesAvailable);
                    catch (error:Error) {
                        data += error.message;
                    return data;
                public function readDocAbsolute(absolutePath:String) : String {
                    var data:String = null;
                    try {
                        var file:File = new File(absolutePath);
                        data = file.nativePath + " ";
                        data += String(file.exists) + " " + String(file.isDirectory) + " ";
                        var fileStr:FileStream = new FileStream();
                        fileStr.open(file, FileMode.READ);
                        data += fileStr.readUTFBytes(fileStr.bytesAvailable);
                    catch (error:Error) {
                        data += error.message;
                    return data;
                public function readDocFinal(relativePath:String ) : String {
                    var data:String = null;
                    try {
                        var baseFile:File = new File(File.applicationDirectory.nativePath);
                        var file:File = baseFile.resolvePath(relativePath);
                        data = file.nativePath + " ";
                        data += String(file.exists) + " " + String(file.isDirectory) + " ";
                        var fileStr:FileStream = new FileStream();
                        fileStr.open(file, FileMode.READ);
                        data += fileStr.readUTFBytes(fileStr.bytesAvailable);
                    catch (error:Error) {
                        data += error.message;
                    return data;
    Where those calls denoted as "works" in the init method work as expected. I think I've come to the conclusion that the static file instances are "special" and their parenting works differently from files I create myself.

  • Access Parent Page Binding From Region

    Hello
    I'm using JDev 11.2 and i have a task flow which I call from a parent page- and to pass parameters to it.
    Is there a way for me to access the parent page bindings from a region in the taskflow?
    Thanks for you time
    Talya

    You shouldn't be directly accessing a containing page values from a task flow. This will create a situation where your task flow is only usable in a single page.
    Instead define parameters to your task flow and pass those from the containing JSF.

  • Access parent class?

    I'm just wondering if there's some way to access the class that instantiates a class from the instantiated class. Say if I had a class that has a Vector and creates a bunch of other classes that are added to the Vector. Is it possible for the instances of the class to access the Vector? I realize that this is poor OO, but I was just wondering if Java has some way of making this work, or if this just has "rethink idea" all over it... Thanks for your time.

    You can pass a reference variable pointing at the parent to the child object and store it there. Via this pointer you can reach the parent. It's common practice. This for example will print "parent". The parent just let go of the child but the child holds a reference to its parent,
    class Child {
       Parent parent;
       public Child (Parent p) {
          parent = p;
          parent.print();
    class Parent {
       public Parent () {
           new Child(this);
       public void print() {
          System.out.println("Parent");
    Parent p = new Parent();

  • Accessing parent function from class

    Hey guys
    I have a .fla file with some code in the actions panel.
    A bit of code calls a function in a class from the actions panel
    The function in the class is run, but I want to be able to call a function in the main actions panel code from the function in that class
    The class doesn't extend anything so (parent as MovieClip).function() does not work
    Any ideas?
    Thanks
    Chris

    if you're trying to reference code attached to a timeline, your class will need a displayobject reference.  you can pass it a reference when instantiating a class object:
    // on a timeline:
    var c:YourClass=new YourClass(this);  // code your constructor to accept this movieclip reference.
    you can then use that reference to access code in any timeline (that exists when trying to reference):
    private var tl:MovieClip;  // import the mc class.
    public funciton YourClass(mc:MovieClip){
    tl=mc;

  • Problem Accessing Parental Control Sheet in Accounts Pref Pane

    I have two computers, a B&W G3 and an AGP G4 Gigabit Ethernet (yes, I know they are old, but they work!), both experiencing the same problem after the latest Security Update 2008-008.
    I have several user accounts on both machines. I am attempting to change parental controls to enable some accounts to have access to a new application.
    1) I go to System Preferences > Accounts.
    2) I click the lock icon and type an administrator name and password.
    3) I select the user account I want and click Parental Controls.
    4) When I click on the parental controls tab, the tab turns gray but doesn't change the screen. If I press the space bar, the window finally changes, but shows only Mail and I can't even configure that.
    5) Clicking on the System Preferences icon in the Dock, I can select another prefpane to load, and it will switch to that pref pane if I select it.
    6) This happens for EVERY account on the machine except the administrator account.
    7) Looking at Console.app while going through this process, there is a looooong string of information about AppKit errors originating from System Preferences.app. I'm on my work computer right now, and so cannot copy and paste this info.
    Other than a compelte archive and reinstall, does anybody know what's going on here, and how to solve it?

    Ok, thanks for the problem solving steps. Before I begin those, though, let me just paste the console output for this error here:
    2009-02-06 17:17:32.807 Safari[189] * Illegal NSTableView data source (<HTArrayController: 0x1b9f3d0>[object class: NSMutableDictionary, number of selected objects: 0]). Must implement numberOfRowsInTableView: and tableView:objectValueForTableColumn:row:
    2009-02-06 17:17:32.813 Safari[189] * Illegal NSTableView data source (<HTArrayController: 0x1ba09b0>[object class: NSMutableDictionary, number of selected objects: 0]). Must implement numberOfRowsInTableView: and tableView:objectValueForTableColumn:row:
    2009-02-06 17:17:32.817 Safari[189] * Illegal NSTableView data source (<HTArrayController: 0x1ba11f0>[object class: NSMutableDictionary, number of selected objects: 0]). Must implement numberOfRowsInTableView: and tableView:objectValueForTableColumn:row:
    2009-02-06 17:17:39.747 Safari[189] Warning: Instances of type NSURLConnection do not respond to _initWithRequest:delegate:usesCache:maxContentLength:startImmediately:
    2009-02-06 17:17:39.785 Safari[189] SafariBlock checking for updates.
    Debugger() was called!
    2009-02-06 17:23:39.750 System Preferences[192] Could not connect the action limitMatrixAction: to target of class AppController
    2009-02-06 17:23:39.754 System Preferences[192] * Illegal NSOutlineView data source (<AppController: 0x4f1c70>). Must implement outlineView:numberOfChildrenOfItem:, outlineView:isItemExpandable:, outlineView:child:ofItem: and outlineView:objectValueForTableColumn:byItem:
    2009-02-06 17:23:39.755 System Preferences[192] Could not connect the action canUseApplications: to target of class AppController
    2009-02-06 17:23:39.756 System Preferences[192] Could not connect the action checkAllApplications: to target of class AppController
    2009-02-06 17:23:39.756 System Preferences[192] Could not connect the action uncheckAllApplications: to target of class AppController
    2009-02-06 17:23:39.756 System Preferences[192] Could not connect the action locateApplication: to target of class AppController
    2009-02-06 17:23:39.757 System Preferences[192] Could not connect the action accessSystemPreferences: to target of class AppController
    2009-02-06 17:23:39.757 System Preferences[192] Could not connect the action toggleApplication: to target of class AppController
    2009-02-06 17:23:39.757 System Preferences[192] * Illegal NSOutlineView data source (<AppController: 0x4f1c70>). Must implement outlineView:numberOfChildrenOfItem:, outlineView:isItemExpandable:, outlineView:child:ofItem: and outlineView:objectValueForTableColumn:byItem:
    2009-02-06 17:23:39.758 System Preferences[192] Could not connect the action checkAllApplications: to target of class AppController
    2009-02-06 17:23:39.759 System Preferences[192] Could not connect the action uncheckAllApplications: to target of class AppController
    2009-02-06 17:23:39.759 System Preferences[192] Could not connect the action locateApplication: to target of class AppController
    2009-02-06 17:23:39.759 System Preferences[192] Could not connect the action toggleApplication: to target of class AppController
    2009-02-06 17:23:52.983 System Preferences[192] LSFindApplicationForInfo didnt fill out URL for com.apple.ichat (-10814)
    2009-02-06 17:23:53.111 System Preferences[192] * -[AppController preloadWithManager:]: selector not recognized [self = 0x4f1c70]
    2009-02-06 17:23:53.132 System Preferences[192] * -[AppController preloadWithManager:]: selector not recognized [self = 0x4f1c70]
    2009-02-06 17:23:56.236 System Preferences[192] * -[AppController preloadWithManager:]: selector not recognized [self = 0x4f1c70]
    2009-02-06 17:23:56.237 System Preferences[192] * -[AppController preloadWithManager:]: selector not recognized [self = 0x4f1c70]
    2009-02-06 17:23:56.292 System Preferences[192] * -[AppController state]: selector not recognized [self = 0x4f1c70]
    2009-02-06 17:23:56.293 System Preferences[192] * -[AppController state]: selector not recognized [self = 0x4f1c70]
    2009-02-06 17:24:01.808 System Preferences[192] * -[AppController state]: selector not recognized [self = 0x4f1c70]
    2009-02-06 17:24:01.809 System Preferences[192] * -[AppController state]: selector not recognized [self = 0x4f1c70]

  • How to access Parent page UIComponent from inlineFrame using ADF javascript

    Hi,
    My application includes an <af:inlineFrame component on the top portion of the page. It contains a table with delete option for the end user. Requirement is after user has deleted all the records of the table and table has no records to display, inlineFrame needs to be made invisible so that the bottom portion content of my page will get stretched fully and has more visibility to the user. Hence when user click on Delete button of the table, after delete operation, I am planning to check the row count and write javascript to client using ExtendedRenderKitService to make the inlineframe invisible.
    Question:
    1. What is the right ADF javascript API to access the parent page and work with its components. I came to know we can call using 'parent.document.getElementById' but I want to know correct ADF's javascript API.
    Thanks in Advance
    Raghu

    The way you suggested didn't help me.
    Yes.. This inlineFrame content is also a part of the same application only. The reason why it is kept in inlineFrame is it is an ADS implemented table. ADS is able to push the data to the table provided we should keep the application idle. If I keep on working with the application (i.e. request/response happens because user works with the bottom portion content of the page), ADS is not able to push the data to UI. Keeping the ADS implemented table in a top portion still but inside an inlineFrame has solved this problem.
    Given below my page design
       main.jspx
       ======
       <af:form id="f1"....
           <af:inlineframe source="faces/page/employee.jspx" />
       </form>
       employee.jspx
       =========
       <af:form id="f2"
        </form>
                 In the employee.jspx only I have delete button and javascript which is suppose to find the parent page (i.e. main.jspx) and to work with inlineframe component to make it visible/invisible based on whether table gets records or no records. (This javascript call will happen with the help of ClientListener set for the ADS implemented table with event type as propertyChange) Intention is to check the row count of the table during every javascript call and to go to parent page, find the inlineframe, make it visible or invisible.
    Edited by: Raguraman on 25-Jan-2013 08:59

  • How to access parent document from Java listener

    I have two applications, let's call them Gantt and Activity List. The Gantt application is an ADF application. The Activity List application is not. The Gantt application is hosted inside an <iframe> in the Activity List application. There is an input text entry field with ID "unassignedTaskId" in the Activity List application.
    In the Gantt application, when the user clicks a button, there's a Java "listener" method in a bean. In this Java code, I want to access the value in that "unassignedTaskId" field and use it. How can I do that? JavaScript will not work for me in this case. I can access the UIViewRoot which is the top-level component in my page, but how do I get that one more level up, into the owner of the <iframe>, from the listener Java code?
    I am using JDeveloper 11.1.1.0.2. Any advice appreciated.

    I found a way to achieve what I want. I finally realized (I don't know why it took me so long) that the Java code was server code and that the UIViewRoot is sort of a copy of what is in the "real" DOM. Of course I can't get to the outer frame. Duh!
    Once that finally clicked, I looked around and rediscovered clientListeners. I added a Javascript function getUnassignedTaskId(event) to get the value from the parent app and copy it into a hidden component in my app. Then I added an af:clientListener to my button to call this function. The clientListener gets called before the actionListener. So first the client side JavaScript copies the value from the parent app to my ADF app's hidden control, then the server side Java code can see it via the hidden control and its backing bean. Problem solved!

  • Access Parent Context of PCD object

    Hi
    I am trying to access the PCD via JNDI. I basically need to search the PCD for any iViews that contain a certain property. This bit is working fine. However, I now need to be able to retrieve the parent context (i.e. a Page) so that I can then retrieve a particular property from the page (as long as it is a page). Therefore, does anyone know how to get the parent IPcdContext of the current iview or even getting the IPortalPage object that the iview is on.
    Thanks
    Darrell
    Message was edited by: Darrell Merryweather

    Hi Darrell Merryweather,
    Daniel is exactly correct and i implement this as well.
    To explain more about Daniel's solution..
    See this code..
    Hashtable env = new Hashtable();
    env.put(IPcdContext.SECURITY_PRINCIPAL, request.getUser());
    env.put(Context.INITIAL_CONTEXT_FACTORY,IPcdContext.PCD_INITIAL_CONTEXT_FACTORY);
    env.put(com.sap.portal.directory.Constants.REQUESTED_ASPECT, PcmConstants.ASPECT_SEMANTICS);
    InitialContext ctx = null;
    DirContext dirCtx;
    List pageList = null;
    try {
         ctx = new InitialContext(env);
    // Pass the iView location here...as Daniel said..
         dirCtx =(DirContext) ctx.lookup("pcd:portal_content/myFolder/myRole/myPage/");
         PcdSearchControls pcdSearchControls = new PcdSearchControls();
         pcdSearchControls.setReturningObjFlag(false);
         pcdSearchControls.setSearchScope(PcdSearchControls.SUBTREE_WITH_UNIT_ROOTS_SCOPE);
         dirCtx.addToEnvironment(Constants.APPLY_ASPECT_TO_CONTEXTS,Constants.APPLY_ASPECT_TO_CONTEXTS);
         NamingEnumeration ne =  dirCtx.search("","(com.sap.portal.pcd.gl.ObjectClass=com.sapportals.portal.page)",
         pcdSearchControls);
         pageList = new ArrayList();
         int i = 0;
         while (ne.hasMoreElements()) {
              i++;
              IPcdSearchResult searchResult =
                   (IPcdSearchResult) ne.nextElement();
              // This location will give you the full path of the page with page name
              String location = "pcd:portal_content/myFolder/myRole/myPage/" + searchResult.getName();
              pageList.add(location);
    } catch (NamingException e) {
         throw new NamingException();
    }catch (Exception e) {
         throw new Exception();
    Regards,
    Karthick

Maybe you are looking for

  • HT6337 sms forward not working on macbook pro

    I am using an iPhone 5 running iOS 8.1and a macbook pro late 2011 model running OS X 10.10. I am able to call from my macbook pro but i am not able to send an sms. When i go to settings>messages>text message forwarding I can see my Macbook pro's name

  • How do I set up my external HD?

    I've just received my Western Digital "My Book" external hard drive. I plugged it in and the first thing it asked me was if I'd like to use it with Time Machine. I clicked "decide later", because I'm not exactly sure. The thing is, I WOULD like to us

  • Scheduling in Real-Time Java

    Hello, I have some questions concerning how scheduling in fact is intended to be performed in a RTSJ based Real-Time Java System. As far as I understood, RTSJ requires pre-emptive priority-based dispatching of Schedulable objects. This means that the

  • Performance of update query for single column vs multiple column

    Hi All, I could not find any answer for this, does it ever matter in terms of performance updating single column versus multiple column in a single update query. For eg. table consisting of 15 columns, what would be the difference in performance when

  • Mic not working in audio creation m

    hey all, just bought my x-fi platinum and I got it home and tried to do some vocal recording. my mic is a labtec desktop mic w/ noise canceling that I would like to use to record my podcasts with and it's plugged into the line in2/mic 2 port on the f