Display Customized Message

Display Customized Message in place of "No Document Found" in embedded view using Java Script.

You Can View User Feedback To This Tip

Display Customized message (In other Languages too) in place of "No Document Found" in Embedded Views

If you don't want to use @dbcolumn as it has a great impact on the server performance for the large databases . Here is a different way using Java Script:

 Create an embedded view within a DIV Tag on your form as shown here: <div id="view"> ------> Mark it as pass thru HTML Your embedded View (Note: Do not select embedded view as Pass Thru HTML) </div> ------> Mark it as pass thru HTML Create the customized message within DIV Tag which you want to display when there is no document in the view as shown here: <div id="msg"> ---------> Mark it as pass Thru HTML Customized message (Note: This line is not pass thru HTML) </div> ----> Mark it as pass Thru HTML Put the following code In JS Header : function HideView() { var tableTags = document.all.tags('tr') ; if (tableTags.length==0) { document.all.msg.style.visibility="visible"; document.all.view.style.visibility="hidden"; } else { document.all.msg.style.visibility="hidden"; document.all.view.style.visibility="visible"; } Put the following code in On Load Event: HideView()

USER FEEDBACK TO THIS TIP

 

  • Maybe you have designed your $$ViewTemplate as follows: At first you have a table witch contains your own actions (for example some designed buttons). After this table, you have your embedded view (displayed as Java Applet). In this case, you could use the following code (we use JavaScript and CSS):

     Design your $$ViewTemplate as follows: - Table with your actions Put these lines under your table: <DIV ID="vwEmbed"><P> --> Mark it as pass thru HTML Your embedded view (displayed as java-applet) --> Do not mark as pass thru HTML !! </P></DIV> <DIV ID="msg">Sorry. No documents found.</DIV> Put the following code In JS Header : function cstNDFMsg() { var chkH = document.all.tags('h2') ; if (chkH.length==1) { document.all.msg.style.visibility="visible"; document.all.vwEmbed.style.visibility="hidden"; } else { document.all.msg.style.visibility="hidden"; document.all.vwEmbed.style.visibility="visible"; } } Put the following code in On Load Event: cstNDFMsg() Put the following code in the HTML HEAD Content: "<STYLE TYPE="text/css">"+ "/* P APPLET is used to resize the ViewTemplate */"+ "p applet {width:100%;height:90%;}"+ "/* H2 is used by Domino for displaying the 'No Documents found' message */"+ "h2 { font: normal Tahoma,Arial,Helvetica,sans-serif 8pt #aa0000; text-align:center; }"+ "/* Customized 'No Document found' message */"+ "#msg {padding-top:5pt;text-align:center;height:40px;font-family:Tahoma,Arial; font-size:16pt;font-weight:bold;border-style:solid; border-width:1px;border-color:#000000; background-color:#ffffff;color:#aa0000;}"+ "</STYLE>"
    

    You could play with the stylesheet to get your own NO DOCUMENTS FOUND-Style.

    —Christian Weiss 

This was first published in June 2001

Dig deeper on Domino Resources - Part 3

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchDataCenter

SearchExchange

SearchContentManagement

Close