Manage Learn to apply best practices and optimize your operations.

Creating a marquee effect in a Lotus Notes client

The marquee effect tags in Internet Explorer and Mozilla can also be used in Lotus Notes client welcome forms. SearchDomino.com member Sunilkumar Vishwakarma provides step-by-step instructions and code in this tip.

This tip was submitted to the SearchDomino.com tip library by member Sunilkumar Vishwakarma. Please let others know how useful it is via the rating scale at the end of the tip. Do you have a useful Lotus Notes, Domino, Workplace or WebSphere tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.


The marquee effects tag on Internet Explorer and Mozilla can also be done in Lotus Notes client welcome forms. This site offers a fantastic solution for the same using a programmatic table.

Unfortunately, with this approach, you need to hard code the number of news items to be displayed in the table. If the @dbcolumn/@dblookup formula returns more than five documents, those documents will never be shown.

In order to get those in the marquee cycle, you need to edit the table and add rows and fields in the table.

Here is an alternate approach that will overcome the above limitations:

  1. Create a field named hMessages, Text, Computed for display, hidden Computed Formula:
    vMessages:=@DbLookup("Notes":"NoCache";
    @DbName;"vMessages";"Yes";2;[FAILSILENT]);
    @Implode(vMessages;"   ...   ")
    Hide When Formula: hMessages=""
    

    vMessages represents a view with two columns. The first column is a categorized text field that represents whether the message is to be shown on the screen on not. It will read "Yes" for showing the message and "No" for hiding the message. The second column is a text field used to represent message text.

  2. Create a field named startPos, Number, Editable, hidden default value: 0

  3. Create a field named hWStrip, Text, Computed computed formula: hWStrip

  4. Add the following JavaScript code in the form's JSHeader section, Client, Common JavaScript:
    function incrementPos()
    {varhMessage=new String(window.document.forms[
    0].hMessages.value);
    varhMessageLength=varhMessage.length;
    varstartPos=parseInt(window.document.forms[
    0].startPos.value);
    varstripLength=50;
     
    if(varstartPos<(varhMessageLength-1))
    {window.document.forms[0].startPos.value=varstartPos+1;}
    else
    {window.document.forms[0].startPos.value=0;}
     
    varstartPos=parseInt(window.document.forms[0].startPos.value); 
    if(varstartPos < (varhMessageLength-50))
    {varstripLength=(varhMessageLength-50);}
    else
    {varstripLength=50;}
     
    varStrip = varhMessage.substr(varstartPos,50)
    window.document.forms[0].hWStrip.value=varStrip;   
    RefreshTimerID = setTimeout ("incrementPos()",300);}
    
    function do_action()
    {RefreshTimerID = setTimeout ("incrementPos()",300);return(1);}
    
  5. Add the following code in the form's onLoad event, Client, Common Javascript do_action()

  6. You also want to create a SaveOptions Computed Text field on the form and set its computed formula to be "0" so that the welcome form does not get saved.

  7. You can create a form frmMessage, which will be used as a container for creating new messages and editing existing messages through the Lotus Notes client.

The link for the messages view should be made accessible to the content editor who can enable, disable or add new messages. This form is to be used in the selection formula of the vMessages view.

One limitation in this case would be that you will not be able to add a doclink in the marquee -- as the field is a computed field.

When the user logs on, the marquee is ready to be placed on the welcome form to greet the user with specific messages that the system has generated through the scheduled agent.

Do you have comments on this tip? Let us know.

Dig Deeper on JavaScript for Lotus Notes Domino

SearchWindowsServer

Search400

  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/Search400.com community. These cheat ...

  • HTML cheat sheet

    This is a really cool cheat sheet if you're looking to learn more about HTML. You'll find just about everything you every wanted ...

  • Carol Woodbury: Security

    Carol Woodbury

SearchDataCenter

SearchContentManagement

Close