6 Replies Latest reply on Oct 18, 2006 2:34 PM by Woodler

    What determines window order within a region?

    David Hoffman Newbie

      I cannot seem to determine what it is that is making the windows show up in a given order.

      Can someone point me to a reference that discusses this?

        • 1. Re: What determines window order within a region?
          Peter Johnson Master

          The theme.order property decides the relative order. In the *-object.xml file, this is set using the < height > node.

          • 2. Re: What determines window order within a region?
            David Hoffman Newbie

             

            "The Reference Guide" wrote:

            The four markup containers are hierarchical. The region contains one or more windows. A window contains the portlet decoration and the portlet content.

            The region is responsible for arranging the positioning and order of each portlet window. Should they be arranged in a row or a column? If there are more then one portlet window in a region, in what order should they appear?

            The window is responsible for placing the window decoration, including the portlet title, over the portlet content, or under, or next to it.

            The decoration is responsible for inserting the correct markup with the links to the portlet modes and window states currently available for each portlet.



            So now I just need to figure out the best way to order the region.getWindows() List object.


            • 3. Re: What determines window order within a region?
              David Hoffman Newbie

               

              "PeterJ" wrote:
              The theme.order property decides the relative order. In the *-object.xml file, this is set using the < height > node.



              Thanks Peter, that was precisely what I needed to know. Works like a champ.



              • 4. Re: What determines window order within a region?
                David Hoffman Newbie

                 

                "PeterJ" wrote:
                The theme.order property decides the relative order. In the *-object.xml file, this is set using the < height > node.



                Just for conversation purposes, does anyone know how it would determine the order if the nodes were identical? Obviously this is not optimum, but it would be interesting to know how it makes the determination when it is the same.

                • 5. Re: What determines window order within a region?
                  Peter Johnson Master

                  How did I know you would ask that? I was initially going to say "I don't know", but in trying it out I I would have to say that the order is undetermined. I changed three windows to have a theme.order of 0 and they simply rearranged themselves. The new order is the inverse of the old order, and is not in the order in which I changed the individual theme.order values, nor is it in alphabetical order. Now, I did this though the Management Porltet. I don't know what order you would get if you did this via a *-object.xml file (I might bet on order of appearance, but inverse order is possible).

                  Long story short, if you care, use different numbers. By the way, the numbers to not have to be consecutive, so you can use the old coding trick of numbering using 100's or 10's (e.g., 100, 200, 300). Then it is easy to add things in between later without renumbering everything.

                  • 6. Re: What determines window order within a region?
                    Woodler Expert

                    It's more or less random.
                    What happens behind the scenes is that WindowContext implements Comparable, and the compare method only considers the order to calculate the return value

                    package org.jboss.portal.theme.page;
                    public final class WindowContext implements Comparable, Serializable
                    {
                     ....
                     public int compareTo(Object o)
                     {
                     return order - ((WindowContext)o).order;
                     }
                     ....
                    }