Siebel OpenUI – Deselect Content in Text Area Controls While Tabbing

Difficult to give this post a descent title. What this post is all about, is the fact that Siebel will ‘default’ select any text in list applet columns while tabbing through. In itself not such a bad feature. But there are situations where this behavior is by end-users perceived as highly unwanted. Think of notes, where a text area control potentially contains tons of carefully entered text. Tabbing through a list applet makes it prone to unintentionally wipe this precious and entered data at the blink of an eye (or better by almost any keystroke…).

This was brought to my attention by a customer. Luckily enough, the Siebel OpenUI offers such a great extensibility framework! Writing one of the most simplistic control plug-in wrappers ever, does the job. Goal of the plugin wrapper would be to ‘deselect’ the control’s content at the moment it receives focus. Instead of selecting the control’s value, it should just put the cursor at the far end of the text.

The plug-in wrapper is code is not more than a few basic lines, plus the standard skeleton code.

UnselectDataTextArea

Like any control plugin-wrapper, you need to instruct it on what control type and when to act (1). I choose to have it act solely on the “SWE_CTRL_TEXTAREA” control, regardless further context – therefore the “return true;” without any further conditions. In this case we add an additional event on the control, so the BindEvents event makes most sense (2). Finally, the actually magic happens using the “focus” event, on which we trigger a single line of code to reset the selection (3). So simple, yet so powerful.

As any control plug-in wrapper, just administer as Application / Common file.

Enjoy!

– Jeroen

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s