Home > Domino Tips > Developer > Creating a marquee effect in a Lotus Notes client
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

JAVASCRIPT

Creating a marquee effect in a Lotus Notes client


sunilkumar vishwakarma
05.02.2006
Rating: -3.75- (out of 5)


Lotus Notes and Domino tips, tutorials and how-to articles
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


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.

Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


RELATED CONTENT
Formula
Provide rich-text formatting via the Profile document and Formula
Using Formula language code to sort Lotus Notes messages by subject
How to create dynamic JavaScript in Notes Domino without formulas
Formula language button manages Deny Access list searches
Retrieve Lotus Notes names from a nested group using @DBLookup
Create a computed Lotus Notes field to list Personal Address Book names
Show multiple Lotus Notes document fields in a single view column
How to send a document as a link in a Lotus Notes email
How to generate formatted sequence numbers with Formula language
A simpler pagination view for Lotus Notes documents on the Web

JavaScript
How to create dynamic JavaScript in Notes Domino without formulas
Trap an attachment path via the Domino file upload control field
Converting Lotus Notes views to XML documents using JavaScript
Prevent errors on iFramed pages with JavaScript
How to add keyboard functionality for Lotus Notes documents
Validate Lotus Notes Domino fields using JavaScript
How to support Flash objects in any Web browser for a Lotus Notes Domino application
How to validate Lotus Notes forms on a Domino server without losing entered data
Ajax code equivalent of the @DBColumn formula for Lotus Notes
A bevy of Notes/Domino development tips

JavaScript for Lotus Notes Domino
How to create dynamic JavaScript in Notes Domino without formulas
Trap an attachment path via the Domino file upload control field
Converting Lotus Notes views to XML documents using JavaScript
Mimic Lotus Notes Domino application functionality on the Web
Prevent errors on iFramed pages with JavaScript
Top 10 Lotus Notes Domino programming and development tips of 2007
How to add keyboard functionality for Lotus Notes documents
Validate Lotus Notes Domino fields using JavaScript
How to support Flash objects in any Web browser for a Lotus Notes Domino application
How to validate Lotus Notes forms on a Domino server without losing entered data

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

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.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 1999 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts