7 Replies Latest reply on Feb 27, 2008 2:25 AM by pete007

    My rich:toolBar is getting too long, how to create a second row

      Hello, I got a short question. My DataModel consists of 17 tables, so the menu gets very long and is truncated at the right border.


      Error Parsing /layout/menu.xhtml: Error Traced[line: 23]
      The markup in the document following the root element must be well-formed.



      I tried to create a second row, but the parser didn't let me do this, <br> doesn't work because it's a table and closing the table row and opening another didn't work also because it isn't well-formed too. :|


      I already shortened the links by using only the entity-names, but it's still too long.


      Any hints?

        • 1. Re: My rich:toolBar is getting too long, how to create a second row
          nickarls

          Can you use another rich:toolBar altogether?


          What do you mean by a table that isn't well-formed when you add another row? Could you post the .xhtml?

          • 2. Re: My rich:toolBar is getting too long, how to create a second row

            I tried to insert the following between two menu items:


            </rich:toolBar>
            <rich:toolBar>



            </td></tr>
            <tr><td>



            and other stuff with h:outputText .. All resulted in a must be well-formed error.
            Maybe the rich:toolBar can only be used once per document? I'm new to this things, so where can I get the definition of this item?


            Tanks, pete

            • 3. Re: My rich:toolBar is getting too long, how to create a second row
              keithnaas

              Can you post the entire menu.xhtml you are referring to.  It may be easier for us to help if we can see how it is being used. 


              Thanks.

              • 4. Re: My rich:toolBar is getting too long, how to create a second row
                damianharvey.damianharvey.gmail.com

                Try using rich;dropDownMenu and nesting some of your items.


                Cheers,


                Damian.

                • 5. Re: My rich:toolBar is getting too long, how to create a second row

                  Oh, it's only the usual menu.xhtml, but with many entries, so it runs out of the window.


                  I think, the problem is, that XHTML-documents can contain only one root element, so I couldn't divide it into two or more. I've now copied them into seperate files and include them one after the other in the template.xhtml, works well.


                  Instead of


                  <body>
                          <u:include src="menu.xhtml"/>
                          <div class="body">
                               <u:insert name="body"/>
                          </div>
                  </body>



                  I now have


                  <body>
                          <u:include src="mainmenu.xhtml"/>
                          <u:include src="adminmenu.xhtml"/>
                          <u:include src="roommenu.xhtml"/>
                          <u:include src="departmentmenu.xhtml"/>
                          <div class="body">
                               <u:insert name="body"/>
                          </div>
                  </body>



                  If this can be done without splitting the file, it would be nice to read the cooler solution. ;-)

                  • 6. Re: My rich:toolBar is getting too long, how to create a second row
                    keithnaas

                    What was the root element(s) of menu.xhtml?  Its hard to give a solution without knowing what tags you're using and how.

                    • 7. Re: My rich:toolBar is getting too long, how to create a second row

                      The root element is a rich:toolBar.


                      The default menu.xhtml looks like this for Entities 1 to N:


                      <rich:toolBar 
                          xmlns=...>
                          <rich:toolBarGroup>
                              <h:outputText value="#{projectName}:"/>
                              <s:link view="/home.xhtml" value="Home"/>
                          </rich:toolBarGroup>
                          <s:link view="/Entity1.xhtml" value="Ent1" propagation="none"/>
                          .....
                          <s:link view="/EntityN.xhtml" value="EntN" propagation="none"/>
                          <!-- @newMenuItem@ -->
                          <rich:toolBarGroup location="right">
                              <h:outputText value="Welcome, #{identity.username}!" rendered="#{identity.loggedIn}"/>
                              <s:link view="/login.xhtml" value="Login" rendered="#{not identity.loggedIn}"/>
                              <s:link view="/home.xhtml" action="#{identity.logout}" value="Logout" rendered="#{identity.loggedIn}"/>
                          </rich:toolBarGroup>
                      </rich:toolBar>



                      And I wanted to break the menu somewhere between two entity links, e.g. at N/3 to get 3 rows of menu items.