Tabs with new line

Hi,

I have built a portlet that contains multiple tabs.

I’m using a java arrayList to store the titles and targets of these tabs:


views = new java.util.ArrayList();
views.add(new String[] {"/Tabs/tab1.view", "tab1"+System.getProperty("line.separator")+"Search"});
views.add(new String[] {"/Tabs/tab2.view", "tab2 \n Form"});

The new lines don’t appear in the tabs, so instead of getting:
tab1 tab2
Search Form

I get
tab1Search tab2Form

Any idea how I should write this so that the new lines appear in the tabs?

Thanks a lot for your help,
Francois

Which control are you using to render the tabs?

You may be able to use a “Output/Formatted Text” control to render the text of the tab since it is designed to preserve plain-text formatting (for example, newlines, tabs, and spaces).

I was using Text control to render the text of the tabs.

I changed to Formatted Text, and it worked like a charm :slight_smile: Now I just have to set the correct styles.

Thanks a lot Eric !