Page 1 sur 1

Hide 'no documents found' on Web

MessagePublié: 02 Nov 2006 à 18:54
par oguruma
Create a $$ViewTemplateDefault Form.
Create a Table (1:1) on this form.
Hide the Tbale border
Put in the table cell (should be one cell) the following.

<div id="msg">
</div>
Create here a $$ViewBody field
<div id="view">
</div>

the div statements should be passthrough ofcourse.

Then include this JavaScript in form in the JS Header:

var msg ='<VALIGN=TOP><br><br><FONT SIZE=2
FACE="Arial">Sorry, Nothing to
display</FONT><BR><BR><FONT SIZE=2
FACE="Arial">Thank you,</FONT><BR><FONT SIZE=2
FACE="Arial">Greetings, </FONT><B><I><FONT
SIZE=2 FACE="Arial">.............</FONT></I></B>'

function CheckNoDocuments() { // function to replace the 'No
documents found' message

if (document.getElementById("view").innerHTML.indexOf("No documents
found") > 0) {

document.getElementById("view").innerHTML = ""

document.getElementById("msg").innerHTML = msg

} // end if
} // end function

And in the onload event:
CheckNoDocuments()

Correction

MessagePublié: 03 Nov 2006 à 10:10
par ric76490
<div id="msg">
</div>
Create here a $$ViewBody field
<div id="view">
</div>



Introduire le $$viewBody entre les balises div dont l'ouvrante a l'id "view"

En anglais ça donne un truc comme ça :

Put the $$viewBody field into the "view" div tags.


Résultat / Result :

<div id="msg">
</div>
<div id="view">
Create here a $$ViewBody field
</div>



En effet, la fonction javascript récupère les données introduites par le div dont l'id est "view". Dans le cas précédent, elle récupérait dans tous les cas une chaine vide, donc son traitement s'arrêtait aussi tôt.
Ainsi, dans le cas où il n'existe aucun document, 'No documents founds' sera bien entouré par le div id="view", et la fonction javascript saura alors quoi faire, parce qu'elle est intelligente la fonction javascript !

In english : get a social translator :x

J'ai du travail namého, pas le temps de traduire ; en espérant que mon message serve un de ces jours ..!


Bonne journée