Scrollbars in a XEO Viewer

When creating an XEO Viewer you’ll probably run into the “scrollbar issue”.  Not all container components (such as panel or section) add scrollbars when the content exceeds the available space. In order for you to assure that your content is visible you need to wrap your content using the Tab component, like the following:

<xvw:tabs>

   <xvw:tab label='Test'>

       <!-- Your content goes here  -->

    </xvw:tab>

</xvw:tabs>

Which produces the following result:

Tab with Label and Scrollbar

Tab with Label and Scrollbar

 

 

 

 

 

 

 

 

 

This will make the scrollbar appear if needed. If you set a label for the tab (as in the example with the “Test” label) it will be rendered as such. If you don’t set a label for the tab it will still render the space for that empty label which is not very pretty. In order to make that go away you can use the renderTabBar property of the parent xvw:tabs component to make that tab bar disappear (but still use a tab component), like in the following listing:

<xvw:tabs renderTabBar='false'>

   <xvw:tab>

       <!-- Your content goes here  -->

    </xvw:tab>

</xvw:tabs>

Which will produce the following result (with scrollbars as needed) :

Tab with No Label and Scrollbar

Tab with No Label and Scrollbar

 

 

 

 

 

 

 

 

 

Happy coding!

CreateView vs CreateChildView why do I lose my boObject reference?

When you are developing an application using XEO you’ll need to open specific views as a result of certain actions. In order for you to achieve that you need to create the view in memory and for that you have two choices:

XUIViewRoot viewRoot = getSessionContext().createChildView("viewers/path/to/viewer/Viewer.xvw");

or

XUIViewRoot viewRoot = getSessionContext().createView("viewers/path/to/viewer/Viewer.xvw");

The main difference between the two is regarding the current context. Creating a view with createView uses a new context and switches the context immediately upon invocation (meaning you loose access to anything that was available in the current context) . If you use the createChildView method you maintain the same context in the two views ( which is important if the two views share some relationship – hence the name create ” child ” view)

So if your two views have no relationship but you need information for the current context… Save them in variables before creating the view – or else. Most of the times createChildView is the correct usage, but if the two views are disconnected, use createView.

Happy coding!

My XEO Consultant – New blog

Hi, everyone

Been a long time since my last post. I’ve been busy with other side-projects, hope to post some new stuff about the XEO Framework in the near future.

Today I’d like to point out that a colleague of mine started a new blog called “Life of XEO Consultant” where you’ll probably see some cool information from someone who’s been doing projects using XEO (and a lot more tools as well) for a very long time (much longer than me)

So I advise you to check out the blog every now and then. You might find some nice information about XEO.

Have a nice reading 🙂