Workaround for updating the styleClass property of a button when using BS theme

In my application I am using the Bootstrap theme that comes with the extension library. In the application I have a button with which I want to enable/disable the appearance of the debugtoolbar plugin for the end-user so it will be easier to handle incident reports when they should occur.

So in my application layout control I added the toolbar and compute the appearance:

debuglayout

Now somewhere in my application I have in a dialog a button to show/hide the debug toolbar:

debugBtn In the browser it looks as followed:

debugDlg

At first when I pressed the button the styleClass would update ONLY when I totally refreshed the page which was undesired.

The trick here is to disable the theme for the button:

debugTheme

I then have to surround the button with additional HTML span element:

<span class=”btn-group”><xp:button…/></span>

As a result the button changes styleClass correctly:

debugSwinging.JPG

Want to know more about XPages dev item? Just drop a question below…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s