Blogs

  • Browse Blogs
  • My Blog
  • My Updates

Tags Help

  • View as cloud  | list

Similar Entries

photo

XPages - initial cur...

Blog:  Notes from th...
Jerry Shelley
Updated 
No RatingsRatings 0     CommentsComments 4
photo

Editing mulitple dat...

Blog:  Pascal David
Pascal David
Updated 
No RatingsRatings 0     No CommentsComments 0
photo

(struggling with) ed...

Blog:  Pascal David
Pascal David
Updated 
No RatingsRatings 0     No CommentsComments 0
photo

Two Document Datasou...

Blog:  Notes from th...
Jerry Shelley
Updated 
No RatingsRatings 0     No CommentsComments 0
photo

Re: XPages - Exceedi...

Blog:  Paul's Domino...
Paul Hannan
Updated 
No RatingsRatings 0     No CommentsComments 0

Bookmarks

Yellow is the New Blog

Blog Authors:  Tim Tripcony  

Previous |  Main  | Next

Quick UI trick for XPages

Tim Tripcony  |     |  Tags:  xpages  |  Comments (2)
If you follow Declan's blog, you already know that using the OneUI CSS template makes it even easier to rapidly give your XPages a pleasant user interface. Here's a quick tip for adding an interesting UI element to your pages that takes advantage of some of the OneUI behavior.

When you wrap any link in a span that has a style class of "lotusBtn", the link is rendered with a border and background graphic, so it looks like a button even though it's just a link. This is one approach for ensuring that an element intended to behave like a button (in other words, has an onClick event) will render similarly across all browsers. Since a section control, when rendered in a browser, is nothing more than just a link that uses client-side JavaScript to toggle the display of additional content, this allows us to render the section header such that it appears to be a button that, when clicked, displays the section contents. Since the entire section is wrapped in the "lotusBtn" span, which has a 1px border, the entire section has a border, but only the header has the background graphic... in other words, it looks like an inline dialog.

For example, if your XPage includes functionality for parsing RSS/Atom feeds and you want to allow the user to submit the URL of a feed they want to subscribe to, you might create a table for the URL field and corresponding label, and a button (or link styled as a button) for submitting the value. Here's how that would look if using this style technique.

Collapsed:
image
Expanded:
image
Note that in this case I'm using a custom image for both the expanded and collapsed state.

So the user clicks an element that looks like a button, which displays the additional detail inline instead of as a modal dialog or popup window. To enable this in your own XPage, select the section you want to render this way, switch to the Source tab and wrap the xp:section element in the following markup:

<xp:span styleClass="lotusBtn"><xp:section....</xp:section></xp:span>

One more quick customization to this technique: in addition to the "lotusBtn" class, you can add either "lotusBtnAction" or "lotusBtnSpecial". Instead of a silver background with blue text, the section header will have white text on a green background if using "lotusBtnAction", or blue if using "lotusBtnSpecial". So, for example, for a white-on-green button, the source would look like this:

<xp:span styleClass="lotusBtn lotusBtnAction"><xp:section....</xp:section></xp:span>

Click here to see an example of all three styles in action.

Comments

1 Steve Smillie      Permalink Great tip. I will be checking that out!

I have been trying to use the Calendar of the Date Time Picker Control on a pages that uses the OneUI (based on Declan's Tutorial) and the control is missing all the CSS. Any ideas on how to work around that? I assume it is knowing the right OneUI classes to use.

2 Tim Tripcony      Permalink Steve, check out Stephan's post on using an empty CSS template to allow the OneUI classes to be selected from the style list:

http://www.wissel.net/blog/d6plinks/SHWL-7S9D24

The template he provides for download includes the following classes that are probably what you're looking for:

xspInputFieldDateTimePicker
xspInputFieldDateTimePickerIcon

Hope that helps.


Previous |  Main  | Next
Skip to main content link. Accesskey S
IBM Lotus Connections Help Tools About

Tags

A tag is a keyword that is used to categorize an entry. To view the entries with a particular tag, click a tag name or enter a tag in the box.
The tag cloud indicates the frequency of tag use. Popular tags appear darkest. The slider control adjusts how many tags are displayed in the tag cloud.