Creating a marquee effect in a Lotus Notes client

Creating a marquee effect in a Lotus Notes client

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

    Requires Free Membership to View

    Register today to access targeted resources from our editorial writers and independent industry experts focused on Lotus Domino, Notes, Workplace and other related technologies.

    By submitting your registration information to SearchDomino.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchDomino.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

  1. 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.

This was first published in May 2006

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.