English 中文(简体)
Change the caption of button in Lotus Notes
原标题:

How can I change the caption of a button using LotusScript/Formula?

最佳回答

What Ken says is true, but you can change button labels using JavaScript in the Notes client. You ll need to go to the <HTML> tab of the button properties and give the button a name value (an id value works as well in later versions), then you can use

document.forms[0].ButtonHTMLName.value = "New Caption";

or

document.forms[0].elements["ButtonHTMLName"].value = "New Caption";

Either can be triggered from any number of client events in Notes version 6 or higher using client-side or common JavaScript.

问题回答

There are no hooks into a button that will let you change it via LotusScript or a Formula. If you only have a few different captions you d like to have on a button (and the scripts are the same), I ve once stored those various predefined buttons on a hidden form, in separate richtext items, and then copied them to my doc using LotusScript. That would be useful if you were trying to generate and send a button in an email for example, but not much use unless you re generating the doc upon which the button appears programmatically as well.

You might find useful the undocumented method "addLinkByIDs" on the NotesRichTextItem class. Again, probably only useful if you re building the document on the fly, as changing rich text items on a UI doc isn t very easy to do.

More info on undocumented methods here: http://opendom.blogspot.com/2006/11/undocumented-dom-lotusscript-inventory.html

Lastly, there s always the Midas LSX from GeniiSoft, which is an add-on that gives you lots of control over rich text items. I don t know for sure, but I d bet there s a way to change a button caption using that LSX. http://www.geniisoft.com/showcase.nsf/MidasLSX





相关问题
C# Building An Array with Button Entries

I have a set of buttons that I want to add into an array so that they are ordered. The buttons I have are: Monday0700Button Monday0730Button Monday0800Button Monday0830Button and so on. How do I ...

Text in disabled and css styled button shows movement in IE

I have disabled and css styled buttons. In Firefox, disabled buttons do not move at all when pressed (which is what is expected), in IE, the text in the buttons still moves a few pixels. Why does ...

Where is Button.DialogResult in WPF?

In System.Windows.Forms.Button there is a property DialogResult, where is this property in the System.Windows.Controls.Button (WPF)?

How to create a submit button template in Oracle APEX?

I m trying to create a template for a button in Oracle APEX but I don t seem to have access to the appropriate substitution strings to make it work. For non-templated buttons APEX seems to insert a ...

Removing text from HTML buttons on all browsers?

We have buttons of many sizes and colors that use background images. There is a label on the background image itself, but we need to keep the button s text in the HTML for usability/accessibility. How ...

Back button loop with IFRAMES

In my (school) website we use Iframes to display class blogs (on blogger). This works well EXCEPT if the user then clicks on (say) a photo inside the iframe. Blogger (in this case) then displays the ...

ruby on rails on click events

I am so sorry if this question seems too easy but I can t seem to find it anywhere. I am creating a ruby in steel project. I have created a html.erb and rb file in a vs project (ruby on rails). My ...

热门标签