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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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
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
Add this to the OnLoad event of the $$Viewtemplate form
HideView();
cheers,
Tom
Put this in the onload:
var h2 = document.getElementsByTagN ame("h2");
for (var vLoop = 0; vLoop < h2.length; vLoop++){
if (h2[vLoop].childNodes[0].n odeValue == "No documents found"){
h2[vLoop].childNodes[0].no deValue='Y ou have no outstanding requests waiting.' ;
}
}
var h2 = document.getElementsByTagN
for (var vLoop = 0; vLoop < h2.length; vLoop++){
if (h2[vLoop].childNodes[0].n
h2[vLoop].childNodes[0].no
}
}
ASKER
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
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