SubCommunity Navigation (return to parent)

(version: Foundation G6 )I have created a customized header using adaptive tags (utilizing the provided header.html as a guide). One thing that seems to be missing from that guide is the button that shows up in the default navigation that allows the user to return to the Parent community (it shows up next to the "Related Communities" tab and has an image of an upwards pointed arrow).
What do I have to do to add that functionality to my custom navigation?
Thanks.

I see what you mean. Unfortunately this is not possible without customizing the tag code or some javascript hacking. Each menu tab has a unique ID, so you could add an eventhandler on the parent community tag and set the action to redirect to the parent community.
The goal for the adaptive navigation tags were to be generic navigation building blocks, while the horizontal menu in 5.x were made for specific usecases and in the conversion, the go to parent community button was removed.

Similar Messages

  • How can I exit a collection window and return to parent folder?

    I would "love" to have a place where I could ask the simple questions like this that come up and seem so simple to those who know, they don't mention the details I need like how to close a working collection window and move back to the parent folder of that collection.
    I've been stuck for two days (it happened before) in a window (library module) with a collection of 8 photos.  I cannot find any way to close that window or go back to the library collection of hundreds of photos from which it was chosen.  It's very frustrating to be stuck in this window, perhaps forever?
    How do I close these windows.  Isn't there a "back" button?
    I started in Photoshop 3, then 5, then 7, then stopped renewing due to difficulty learning PS until the Adobe CC became available with the many tutorials.  It was great learning how to make a collection, but the tutorials didn't mention how to get back to the main folder where the collection was chosen.  So again, I"m stuck at an even lower level of functioning than with photoshop alone.
    I had to copy a photo and open it separatly in Photoshop just to be able to work on it.  Yesterday I could "edit in Photoshop cc" with right click.  Today, it won't even do that.
    I suspect now two things are working to prevent me from working properly on my photos but have no clue how to fix this.

    In the library module, left-hand panel, there are different sections or tabs. Collections is one of those tabs near the bottom out that panel. If you scroll up in that panel you should see other sections, one of which is "Folders". If that isn't showing, then right-click on the Collections section heading and make sure there are checkmarks in the sections that you want to have displayed. To return to the folder you need to go to the folders section and find the folder in your list.
    Another way to return to a folder is to click in the area in this illustration:
    Doing so will present a list of folders that you have recently been inside of. You can click on one of those folders and return directly to it.

  • Return to Parent retaining Cache

    Hello,
    I have a requirement, when i click on link it will open new page by keeping current page as it is.( I have done it using "Target Frame =_blank").
    In second page i am querying and getting one value, this is always single value.
    This is similar to LOV(on click open new page, query , and return to item in parent page)
    Problem:
    Now, i want to return this value to First page(or parent page from which second page was called).
    If i do for forwardimmediately it will open new page, instead i want it to return to first page.
    IMPORTANT is that, if this page reloads i will lose data which are entered.
    How can i do it?
    Please help.

    Keerthi,
    I'm facing a problem.
    1. PAGE A --> PAGE B
    on click "find" button, page A calls page B. some query is done, value is fetched.
    page A is retained and page B opens in new tab.(using Target Frame = _blank)
    2. PAGE B --> PAGE A
    On click of "select" button, value needs to be sent to page A.
    Problem:
    If i fill Destination URI and send data, problem is, it is opening PAGE A again, (so there will be 2 Page A) also TextInputBean value is lost in New Page.
    How can i send value to actual page A (one that actually called page B)
    Please help.

  • Return to parent page in oaf

    Hi All,
    I have created a custom OAF page and linked the same with 3 standard OAF pages(Lets say Standard-Page1, Standard-Page2, Standard-Page3) in such a way that whenever I click the GO button in any of those standard pages it navigates to my custom page.
    As of now when I click the BACK button in the custom page it navigates back to Standard-page1(Because i have given the page1 Path in the pageContext.ForwardImmediately) only even though if I would have opened my custom page from standard-Page2 or 3.
    I need to understand what should I do to navigate back to the exact standard page from which the custom page has been opened.
    Any help on this would be greatly appreciated.
    Many thanks in advance!
    Kind Regards,
    Myvizhi

    Please ask OAF question on the {forum:id=210}
    Timo

  • 11g Forms Tab-Page Navigation

    I am using Forms 11g on Solaris.
    A main navigator form opens another form which has a content canvas, tab-page canvas and (3) stacked canvases.
    The problem I am having is with tab-page navigation.     CTRL+TAB ( next ) and CTRL+SHIFT+TAB ( previous )
    As long as I do not initiate navigation from an item on a stacked canvas, navigation is as expected ( between tab pages only ).
    However, navigating from an item within a stacked canvas causes navigation to the parent form.
    Repeating the tab navigation keys from the parent form returns to the called form.
    Note that both key-combinations simply toggle back and forth.
    I have found no documentation on tab-page navigation so any help / insight is greatly appreciated !
    Mike

    Hi Soofi !
    Changing block order in the called form does not affect the navigation between tab pages.
    Note in my question that the resulting undesired navigation is to and from the calling form ( which only has one block ).
    Navigation between items and blocks works as expected.
    To reiterate -
         The only navigation that fails is when I attempt to CTRL+TAB or CTRL+SHIFT+TAB to another tab page from within an item on a stacked canvas.
         Attempting this navigation results in moving the cursor focus to the calling form.
         Repeating the attempt from the calling form moves back to the called form.
         None of your methods mention navigation between forms .
    Thanks for your interest.

  • Taskflow and Return Button

    Hello,
    I have a bounded taskflow, which has several train stops. I would like to have a back button in each train stop page, which should return to the main page (unbounded task flow entry).
    Is this an acceptable solution, or there is some other way of restarting the whole process?
    Thanks!

    User, please always tell us your jdev verison.
    You can add a parent action to the task flow which hosts the train stops, set the parent outcome to 'back'. Then you add normal navigation to the parent action (name them all 'back'). In each of your train stops you add a button which you use to navigate to the parent action.
    In the unbounded Task flow you add a wild card navigation to the page you like to get back to from the train. Name the navigation 'back'.
    Now, when you hit the back button in one of the train stops you get back to the page the wild card rule is pointing to.
    Timo

  • How can I figure out the parent of a thread???

    Hey guys!!!
    I have a tiny question!!
    I have a thread which could be run by 1 of 2 different parents.
    So my idea was to set a variable...for example int a...and initialize it with 1 for the first parent and with 2 for the seond...then in the thread I make if...else...and whether a is 1 or 2 I know who the parent is.
    So what I wanna know is:
    Is there a method which can figure out who of those 2 the parent started the thread without using a variable???
    cheers,
    Tom

    You code do that or if both parents implement some
    interface, call it parentInterface have them pass them selfs in ... and the thread store that as part of its context.
    Then provide a method call it getParent which returns that parent object. And even a getParentName.
    interface parentInterface
      public String getName();
    } // parentInterface
    class myThread extends Thread
      public myThread(parentInterface pi)
        pInterface = pi;
      } // myThread
      public String getParentName()
          return pInterface.getName();
      } // getParentName
      parentInterface pInterface = null;
    } // myThread
    class parent1 implements parentInterface
    } // parent1
    class parent2 implements parentInterface
    }  // parent2

  • Parent-Child Unbound Transformation from Linear Structure

    Hi ,
    We need to convert the linear people structure into Parent-Child relation with unbounded depth using XQuery. To give in detail, we have the XML schema as
    <?xml version="1.0" encoding="UTF-8"?>
    <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/ParentChild" xmlns:tns="http://www.example.org/ParentChild" elementFormDefault="qualified">
    <complexType name="People">
    <sequence>
    <element name="id" type="string" />
    <element name="name" type="string" />
    <element name="age" type="string" />
    <element name="parentId" type="string" minOccurs="0" />
    </sequence>
    </complexType>
    <complexType name="Peoples">
    <sequence>
    <element name="people" type="tns:People" maxOccurs="unbounded"></element>
    </sequence>
    </complexType>
    <element name="Peoples" type="tns:Peoples"></element>
    <element name="People" type="tns:People"></element>
    <complexType name="Parent">
    <sequence>
    <element name="id" type="string" />
    <element name="name" type="string" />
    <element name="age" type="string" />
    <element name="child" type="tns:Parent" minOccurs="0" maxOccurs="unbounded" />
    </sequence>
    </complexType>
    <complexType name="Parents">
    <sequence>
    <element name="Parent" type="tns:Parent" maxOccurs="unbounded" ></element>
    </sequence>
    </complexType>
    <element name="Parents" type="tns:Parents"></element>
    <element name="Parent" type="tns:Parent"></element>
    </schema>
    The input structure can appear as
    <?xml version="1.0"?>
    <ns0:Peoples xmlns:ns0="http://www.example.org/ParentChild">
    <ns0:people>
    <ns0:id>1</ns0:id>
    <ns0:name>x</ns0:name>
    <ns0:age>11</ns0:age>
    <ns0:parentId>2</ns0:parentId>
    </ns0:people>
    <ns0:people>
    <ns0:id>2</ns0:id>
    <ns0:name>y</ns0:name>
    <ns0:age>11</ns0:age>
    <ns0:parentId>3</ns0:parentId>
    </ns0:people>
    <ns0:people>
    <ns0:id>3</ns0:id>
    <ns0:name>z</ns0:name>
    <ns0:age>11</ns0:age>
    </ns0:people>
    <ns0:people>
    <ns0:id>5</ns0:id>
    <ns0:name>a</ns0:name>
    <ns0:age>11</ns0:age>
    </ns0:people>
    </ns0:Peoples>
    The response should be like below
    <?xml version="1.0"?>
    <ns0:Parents xmlns:ns0="http://www.example.org/ParentChild">
    <ns0:Parent>
    <ns0:id>3</ns0:id>
    <ns0:name>z</ns0:name>
    <ns0:age>11</ns0:age>
    <ns0:child>
    <ns0:id>2</ns0:id>
    <ns0:name>y</ns0:name>
    <ns0:age>11</ns0:age>
    <ns0:child>
    <ns0:id>1</ns0:id>
    <ns0:name>x</ns0:name>
    <ns0:age>11</ns0:age>
    </ns0:child>
    </ns0:child>
    </ns0:Parent>
    <ns0:Parent>
    <ns0:id>5</ns0:id>
    <ns0:name>a</ns0:name>
    <ns0:age>11</ns0:age>
    </ns0:Parent>
    </ns0:Parents>
    We tried with below XQuery, but it is not resulting as expected.
    (:: pragma bea:global-element-parameter parameter="$peoples" element="ns0:Peoples" location="ParentChild.xsd" ::)
    (:: pragma bea:global-element-return element="ns0:Parents" location="ParentChild.xsd" ::)
    declare namespace ns0 = "http://www.example.org/ParentChild";
    declare namespace xf = "http://tempuri.org/RecursiveParentChild/ParentChild/";
    declare function xf:ParentChild($peoples as element(ns0:Peoples))
    as element(ns0:Parents) {
    <ns0:Parents>
    let $results := <a>{
         for $people1 in $peoples/ns0:people where (not (exists ($people1/*:parentId)))
         return
         <ns0:Parent>
                                  <ns0:id>{ data($people1/ns0:id) }</ns0:id>
                        <ns0:name>{ data($people1/ns0:name) }</ns0:name>
                        <ns0:age>{ data($people1/ns0:age) }</ns0:age>
                             </ns0:Parent>
                   </a>
                   let $result1 :=
                   for $people1 in $peoples/ns0:people where (exists ($people1/*:parentId))
                   return
                        if (data($people1/ns0:parentId) = data($results/ns0:id)) then
                             <ns0:child>
                                  $people1/*
                             </ns0:child>
                        else()
                   return $result1      
    </ns0:Parents>
    declare variable $peoples as element(ns0:Peoples) external;
    xf:ParentChild($peoples)
    Anyone tried similar kind of XQuery?. THere is a possibility that the child node can appear before the parent node, how we can handle that as well?
    Any help on this is appreciated
    Regards
    Venkata Madhu

    You need a recursive function in this situation :
    declare namespace ns0 = "http://www.example.org/ParentChild";
    declare namespace xf = "http://tempuri.org/RecursiveParentChild/ParentChild/";
    declare variable $peoples as element(ns0:Peoples) external;
    declare function xf:getChildren($p as element(ns0:people)) as element(ns0:child)*
      for $c in $peoples/ns0:people[ns0:parentId=$p/ns0:id]
      return <ns0:child>
            <ns0:id>{ data($p/ns0:id) }</ns0:id>
            <ns0:name>{ data($c/ns0:name) }</ns0:name>
            <ns0:age>{ data($p/ns0:age) }</ns0:age>
            { xf:getChildren($c) }
             </ns0:child>
    <ns0:Parents>
      for $p in $peoples/ns0:people[not(ns0:parentId)]
      return <ns0:Parent>
            <ns0:id>{ data($p/ns0:id) }</ns0:id>
            <ns0:name>{ data($p/ns0:name) }</ns0:name>
            <ns0:age>{ data($p/ns0:age) }</ns0:age>
            { xf:getChildren($p) }
             </ns0:Parent>
    </ns0:Parents>

  • Filteredtreemodel, how to hide parent nodes if no children

    hi. i have surfed and read a lot of posts and topics here regarding filteredtreemodel. some i found hard to understand so i chose to use NiceGuy1's code from long ago since it's the easiest to understand.
    package test;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.tree.DefaultTreeModel;
    import javax.swing.tree.TreeNode;
    import java.util.ArrayList;
    import java.util.Enumeration;
    public class FilteredTreeModel extends DefaultTreeModel {
        // this hashmap gets the list of pdf files and the filter status
        private String filterText;
        private DefaultMutableTreeNode orig_root;
        public FilteredTreeModel(DefaultMutableTreeNode root) {
            super(root);
            orig_root = root;
        public void setFilterText(String s) {
            this.filterText = s;
            reload();
        public String getFilterText() {
            return this.filterText;
        @Override
        public Object getChild(Object parent, int index) {
            return getFilteredChildren(parent).get(index);
        @Override
        public int getChildCount(Object parent) {
            return getFilteredChildCount(parent);
        @Override
        public int getIndexOfChild(Object parent, Object child) {
            return getFilteredChildren(parent).indexOf(child);
        private int getFilteredChildCount(Object parent) {
            return getFilteredChildren(parent).size();
        private ArrayList<TreeNode> getFilteredChildren(Object parent) {
            ArrayList<TreeNode> filteredChildren = new ArrayList<TreeNode>();
            DefaultMutableTreeNode parentNode = null;
            parentNode = (DefaultMutableTreeNode)parent;
            for (Enumeration e=parentNode.children(); e.hasMoreElements();) {
                DefaultMutableTreeNode nextNode = (DefaultMutableTreeNode) e.nextElement();
                DefaultMutableTreeNode dummy = null;
                  if (nextNode.children().hasMoreElements()) {
                      filteredChildren.add(nextNode);
                } else {
                    // if node is leaf node
                    if (filterText == null ) {
                        // add right away if no filter
                        filteredChildren.add(nextNode);
                    } else {
                        // if filter matches this leaf node, add it. if not, how to check if
                        // parent nodes have empty children and remove it.
            return filteredChildren;
    }i havent had luck the whole day trying to make this work. it seemed that once the filteredChildren.add() is called, it gets rendered to the treecellrenreder right away so if i wnat to remove the parents (in case it has no children based on the filter),the parent nodes will stay put in the jtree. any workaround? or ideas? i dont want to use a different defaulttreemodel for this. i want to avoid that because i have lots of nodes in my jtree.

    Looks like you need this:
    for (Enumeration e=parentNode.getFilteredChildren(); e.hasMoreElements();) Edit: okay, that was just a quick guess. Actually you're going to get into trouble if you try to recursively suppress nodes with no children. First you suppress all the leaf nodes (because they naturally don't have any children). Then you suppress all of their parents, because now they don't have any unsuppressed children. Then you suppress all of the parents' parents, because now they don't have any unsuppressed children... and so on until you only have the root left. So you need to refine that requirement.
    But I get what you're saying. I had to do a similar thing, only I didn't use a FilteredTreeModel, I just built the TreeModel based on a selection from another tree. It's ridiculously hard to do when you don't get the nodes in order from the database, too, but that's a different problem.

  • Bind Variable Brain Teaser - Accessing a filtered Parent from a Child

    Hi Guys and Gals,
    Using JDev 11.1.2.4.0.
    I have two tables, the parent(Scenarios) and the child (Orders).  They are setup as such:
    SELECT Scenarios.SCENARIO_ID,
                   Scenarios.NAME,
                   Scenarios.COMPANY_ID
    FROM SCENARIOS Scenarios
    WHERE Scenarios.SCENARIO_ID = :pScenarioId
    ORDER BY Scenarios.SCENARIO_ID
    SELECT Orders.ORDER_ID,
                   Orders.COMPANY_ID
    FROM ORDERS Orders
    Scenarios (The Parent) has a required bind variable which filters on the primary key, SCENARIO_ID.  The primary key for the Orders table is Order_ID.  The two tables are joined by an association & view link on COMPANY_ID, setup as a 1-to-* relationship.  However, it is in fact a *-to-* relationship since an Order row can appear in several scenarios.
    In the Orders View Object, I also have a transient attribute, ScenarioInfo, which attempts to access Scenarios's current row to retrieve the name.  The getter is as such:
    public BigDecimal getScenarioInfo() {
         Row row = this.getScenariosView();
         DBSequence db = ((ScenariosViewRowImpl)row).getScenarioId();
         return new BigDecimal(db.getValue());
    The sequence of events:
    1) Open the application module and click on the view link between Scenarios and Orders.  A window pops open asking for the bind variable (pScenarioId) value.  I enter a valid value (2) and hit enter.  This should (in theory) return only one row for the Scenarios view object, the one with the ScenarioId of 2.  Clicking only on the Scenarios view object in the application module verifies this.  The Orders view object then renders, but an error message is displayed attempting getScenarioInfo()
    (oracle.jbo.AttrValException) JBO-27019: The get method for attribute "ScenarioInfo" in Orders cannot be resolved.
    I'm not sure I understand why.  ScenarioId with a value of 2 is a valid number.  With the bind variable / filter in place there should be one row as the parent, turning the relationship into a 1-to-*.  Without the filter in place, I may access the parent without error, but the record that is pulled back is the first possible row due to the 1-to-* relationship.
    Instead of having a bind variable, I have also tried implementing a View Criteria in the app module for the Scenarios view object.  However, the criteria doesn't seem to "stick" when the this.getScenariosView() is called from the Orders view.  It also pulls back the first row.
    Does anyone have any ideas?  The only thing I can think of would be to change the relationship to a *-to-* through a translation table, but that's a complication I do not wish to add if possible.
    Thanks in advance,
    Will

    Here is an alternate approach.  This one removes the bind variable from the Scenarios query and instead implements the following code in the app module impl.
        public void refreshScenario() {
            ViewObjectImpl allScenarios = this.getAllScenarios();
            VariableValueManager manager = allScenarios.getVariableManager();
            manager.setVariableValue("pScenarioId", new BigDecimal(2));
            ViewCriteriaManager criteriaManager = allScenarios.getViewCriteriaManager();
            ViewCriteria vc = criteriaManager.getViewCriteria("ScenariosViewCriteria");
            criteriaManager.applyViewCriteria(vc);
            allScenarios.executeQuery();
    The getter is the same as my second getter example:
        public String getScenarioInfo() {
            // remove the default getter for the transient string variable ScenarioInfo
            // return (String) getAttributeInternal(SCENARIOINFO);
            // get the view link accessor for the parent row, Scenarios
            ScenariosViewRowImpl row = (ScenariosViewRowImpl)this.getScenariosView();
            // This should return 1 row, which would be the row remaining after filtering by the bind variable with a value of 2
            // Get that rows Name attribute
            String s = row.getName();
            return s;
    I run the app module tester and then run the refreshScenarios() method.  I then double-click the view link which pops up a dialog box.  The bind variable pScenarioId is pre-filled with 2.  I click enter a receive the following unexpected output as seen here: http://www.williverstravels.com/JDev/Forums/Threads/11077337/ViewCriteriaAttempt.jpg
    As you can see, the ScenarioInfo column returns "#1" when it should return the parent's Name, which would be "#2".  I am a little confused as to why this is functioning this way.

  • Component initialization when used by parent component

    Hi everybody
    I have 'parent' and 'child' components.
    View V1 belongs to child and, upon receiving an inplug, performs a specific view controller method InitView performing activities such as executing controller methods to populate its context depending on the plug parameters.
    V1 belongs to Window W1 as default view.
    child is used in parent component and the child W1 interface view is used in a navigation step in parent.
    Parent view V2 should fire an outbound plug towards the W1 interface view which should handle the related inbound plug calling V1's InitView method.
    In order to achieve this, I assume I should declare V1 view controller as required controller in W1 interface view controller. However this is not possibile afaik.
    Any suggestion? Should I move the InitView method within the child component/custom controller?
    Thanks
    Vincenzo

    Hi,
    how does the page source look ?
    Frank

  • Return parnt name in CS3

    var myDoc=app.activeDocument;
    var imageBox=myDoc.layoutWindows[0].activePage.place("C:/Documents and Settings/lw/Desktop/Workflow_1/Artfiles/blo26940_ch10/blo26940_1002.eps");
    alert(imageBox.parent)
    This is my script Here i placed Rectancle image from (blo26940_1002.eps) File. In Indesig 2. it returns the (imageBox.parent)Name is Rectangle.
    But when i run this code in CS3 it did'nt return the parent name wht is the problem

    Have you found the Object Model Viewer for InDesign CS3? It's under the Help menu in ESTK.
    You're using the place method of a page, so let's look that up:
    Page.place (fileName: File , placePoint:Array of number, destinationLayer: Layer , showingOptions:boolean, autoflowing:boolean, withProperties:Object):Array of any
    Places the file.
    fileName: Data Type: File
    The file to place
    placePoint: Data Type: Array of number
    The point at which to place (Optional)
    destinationLayer: Data Type: Layer
    The layer on which to place (Optional)
    showingOptions (optional): Data Type: boolean, Default Value: false
    Whether to display the import options dialog (Optional)
    autoflowing (optional): Data Type: boolean, Default Value: false
    Whether to autoflow placed text (Optional)
    withProperties: Data Type: Object
    Initial values for properties of the new Page (Optional)
    I'll grant this is a bit hard to read for a newcomer, but looking at your code, there are two points you seem to be missing (based on what's written here):
    1. You're passing a file path as a string to the place method rather than a file object.
    2. The method returns an array (that's what the ":Array of any" means at the end of that first bold string).
    I haven't checked, but your use of a string might actually work, but I would always use a file reference myself. This is trivially easy to do.
    As for the returned array, this is because in theory the place method can be used to place multiple items, so the parent you want is the first (and in this case, only) member of the array.
    So, based on this, and assuming that file path is correct, try this:
    var myDoc=app.activeDocument;
    var imageBox=myDoc.layoutWindows[0].activePage.place(File("C:/Documents and Settings/lw/Desktop/Workflow_1/Artfiles/blo26940_ch10/blo26940_1002.eps"));
    alert(imageBox[0].parent);
    That should do the job, although I'd probably write it like this:
    var myDoc=app.activeDocument;
    var myFile = File("C:/Documents and Settings/lw/Desktop/Workflow_1/Artfiles/blo26940_ch10/blo26940_1002.eps");
    if (myFile.exists) {
         imageBox = myDoc.layoutWindows[0].activePage.place(myFile)[0];
         alert(imageBox.parent)
    } else {
         alert("File does not exist")
    Notice that I've moved the [0] to the end of the place statement so that the name of the imageBox variable matches what it really is.
    Dave

  • Getting parent pid execname

    I am modifying opensnoop to try to determine the script/executable that removes a file. How do I get access to the parent pid "PROCESS NAME". I know how to get the ppid, but what about it's name and args that it used.
    For example:
    ===== blah.sh ========
    #!/bin/sh
    rm /var/tmp/foobar
    =============
    In the "opensnoop", I have the function:
    syscall::unlink:entry
    { self->pathp = arg0 }
    syscall::unlink:return
    { printf("Parent pid <%d>  unlinked the file %s done with %s command.", ppid, basename(copyinstr(self->pathp)), execname }
    WHICH WOULD OUTPUT: Parent pid 1234 unlinked the file foobar with rm command.
    How do I get the PPID information since I want to know that it was "blah.sh" that was the culprit behind removal of this file?
    Thanks,
    Sean

    Here's a not-terribly-pretty way:
    curthread->t_procp->p_parent->->p_user.u_psargs

  • How to retrieve a child node's immediate parent node from a tree table?

    Hello
    Hi,
    I have a category_subcategories table, and I would like to know how to construct a sql and sub-sql for retrieving a child node's immediate parent node.
    Here is my first part of the sql, it only returns the node "Flash"'s parent and its grand-parents:
    SELECT parent.category_name, node.lft, node.rgt
    FROM category_subcategories AS node,
    category_subcategories AS parent
    WHERE node.lft > parent.lft AND node.lft < parent.rgt
    AND node.category_name = 'FLASH'
    ORDER BY parent.lft;
    | name |
    | ELECTRONICS |
    | PORTABLE ELECTRONICS |
    | MP3 PLAYERS | |
    how can I modify this query so that it returns Flash' parent - 'MP3 Players'?
    Thanks a lot
    Sam

    Hi,
    This is an Oracle forum. If you're not iusing Oracle, make that clear. Always say what version of your softwate you're using, whether it's Oracle or anything else.
    Whenever you have a question, post a little sample data (CREATE TABLE and INSERT statements), and the results you want from that data. Explain how you get those results from that data.
    It looks like you're using the Nested Sets technique for modeling a tree. To get the parents of given nodes, do something like this:
    SELECT        parent.category_name
    ,       node.lft
    ,       node.rgt
    FROM        category_subcategories      node     -- Can't use AS with table alias in Oracle
    ,       category_subcategories      parent
    WHERE        parent.lft      IN (
                        SELECT     MAX (lft)
                        FROM     category_subcategories
                        WHERE     lft     < node.lft
                        AND     rgt     > node.rgt
    AND        node.category_name          = 'FLASH'
    ORDER BY  parent.lft; This should work in Oracle 8.1 and up. (I can't actually test it unless you post CREATE TABLE and INSERT statements for some sample data). You may need to modify the syntax a little for your database.
    785102 wrote:
    Hello,
    I tried to implement the solution as follow:
    mysql> select parent.*
    -> from category_subcategories as parent
    -> having parent.lft =
    -> (select max(parent.lft) from
    -> (SELECT parent.category_name, parent.lft, parent.rgt
    -> FROM category_subcategories AS node,
    -> category_subcategories AS parent
    -> WHERE node.lft > parent.lft AND node.lft < parent.rgt
    -> AND node.category_name = 'Sofa'
    -> ORDER BY parent.lft
    -> )
    -> );
    ERROR 1248 (42000): Every derived table must have its own alias
    mysql>
    But I got an error.
    What is wrong with it?What does the error message say?
    Apparantly, in your system (unlike Oracle), every sub-query must have a name. Try something like this:
    select      parent.*
    from      category_subcategories as parent
    having      parent.lft = (
                   select      max(parent.lft)
                   from     (
                             SELECT        parent.category_name
                             ,       parent.lft
                             ,       parent.rgt
                             FROM        category_subcategories      AS node,
                                    category_subcategories      AS parent
                             WHERE        node.lft      > parent.lft
                             AND        node.lft      < parent.rgt
                             AND        node.category_name = 'Sofa'
                             ORDER BY  parent.lft     -- Is this a waste of effort?
                        )  AS got_name_lft_and_rgt
                  )     AS got_lft
    ;What is the purpose of having the inner sub-query, the one I called got_name_lft_and_rgt?
    Also, in Oracle, an ORDER BY clause in a sub-query doesn;t guarantee that any super-queries will keep that order. Why do you have an ORDER BY clause in the sub-query, and not in the main query?

  • Account parent/child - easy way to see the children?

    We're making extensive use of Account parent/child relationships. When you are viewing an Account, it is very easy to see the parent Account. Navigating to the parent is very easy. Users are requesting an Account related list that shows the children Accounts and the ability to easily navigate to a child Account. Is this capability possible?
    Regards,
    Jeff

    Jeff, when you are in the detailed view of a parent account there is a subobject called "Sub Accounts" which show all the child accounts for that parent.

Maybe you are looking for

  • Script Error Start-WBBackup (Windows Server Backup SnapIn)

    Hi, first of all, i hope that the post location will be the correct, and sorry for my english. I had this problem with a Script, i'm new in powershell, and hope that you can helpme. The objective of the script is make a SystemState Backup and send an

  • How to execute SQL queris in BPEL using JDeveloper?????..Please suggest

    Hi, I am very new to JDeveloper. Curently i am tryin to execute an SQL query from the BPEL process, there is an query in the source field and the output of the query is to be mapped to a variable field in the target xsd file. the query is fairly simp

  • Problem in Dropping Constraints..

    Hi All, I am facing problem while dropping and recreating constraint.Requirement is i have table there is 4 check(C) type constraint and all are having different search condition.I need to alter table and drop one of them C type constraint and again

  • How do I recover a file...

    How do I recover a file in Photoshop Elements 8 after it shuts down unexpectedly?  It is a new file and I didn't get the chance to save it.  Thanks for any help...

  • Runtime Excetpion

    Hi dudes I am new to this forum. I am using iText pdf converter in my office. When i tried to create a dynamic pdf file, generates some runtime exceptions. It is compiling with out any problem I had run the same code in another system at my home with