Changing default "No documents found"

Hello,Is there a way of changing the default message “No documents found” when browsing a view through HTTP with no documents in it.

Thanks for your help.

Subject: Changing default “No documents found”

Slightly different, but if there are no documents I don’t want to display the embedded view or any message, so I’ve put the following code into the hide when of the embedded view.

Lookup := @DbLookup( “” : “NoCache” ; “” : “” ; “(MyEmbeddedView)” ; MyField ; 1 ) ;

@IsError( Lookup )

Subject: Changing default “No documents found”

More or less the same.Is a combination of 2 possible solutions than I see in the forum

Here is the part in the Page or Form :

--> As pass-thru HTML

Your embedded view

--> As pass-thru HTML
--> As pass-thru HTML

Your message. → As standard text

--> As pass-thru HTML

In the JSHeader :

function HideView() {

var h2 = document.getElementsByTagName(“h2”);

for (var vLoop = 0; vLoop < h2.length; vLoop++){

if (h2[vLoop].childNodes[0].nodeValue == “No documents found”){

document.all.view.style.display="none";

}

else

{

document.all.msg.style.display="none";

}

}

}

Subject: Changing default “No documents found”

With javascript you can search for the string and replace it. Look at http://www.codestore.net

for a couple of different solutions.

/Bobby

Subject: Solution

Thanks,Found many solutions. The simplest one is the following (I’lle post it to help anyone else interested).

Here is the part in the Page or Form :

--> As pass-thru HTML

Your embedded view

--> As pass-thru HTML
--> As pass-thru HTML

Your message. → As standard text

--> As pass-thru HTML

In the JSHeader :

function HideView() {

var tableTags = document.all.tags(‘A’) ; → The tricky part. You look for a tag in the information returned by your embedded view. I have a link so the “A” tag works for me. You may have to change that.

if (tableTags.length==0)

{

document.all.view.style.display=“none”;

}

else

{

document.all.msg.style.display=“none”;

}

}

And call the function on the OnLoad

And that’s it. It works fine and it’s light.

Subject: Why bother with javascript? (WAS: Changing default “No documents found”)

The JS solutions work great, but you don’t have to use Javascript: in my web apps I usually have a field that has a numeric value in it reflecting the number of entries in a view. Using this field value as a reference, I then simply create hide-when formula for the embedded view and message string / field / computed text / whatever respectively.

Works just fine.

Subject: RE: Why bother with javascript? (WAS: Changing default “No documents found”)

Can you please give more informations on your solution?I have problems to understand it.

Thank you

Subject: RE: Why bother with javascript? (WAS: Changing default “No documents found”)

The process relies on code documented here, i.e. knowing how many documents are in a view, and hiding / showing the embedded view and navigation options as a result:

Note that you need to use the Javascript solution if your views get very big, as the native Domino code hinges on @DbColumn, which has an upper limit.