regarding the right click disabling

hi guys,

i am asking this question specifically this time because i tried hardly to add this small function to my scriptcase application (form and grid) but failed, i don’t know exactly where to put the code or if i am using the correct code or not, please help in telling me the steps required for me to make the right click disabled (without a message) in all applications that i do with sc, i would like some details, because all java resources sites says something like this: put this in the header, put this in the body, put this in the footer…etc but in sc it is not easy to determine and follow that exactly, so anybody could do that please advise, thanks in advanced

Mike

[QUOTE=itsme3;23435]hi guys,

i am asking this question specifically this time because i tried hardly to add this small function to my scriptcase application (form and grid) but failed, i don’t know exactly where to put the code or if i am using the correct code or not, please help in telling me the steps required for me to make the right click disabled (without a message) in all applications that i do with sc, i would like some details, because all java resources sites says something like this: put this in the header, put this in the body, put this in the footer…etc but in sc it is not easy to determine and follow that exactly, so anybody could do that please advise, thanks in advanced

Mike[/QUOTE]

Tools->Layouts->Templates

Choose template you are using (example, light) and add this code at top.

<script language=JavaScript>
<!--

//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

var message="Function Disabled!";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")

// --> 
</script>

Save templae with other name (to not overwrite base theme).

Tools->Express Edit
Choose All - Next
Apply to all applications + Template- Next
Model for Header-> Yes + Public + NameOfYourTemplate
Apply

Generate all youre apps again.

Captura.JPG

yes this finally worked, thanks

but i couldn’t make the same work on search results and teh chart, any idea why? there is no way to change the template to have it as the new one i created (the one which has javascript and disables the right click) there is in grid and in the search cretira screen, but not in the search results nor in summary nor in chart

any idea how to disable the right click there as well?

Search has it’s own Layout configuration. Try with it.

About chart don’t know exactly, and don’t have right now ScriptCase in front of me to try.

Captura.JPG

yes, in search the one you posted there is no place to select the new template that has in header the javascript which is disabling the right click!!

I’m speaking from memory, but I think I saw it. I will check

alright, for my current project, i have modified the templates to have the one i have the js with it to disable the right click, it is working fine… not with all, not with charts, not with search results, but basically almost is ok…

but, what i wounder is after few applications that work fine, i’ve copied one of them to make a modification for it and point it to another table…etc… although i choose the template (the same one which has the js in header and should disable the right click) but doesn’t work, i tried to re-deploy it again, selected the template again, did whatever possible, but no chance! i checked the code and found that the first applications has the disable code in page source but in the later one doesn’t have this code… i did the express edit, i created a new header template and applied, but noway, it still doesn’t work, right click works ok… can’t understand why the header template is not updated for those late applications, even they were copied from the first applications and also double checked that having the same template that it has js in it!!!

any idea is appreciated, just don’t tell me to create the applications from scratch, because that works, but i can’t, it takes too long? and it is supposed to work if selected the same template that works for other applications right!?

please hint