Link to home
Start Free TrialLog in
Avatar of RichardStarkey
RichardStarkey

asked on

No Documents Found message in the browser


Hi All,
Anybody know if we can change the default "No Documents Found" message when a view being viewed has no documents in it 9that the currently logged on person can see - there are documents in the view, just not viewable to the current person).

Thanks,
Richard
SOLUTION
Avatar of Bozzie4
Bozzie4
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RichardStarkey
RichardStarkey

ASKER


Hi Tom,
Ideally, I'll show an alternate message something along the lines of "You have no outstanding requests waiting".  It looks like the div and javascript would be the best option for that(?) so I'll give it a go now.
Thanks,
Richard
Hi Tom,
I went with the second option but it does not want to work.  It is showing both regardless the viewbody and the text regardless.
Thanks,
Richard
You should add (in the body tag for instance) a call to the hideView function :

Add this to the OnLoad event of the $$Viewtemplate form

HideView();

cheers,

Tom
Put this in the onload:

var h2 = document.getElementsByTagName("h2");
  for (var vLoop = 0; vLoop < h2.length; vLoop++){
   if (h2[vLoop].childNodes[0].nodeValue == "No documents found"){
    h2[vLoop].childNodes[0].nodeValue='You have no outstanding requests waiting.'   ;
   }
  }

Thanks.
I couldn't get Tom's to work but Parta's worked good.  The only slight issue I have is with the font size of the message.  Is there anyway that can be changed?
Cheers,
Richard
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Actually, it's the same code, so just calling the function in the onload event works just as well (to be sure, I tested this code, and it works fine.  If you call the function, please watch out for UppEr and lowercase.  Javascript is sensitive to that.  Also, make sure you put the javascript in the correct field (Client/Common javascript or Web/Javascript).  
I find it's cleaner to use functions to do this sort of stuff, or you end up with a completely cluttered code.  If you use functions, you can move the code to a javascript library, and re-use it easily in other $$viewtemplates or even normal forms.

Anyway - for the font size of the message :

Just add html or style information to the <div> tag :
<div id="msg" style="font-size: 9px"> --> As pass-thru HTML
Your message. --> As standard text
</div> --> As pass-thru HTML

OR don't mark the "Your Message" as html, and do markup in Notes (OR mark it as html, and add font tags)

<div id="msg"> --> As pass-thru HTML
Your message. --> As standard text
</div> --> As pass-thru HTML

cheers,

Tom