Documentation or HowTo for using Tobago?

Demo

Best Practices

Tobago Tutorial

Where can I find a Hello World example and a list of needed jars?

Please look at tobago-example-blank or download the myfaces-tobago-example from the nightly builds directory.

Does Tobago run with the Sun reference implementation (RI)?

Tobago should run with Sun RI and with MyFaces.

Can I mix Tobago and MyFaces extensions in the same web application?

JSF only supports one renderkit (renderkitId) per page (f:view). Because Tobago has it's own renderkitId you cannot use any non-Tobago components that need a renderer.

How do I use GridLayout in Tobago?

The attribute 'fixed' means a theme dependent height of one row (i.e. in Speyside a row is typically 20px high.) In a 'fixed' row all one height unit high elements find their place (like buttons, input fields, one row of text...).
Using px heights is at your own risk, but it is sometimes needed for elements like box or sheet.

Alternatively you can give elements a proportion with the * notation.
For example rows="1*;2*" gives the first row 1/3 of the available vertical space and the second row 2/3. This works fine for columns, too.

You can group elements with a tc:panel element. Such a panel is interpreted as one element regarding layout. The panel itself can have its own layout for multiple elements inside the panel.

How do I configure file upload in Tobago?

You have two options.

Add a TobagoMultipartFormdataFilter to your web.xml. JavaDoc Description

Add the tobago-fileupload.jar to your project. The tobago-fileupload.jar contains a FacesContextFactory that wraps the multipart-formdata request inside the FacesContext. JavaDoc Description

Do I need a form tag in a normal Tobago page?

The page tag already acts like a form tag. You only need a explicit form tag for partial validation of your data. Please look at the forms example in the Tobago demo

Which web browsers are currently supported by Tobago?

Firefox 2, IE 6 (TODO more details)

How do I create my own theme?

You have to define a new name for the theme in the META-INF/tobago-theme.xml. Choose a fallback theme in the tobago-theme.xml. Put the modified resources under the resource-path + theme-name. An example for this is the charlotteville theme. (TODO more details resource handling)

Example layout of a theme jar:

/META-INF/tobago-theme.xml (resource-path/html/theme-name) /org/apache/myfaces/tobago/renderkit/html/xxxxx/standard/style/style.css (standard styles) /org/apache/myfaces/tobago/renderkit/html/xxxxx/standard/style/tobago-menu.css (menu styles) /org/apache/myfaces/tobago/renderkit/html/xxxxx/standard/style/tobago-sheet.css (sheet styles) /org/apache/myfaces/tobago/renderkit/html/xxxxx/msie/style/style.css (different styles for msie) Property and resource loading and renderer loading is done in the following order resource-path/content-type/theme/client/[tag(for renderer)|property|style|script|image]_locale.(class|property|property.xml|css|js| gif|png...] for example OutRenderer
org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.OutRenderer
OutRenderer is getRendererType() + "Renderer"
The locale handling is handled like the Properties Class.
You have not define everything because the ResourceManager is asking the fallback theme for missing resources
The fallback theme of charlotteville is speyside.
The fallback theme of speyside is scarborough.
The fallback theme of scarborough is standard
The resource manager looks in the case of the charlotteville theme in
charlotteville -> speyside -> scarborough -> standard

Please look at tobago-example-theme

How do I use and extend the markup attribute?

UIBox, UIInput and UIOutput support custom markup with the markup attribute. The supported markup is defined in the tobago-theme.xml. The standard markup is defined in tobago-theme.xml of the tobago-theme-standard. This can be extended in your own theme. The markup attribute is rendered as a CSS class tobago-[renderer-name.toLowerCase]-markup-[markup]. For an example please look at the markup number and the CSS class tobago-in-markup-number for UIInput in theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/style/style.css

In which containers was Tobago tested?

Tomcat 5.5, Websphere 6.0, 6.1, Weblogic 8.1, 9.2. Feel free to post your own experiences.

Can Tobago replace tiles? Can I ignore Tiles and Sitemesh in favor of Tobago?

Tobago cannot replace it. But sometimes you may not need it, when you are using Tobago. If you want to position and size your components automatically, you can do this with a Tobago LayoutManager. If you want your header and sidebar rendered without writing duplicate code, you may use JSP 2.0 tag files or Tiles/Sitemesh.

How to configure a maven mirror?

If you want to set up a different mirror for some reason, you can use your ~/.m2/settings.xml and add the following lines:

mirror ID Give it a name The URL of the mirror The server ID of the repository being mirrored. This must not match the mirror ID

See: Guide to mirror settings

Mirrors: List of mirrors

How do I configure an offline build?

If you run into problems with fetching jars from the online repository, you can configure Maven not to fetch them but use the ones already in your local repository by adding the following to your ~/.m2/settings.xml:

or use the mvn -o switch.