Forum OpenACS Development: AjaxHelper seems to not working on Internet Explorer

Hello,

I have done some modifications in File Storage using AjaxHelper. E.g.I am displaying tree view of file-system.
I used contextmenu API for generating right click.

Those are working fine on Mozilla but not on Internet Explorer 6. Can anybody tell me why this is the case?

Is any dependency that AjaxHelper only works on Mozilla?

Regards,
-Amruta

Collapse
Posted by Hamilton Chua on
Hello Amruta,

It actually depends on how you use the contextmenu API.

Can you post some code or point me to a page where you are seeing this problem ?

Every time I debug javascript on IE, I am constantly reminded of why I once abhorred javascript 😉

Best,

Hamilton

Collapse
Posted by Amruta Lakade on
Hello ,
Following is my code wriiten for displaying Right-Click menu.

menulist_folder is a list of operations which i need to display in Right Click.

set menu_folder_id "document.getElementsByName('folder')"

ah::yui::contextmenu \
-varname "ContextMenuFolder" \
-id "contextmenu_folder" \
-menulist $menulist_folder \
-triggerel $menu_folder_id

Please let me know if I am mistaking in using the Apis.
Best Regards,
Amruta

Collapse
Posted by Hamilton Chua on
Amruta,

I think you'll need to give me a little more to work on.

This looks like the tcl side of your code. What does the adp file look like ?

Are you using openacs 5.4 with template::head ?
Does IE return a javascript error ?

It would be great if there's a page I can visit somewhere where you are experiencing this problem.

Thanks,

Hamilton

Collapse
Posted by Amruta Lakade on
Hello,
Sorry for not giving sufficient information of the Problem.
Above was the tcl part of file.

In the adp part instead of using listtemplate tag,I am using the using grid tag to display elements of the list. And given name as 'folder' to the a tag.

I am using OpenAcs 5.3 with template::head.

Is there any problem in using OpenAcs 5.3?

Best Regards,
Amruta

Collapse
Posted by Hamilton Chua on
Hi,

It should be ok to use OpenACS 5.3 with template::head.

I'm guessing since you said this works on Mozilla but fails on IE there must be some sort of javascript error on IE.

Can you check the lower left corner of your IE window if there is a yellow icon ? A yellow icon usually suggests a javascript error.

Another possibility that it's not working on IE is that you have other javascript on the page that's interfering with IE.

When you load the page on your browser, there is an option to view source, can you send me that.

Thanks,

Hamilton

Collapse
Posted by Amruta Lakade on
Hi Hamilton,

Yes,I have some jscript code in  the same file.I check it on IE the page loads with error(shows yellow icon).

Following is my source code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
    <title>My Documents</title>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta name="generator" content="OpenACS version 5.3.2">
    <link rel="stylesheet" href="/resources/acs-subsite/qualserve.css" type="text/css" media="all">
    <link rel="stylesheet" href="/resources/acs-templating/forms.css" type="text/css" media="all">
    <link rel="stylesheet" href="/resources/acs-templating/lists.css" type="text/css" media="all">
    <link rel="stylesheet" href="/resources/ajaxhelper/ext/resources/css/xtheme-vista.css" type="text/css" media="all">
    <link rel="stylesheet" href="/resources/ajaxhelper/ext/resources/css/ext-all.css" type="text/css" media="all">
  <script type="text/javascript" src="/resources/ajaxhelper/overlibmws/overlibmws.js"></script>
  <script type="text/javascript" src="/resources/acs-subsite/core.js"></script>
  <script type="text/javascript" src="/resources/ajaxhelper/ext/adapter/ext/ext-base.js"></script>
  <script type="text/javascript" src="/resources/ajaxhelper/prototype/prototype.js"></script>
  <script type="text/javascript" src="/resources/ajaxhelper/scriptaculous/scriptaculous.js"></script>
  <script type="text/javascript" src="/resources/ajaxhelper/ext/ext-all.js"></script>
<script language="javascript" type="text/javascript">YAHOO_config = { load: { require: ['dom','treeview','event','menu','container'], base: '/resources/ajaxhelper/yui/', onLoadComplete: function(loader) { ah_page_init() } } } </script><script src='/resources/ajaxhelper/yui/yuiloader/yuiloader-beta-min.js'></script><script language="javascript" type="text/javascript">

function ah_page_init () { YAHOO.util.Dom.addClass(document.body,"yui-skin-sam"); YAHOO.util.Event.addListener(window,"load",function  () { var tree = new YAHOO.widget.TreeView("folders"); var treeroot = tree.getRoot(); var od6466 = {label: "root", id: "6466", href: "index?folder_id=6466"}; var node = treeroot; var nd6466 = new YAHOO.widget.TextNode(od6466,node,false); var od41067 = {label: "IE", id: "41067", href: "index?folder_id=41067"}; var node = tree.getNodeByProperty('id','6466'); if ( node == null ) { var node = nd6466; } var nd41067 = new YAHOO.widget.TextNode(od41067,node,false); var od6471 = {label: "New Fol", id: "6471", href: "index?folder_id=6471"}; var node = tree.getNodeByProperty('id','6466'); if ( node == null ) { var node = nd6466; } var nd6471 = new YAHOO.widget.TextNode(od6471,node,false); var od41061 = {label: "NameOfFile", id: "41061", href: "C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Water lilies.jpg"}; var node = tree.getNodeByProperty('id','6466'); if ( node == null ) { var node = nd6466; } var nd41061 = new YAHOO.widget.TextNode(od41061,node,false); var od40010 = {label: "google", id: "40010", href: "http://www.google.com"}; var node = tree.getNodeByProperty('id','6466'); if ( node == null ) { var node = nd6466; } var nd40010 = new YAHOO.widget.TextNode(od40010,node,false); var od40005 = {label: "Image1", id: "40005", href: "/home/alakade/Desktop/Images/b3t.jpg"}; var node = tree.getNodeByProperty('id','6466'); if ( node == null ) { var node = nd6466; } var nd40005 = new YAHOO.widget.TextNode(od40005,node,false); var od6472 = {label: "Trash", id: "6472", href: "index?folder_id=6472"}; var node = tree.getNodeByProperty('id','6466'); if ( node == null ) { var node = nd6466; } var nd6472 = new YAHOO.widget.TextNode(od6472,node,false); var od41065 = {label: "Winter", id: "41065", href: "C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Winter.jpg"}; var node = tree.getNodeByProperty('id','6471'); if ( node == null ) { var node = nd6471; } var nd41065 = new YAHOO.widget.TextNode(od41065,node,false); var od6470 = {label: "Gmail", id: "6470", href: "http://www.gmail.com"}; var node = tree.getNodeByProperty('id','6472'); if ( node == null ) { var node = nd6472; } var nd6470 = new YAHOO.widget.TextNode(od6470,node,false); tree.draw();  });
YAHOO.util.Event.addListener(window,"load",function  () { var ContextMenuFolder = new YAHOO.widget.ContextMenu("contextmenu_folder", { trigger: document.getElementsByName('folder') } ); ContextMenuFolder.addItems([{"text":"<a href=javascript:void(0) class=link onClick=Ext.Msg.show({minWidth:350,closable:true,prompt:true,msg:'Rename',buttons:Ext.Msg.OKCANCEL,fn:folder_rename_form,value:new_var});  id=rename_ajax_file>Rename</a>"},{"text":"<a href=javascript:void(0) class=link  onClick=styledPopupOpen('move') id=file_copy>Move</a>"},{"text":"Save To Disk","url":"javascript:window.open(url_savetodisk_folder,'main');"},{"text":"<a href=javascript:void(0) class=link onClick=styledPopupOpen('copy') id=file_copy>Copy</a>"},{"text":"Permissions","url":"javascript:open_window(url_permission_folder,1);"},{"text":"<a href=javascript:void(0) class=link onClick=Ext.Msg.show({minWidth:350,closable:true,msg:msg1,buttons:Ext.Msg.OKCANCEL,fn:folder_delete_form});  id=delete_ajax>Move To Trash</a>"}]); ContextMenuFolder.render(document.body);  });
YAHOO.util.Event.addListener(window,"load",function  () { var ContextMenuFile = new YAHOO.widget.ContextMenu("contextmenu_file", { trigger: document.getElementsByName('file') } ); ContextMenuFile.addItems([{"text":"<a href=javascript:void(0) class=link onClick=Ext.Msg.show({minWidth:350,closable:true,prompt:true,msg:'Rename',buttons:Ext.Msg.OKCANCEL,fn:file_rename_form});  id=rename_ajax_file>Rename</a>"},{"text":"<a href=javascript:void(0) class=link onClick=styledPopupOpen('copy') id=file_copy>Copy</a>"},{"text":"<a href=javascript:void(0) class=link onClick=styledPopupOpen('move') id=file_copy>Move</a>"},{"text":"properties","url":"javascript:open_window(url_properties_file,0);"},{"text":"Save To Disk","url":"javascript:window.open(url_savetodisk_file,'main');"},{"text":"Permissions","url":"javascript:open_window(url_permission_file,1);"},{"text":"<a href=javascript:void(0) class=link onclick=show_file_div() id=file_copy>New Version</a>"},{"text":"<a href=javascript:void(0) class=link onClick=Ext.Msg.show({minWidth:350,closable:true,msg:msg1,buttons:Ext.Msg.OKCANCEL,fn:folder_delete_form});  id=delete_ajax>Move To Trash</a>"}]); ContextMenuFile.render(document.body);  });
YAHOO.util.Event.addListener(window,"load",function  () { var ContextMenuTrash = new YAHOO.widget.ContextMenu("contextmenu_trash", { trigger: 'trash' } ); ContextMenuTrash.addItems([{"text":"Open","url":"javascript:window.open(url_open_trash,'main');"},{"text":"Empty Recycle Bin","url":"javascript:window.open(url_empty_trash,'main');"}]); ContextMenuTrash.render('trash');  });
oMenu2 = new YAHOO.widget.Menu("basicmenu2",{}); oMenu2.addItems([{"text":"New File","url":"javascript:window.open(url_new_file,'main');"},{"text":"New Folder","url":"javascript:window.open(url_new_folder,'main');"},{"text":"New URL","url":"javascript:window.open(url_new_url,'main');"}]); oMenu2.render(document.getElementById('New_Menu_td')); YAHOO.util.Event.addListener('New_Menu',"click",function  (e) { YAHOO.util.Event.preventDefault(e);  oMenu2.show(); });
View_Menu = new YAHOO.widget.Menu("menu_view",{}); View_Menu.addItems([{"text":"Grid View","url":"javascript:window.open(url_grid_view,'main');"},{"text":"List View","url":"javascript:window.open(url_list_view,'main');"},{"text":"Detail View","url":"javascript:window.open(url_detail_view,'main');"}]); View_Menu.render(document.getElementById('View_Menu_td')); YAHOO.util.Event.addListener('View_Menu',"click",function  (e) { YAHOO.util.Event.preventDefault(e);  View_Menu.show(); });
YAHOO.util.Event.addListener(window,"load",function  () { var tree = new YAHOO.widget.TreeView("new"); var treeroot = tree.getRoot(); var od6466 = {label: "root", id: "6466", href: "javascript:return_object_id(6466);"}; var node = treeroot; var nd6466 = new YAHOO.widget.TextNode(od6466,node,false); var od6466 = {label: "My Documents", id: "6466", href: "javascript:return_object_id(6466);"}; var node = tree.getNodeByProperty('id','-100'); if ( node == null ) { var node = nd-100; } var nd6466 = new YAHOO.widget.TextNode(od6466,node,false); var od41067 = {label: "IE", id: "41067", href: "javascript:return_object_id(41067);"}; var node = tree.getNodeByProperty('id','6466'); if ( node == null ) { var node = nd6466; } var nd41067 = new YAHOO.widget.TextNode(od41067,node,false); var od6471 = {label: "New Fol", id: "6471", href: "javascript:return_object_id(6471);"}; var node = tree.getNodeByProperty('id','6466'); if ( node == null ) { var node = nd6466; } var nd6471 = new YAHOO.widget.TextNode(od6471,node,false); var od41061 = {label: "NameOfFile", id: "41061", href: "javascript:return_object_id(41061);"}; var node = tree.getNodeByProperty('id','6466'); if ( node == null ) { var node = nd6466; } var nd41061 = new YAHOO.widget.TextNode(od41061,node,false); var od40010 = {label: "google", id: "40010", href: "javascript:return_object_id(40010);"}; var node = tree.getNodeByProperty('id','6466'); if ( node == null ) { var node = nd6466; } var nd40010 = new YAHOO.widget.TextNode(od40010,node,false); var od40005 = {label: "Image1", id: "40005", href: "javascript:return_object_id(40005);"}; var node = tree.getNodeByProperty('id','6466'); if ( node == null ) { var node = nd6466; } var nd40005 = new YAHOO.widget.TextNode(od40005,node,false); var od6472 = {label: "Trash", id: "6472", href: "javascript:return_object_id(6472);"}; var node = tree.getNodeByProperty('id','6466'); if ( node == null ) { var node = nd6466; } var nd6472 = new YAHOO.widget.TextNode(od6472,node,false); var od41065 = {label: "Winter", id: "41065", href: "javascript:return_object_id(41065);"}; var node = tree.getNodeByProperty('id','6471'); if ( node == null ) { var node = nd6471; } var nd41065 = new YAHOO.widget.TextNode(od41065,node,false); var od6470 = {label: "Gmail", id: "6470", href: "javascript:return_object_id(6470);"}; var node = tree.getNodeByProperty('id','6472'); if ( node == null ) { var node = nd6472; } var nd6470 = new YAHOO.widget.TextNode(od6470,node,false); tree.draw();  });
}

</script>
</head>
<body>

<link rel="stylesheet" type="text/css" href="qualserve.css" >

<!-- Header -->

<div id="site-header">
  <div class="system-name">
    <a href="http://qualserveimg2:8000">Qualserve2</a>
<!--    <img style="align:left;margin-left:960px;" src="/resources/acs-subsite/logo.gif" alt="sdsssdf"> -->
  </div>

  <div class="action-list permanent-navigation">
    <ul>

        <li><a href="/pvt/home" title="Change password, email, portrait">Your Account</a></li>

        <li><a href="/register/logout" title="Logout from Qualserve2">Logout</a></li>

    </ul>
  </div>

  <div class="action-list users-online">
    <ul>
      <li><a href="/shared/whos-online">1 Member Online</a></li>
    </ul>
  </div>

  <div class="user-greeting">

      Welcome, User1 User

  </div>

</div>

<div id="context-bar">

      <div class="breadcrumbs">
        <ul>

            <li><a href="/">Main Site</a> &#187;</li>

              <li>My Documents</li>

              <li></li>

        </ul>
      </div>

  <div style="clear: both;"></div>
</div>

<div id="workspace" >

<table width="100%"  bgcolor="#D6E9F8"  >
<tr>
<td valign=top  bgcolor="#FFFFFF" >
<html>
<title >Do u want to delete the item</title>
<script lang="javascript" >

<!--
window.name='main';
//-->
var msg1;
var maxX=640;
var maxY=640;
var xPos=0;
var yPos=0;
var file_id;
var file_size,file_name;
var body_flag=1;
var transaction_flag;
var current_object_is,current_object_name;
var title_to_display;
var new_version=0;
var new_var;
//Following vriables are for making the div element draggable plus the Opacity is used to give the window blurred BG while
//the focus is on Pop-up.

//Function to know current Operation selected and sets the header for Pop-Up with selected Object.

function styledPopupOpen(selected_oper) {

        document.getElementById('styled_popup_file_move').style.display="block";
        new Effect.Opacity('main_body_div',{ transition:Effect.Transitions.linear, from: 1.0, to: 0.5 });
    transaction_flag=selected_oper;
    var object=document.getElementsByName('folder_id').value;

        if (current_object_is == 41067) {

                    if (transaction_flag == 'move' ) {
                    document.getElementById('set_title').innerHTML="<p align=center>Move:IE</p>";
                    }
                    else    {
                    document.getElementById('set_title').innerHTML="<p align=center>Copy:IE</p>";
                    }


        }

        if (current_object_is == 6471) {

                    if (transaction_flag == 'move' ) {
                    document.getElementById('set_title').innerHTML="<p align=center>Move:New Fol</p>";
                    }
                    else    {
                    document.getElementById('set_title').innerHTML="<p align=center>Copy:New Fol</p>";
                    }


        }

        if (current_object_is == 6472) {

                    if (transaction_flag == 'move' ) {
                    document.getElementById('set_title').innerHTML="<p align=center>Move:Trash</p>";
                    }
                    else    {
                    document.getElementById('set_title').innerHTML="<p align=center>Copy:Trash</p>";
                    }


        }

        if (current_object_is == 41061) {

                    if (transaction_flag == 'move' ) {
                    document.getElementById('set_title').innerHTML="<p align=center>Move:NameOfFile</p>";
                    }
                    else    {
                                        document.getElementById('set_title').innerHTML="<p align=center>Copy:NameOfFile</p>";
                                        }


        }

        if (current_object_is == 40010) {

                    if (transaction_flag == 'move' ) {
                    document.getElementById('set_title').innerHTML="<p align=center>Move:</p>";
                    }
                    else    {
                                        document.getElementById('set_title').innerHTML="<p align=center>Copy:</p>";
                                        }


        }

        if (current_object_is == 40005) {

                    if (transaction_flag == 'move' ) {
                    document.getElementById('set_title').innerHTML="<p align=center>Move:Image1</p>";
                    }
                    else    {
                                        document.getElementById('set_title').innerHTML="<p align=center>Copy:Image1</p>";
                                        }


        }

}

//Function to close the Pop-Up and makes BG clear.

function styledPopupClose() {

document.getElementById("styled_popup_file_move").style.display = "none";
    new Effect.Appear('main_body_div',{});

}

function show_file_div () {
document.getElementById('styled_popup_file').style.display = 'block';
new_version=1;
}

//Function called from Create Folder Pop-Up.

function create_folder() {
var folder_name,url_create_folder,pretty_name,parent_id;
    folder_name=document.getElementById('name').value;
    pretty_name=folder_name;
  document.getElementById('create_folder_a').href="folder-create-ajax?parent_id=" + document.getElementById('parent_for_create').value + "&name=" + folder_name + "&pretty_name=" + pretty_name;
styledPopupClose();
}

//Function called from Create URL Pop-Up.

function create_url()    {
    document.getElementById('create_url_a').href="simple-add-2?folder_id=" + document.getElementById('folder_for_create_url').value + "&title=" + document.getElementById('url_title').value + "&description=" + document.getElementById('description').value + "&url=" + document.getElementById('url_value').value;

document.getElementById("styled_popup_url").style.display = "none";
}

//Function called from Add a New File Pop-Up.

function add_file_now() {
    if (new_version == 0) {
    document.getElementById('create_file_a').href="file-add-simple?folder_id=" + document.getElementById('folder_for_file_add').value + "&title=" + document.getElementById('title_file').value + "&description=" + document.getElementById('description_file').value + "&upload_file=" + document.getElementById('upload_file').value;
    }
    if (new_version == 1) {
        document.getElementById('create_file_a').href="file-add-simple?new_version=1&folder_id=" + document.getElementById('folder_for_file_add').value + "&title=" + document.getElementById('title_file').value + "&description=" + document.getElementById('description_file').value + "&upload_file=" + document.getElementById('upload_file').value;
        }
    document.getElementById("styled_popup_file").style.display = "none";

}

//Function called from Upload Compressed Folder Pop-Up.

function compressed_folder() {

    document.getElementById('compressed_folder_a').href="simple-folder-zip-add?flag=1&folder_id=" + document.getElementById('folder_for_compressed').value + "&title=" + document.getElementById('title_compressed').value + "&upload_file=" + document.getElementById('name_compressed').value;

}


/*  function load(url) {
var load = window.open('','','scrollbars=no,menubar=no,height=600,width=800,resizable=yes,toolbar=no,location=no,status=no');
//alert(url);
} */

function window_upload() {
url_upload="folder-zip-add?folder_id=" + document.getElementById('folder_for_compressed').value ;
newwindow=window.open(url_upload,'main',"width=450,height=170,left=150,top=200");

}


var newwindow;
//Function to show the Properties and Permissions of a File.

function open_window(url,flag)
{
    if (flag == 0 ) {
    newwindow=window.open(url,'name',"width=450,height=170,left=150,top=200");
    if (window.focus) {newwindow.focus()}
    }
    else    //permissions
    {
     newwindow=window.open(url,'name',"width=650,height=500,left=150,top=200");
        if (window.focus) {newwindow.focus()}
    }

}

//Function which creates URL to go to selected operation with selected object

function return_object_id(parent_id_temp)
{
    if(transaction_flag == 'copy')    {
    window.location.href="copy?folder_id=" + parent_id_temp + "&object_id=" + document.getElementById('styled_popup_file_move').name;
    }
    if(transaction_flag == 'move') {
    window.location.href="move?folder_id=" + parent_id_temp + "&object_id=" + document.getElementById('styled_popup_file_move').name;
    }

}

//Function to set selected object_id in order to use at various places.

function set_object_id(object_id) {

document.getElementById('styled_popup_file_move').name=object_id;
}

//Main Function which does most of the things. Firstly it sets current selected object id. Second prepares list for Context-Menu depending //upon the object_type.

function ContextMenuVal(object_id,object_type,object_name)
{
document.getElementsByName('folder_id').value=object_id;
document.getElementById('folder_id_rename').value=object_id;
document.getElementById('file_id_rename').value=object_id;
document.getElementById('file_id').value=object_id;
document.getElementById('object_id').value=object_id;
document.getElementById('current_object_name').value=object_name;
msg1 = 'Do You really want to delete ' + object_name + '?';
//alert(object_name);
new_var=object_name;

current_object_is=object_id;

//Query to fetch values from database and prepares Tree used at the Move.Copy Pop-Up.




    if (object_type == 1) {
//Object type is folder
//Prepare a list for menu list and call YUI contextmenu api.

      url_rename_folder="folder-edit?object_id=" + object_id;
      url_move_folder="file-move?file_id=" + object_id;
      url_savetodisk_folder="./download-archive/index?object_id=" + object_id;
      url_permission_folder="permissions?object_id=" + object_id;
      url_movetotrash_folder="file-move-2?move_flg=1&file_id=" + object_id;
          url_restore_folder="file-move-2?restore_flg=1&move_flg=2&file_id=" + object_id;
    object_id_current=document.getElementsByName("try");



    }
    if (object_type == 0) {
//Object type is file
//Prepare a list for menu list and call YUI contextmenu api

      url_rename_file="file-edit?object_id=" + object_id;
      url_copy_file="file-copy?file_id=" + object_id;
      url_move_file="file-move?file_id=" + object_id;
      url_properties_file="file?object_id=" + object_id;
      url_savetodisk_file="./download/?file_id=" + object_id;
      url_permission_file="permissions?object_id=" + object_id;
      url_newversion_file="file-add?file_id=" + object_id;
      url_movetotrash_file="file-move-2?move_flg=1&file_id=" + object_id;
      url_restore="file-move-2?restore_flg=1&move_flg=1&file_id=" + object_id;


    }
    if (object_type == 2) {
//Object_type is folder only but it is Trash. A list for trash.
            url_open_trash="index?ajax_flag=0&trash_flag=1&object_id=" + object_id;
            url_empty_trash="empty-trash?trash_flag=1&folder_id=" + object_id;


    }
}

function NewObjectVal(current_parent_folder)
{

url_new_file="file-add?folder_id=" + current_parent_folder;
url_new_folder="folder-create?parent_id=" + current_parent_folder;
url_new_url="simple-add?folder_id=" + current_parent_folder;

}





function ViewObjectVal(current_folder)
{

url_grid_view="index?ajax_flag=1&view_flag=0&folder_id=" + current_folder;
url_list_view="index?ajax_flag=1&view_flag=1&folder_id=" + current_folder;
url_detail_view="index?ajax_flag=1&view_flag=2&folder_id=" + current_folder;

}


//Function to get selected checked item while in detail view and do the requested actions
function bulk_actions()
{
                var url_values,checked_count=0,url_values_flag=0;
                count = document.documents.elements.length;
                for (i=0; i < count; i++)
                  {
                    if(document.documents.elements[i].checked == 1)
                        {
                                checked_last_id=document.documents.elements[i].id;
                        }
                  }

                for (i=0; i < count; i++)
                  {
                    if(document.documents.elements[i].checked == 1)
                        {
                                if (document.documents.elements[i].id != 'select_all_chk_box')
                                        {
                if(document.documents.elements[i].type == 'checkbox')
                    {
                                        if(checked_last_id !=document.documents.elements[i].id)
                                          {
                                                        if(url_values_flag == 0)
                                                        {
                                                          url_values=document.documents.elements[i].id + " &object_id=";
                                                                url_values_flag=1;
                                                        }
                                                        else
                                                        {
                                                                url_values += document.documents.elements[i].id + " &object_id=";
                                                        }
                                          }
                                        else
                                          {
                                        url_values += document.documents.elements[i].id;
                                          }
                                        }
                  }
                        }
                  }
                document.getElementById('delete').href="delete?object_id=" + url_values;
                document.getElementById('copy_all').href="copy?object_id=" + url_values;
                document.getElementById('move_all').href="move?object_id=" + url_values;
}

//Function which Check/Uncheck  checkboxes!
function select_all_chkbox()
{

                        count = document.documents.elements.length;
                            for (i=0; i < count; i++)
                        {
                    if(document.documents.elements[i].checked == 1)
                        {
                                document.documents.elements[i].checked = 0;
                                document.getElementById('select_all_chk_box').checked=0;
                        }
                    else {
                                document.documents.elements[i].checked = 1;
                        document.getElementById('select_all_chk_box').checked=1;
                          }
                        }

}



function folder_rename_form(btn,text)
{
    if (btn == 'ok')
    {
    document.getElementById('folder_name').value=text;
    document.document_rename.action="folder-edit-2";
    //alert(document.document_rename.action);
    document.document_rename.submit();
    }
    else
    {
    }
}

function file_rename_form(btn,text)
{
    if (btn == 'ok')
        {
    document.getElementById('title').value=text;
    document.document_rename_file.action="file-edit-2";
    document.document_rename_file.submit();
    }
        else
        {
        }

}

function folder_delete_form(btn,text)
{
        if (btn == 'ok')
        {
     document.document_delete_folder.action="file-move-2";

        document.document_delete_folder.submit();
        }
        else
        {
        }
}

function folder_delete_form_permanet(btn,text) {
     if (btn == 'ok')
        {
        document.document_delete_permanent.action="delete";

        document.document_delete_permanent.submit();
        }
        else
        {
        }

}

function set_object() {
object_id_current=document.getElementById('styled_popup_file_move').name;

document.getElementById('styled_popup_file_move').style.display = 'block';
document.getElementById('styled_popup_file_move').innerHTML='<object type="text/html" id="object_dyna" data=permissions?object_id='+ object_id_current +' width="600" height="500"></object>';

}

function url_download() {

window.location.href="./download-archive/index?object_id=6466";

}

function refresh_window() {

  window.location.href='index?folder_id=6472';

}


</script>

<form name="document_rename">
<input type="hidden" name="folder_id" id="folder_id_rename" >
<input type="hidden" name="folder_name" id="folder_name" >
</form>

<form name="document_delete_folder">
<input type="hidden" name="parent_id" id="parent_id" value=6472>
<input type="hidden" name="file_id" id="file_id" >
</form>

<form name="document_rename_file">
<input type="hidden" name="file_id" id="file_id_rename" >
<input type="hidden" name="title" id="title" >
</form>

<form name="document_delete_permanent">
<input type="hidden" name="object_id" id="object_id" >
</form>

<div id="main_body_div">
<body id=main_body >
<input type="hidden" id="current_object_name">

<div id="div_for_ajax">
<form name="documents" id="docs">
<input type="hidden" id="doc_hiiden" name="doc_hidden">
<table>

<tr><td colspan=3>

<h1 class="page-title" >My Documents</h1>

</td></tr>
<tr>

<!-- <td id="New_Menu_td"><a href="javascript:void(0)" id="New_Menu" onmouseover="javascript:NewObjectVal(6466);">New<img src="/resources/file-storage/drop-down-icon.gif" border=0 height="10" width="10"/></td> -->

<td>
<div id="styled_popup_file" name='styled_popup_file' style='width: 380px; height: 300px; display:none; position: absolute; top: 250px; right: 250px;'>
        <table width='380' cellpadding='0' cellspacing='0' BGCOLOR='#EEEEEE' border='3' BORDERCOLOR="#0000CC" RULES=NONE FRAME=BOX>
        <tr>
        <td><img height='23' width='376' src='/resources/file-storage/x11_title.gif'></td>
        <td><a href='javascript:void(0)' onClick="document.getElementById('styled_popup_file').style.display = 'none'"><img height='23' wid th='24' src='/resources/file-storage/x11_close.gif' border='0'></a></td>
        </tr>
    <tr><td></td></tr>
    <tr><td>
        <form name="add_file_form"  id="add_file">
        <p><br>
                Upload File:<input type=file name="upload_file" id="upload_file"><p><br>
                Title:<input type=text name="title_file" id="title_file"><p><br>
                Description:<textarea name="description_file" id="description_file" cols="50" rows="5"></textarea>
                <input type=hidden name="folder_id_file_add" id="folder_for_file_add" value=6466><p><br>
                <a href="javascript:void(0)" id="create_file_a" onclick="javascript:add_file_now();" class="link">Ok</a>
        </form>
        </td></tr>
        </table>
</div>

<a  class=link  href="javascript:void(0)" onClick="document.getElementById('styled_popup_file').style.display = 'block'" id=f-add title="Upload a file in this folder" ><img width=20 hieght=20 src="/resources/file-storage/new-file.png" border=0>New File</a>

<div id="styled_popup_url" name='styled_popup_url' style='width: 380px; height: 300px; display:none; position: absolute; top: 250px; right: 250px;'>
    <table width='380' cellpadding='0' cellspacing='0' BGCOLOR='#EEEEEE' border='3' BORDERCOLOR="#0000CC" RULES=NONE FRAME=BOX>
    <tr>
    <td><img height='23' width='376' src='/resources/file-storage/x11_title.gif'></td>
    <td><a href='javascript:void(0)' onClick="document.getElementById('styled_popup_url').style.display = 'none'"><img height='23' width='24' src='/resources/file-storage/x11_close.gif' border='0'></a></td>
    </tr>
    <tr><td></tr></td>
    <tr><td>
    <form name="create_url_form"  id="create_url">
        <p><br>
        Title:<input type=text name="url_title" id="url_title"><p><br>
        URL:<input type=text name="url_value" id="url_value" value="http://"><p><br>
        Description:<textarea name="description" id="description" cols="50" rows="5"></textarea>
        <input type=hidden name="folder_id_url" id="folder_for_create_url" value=6466><p><br>
    <center><a href="javascript:void(0)" id="create_url_a" onclick="javascript:create_url();" class="link">Create</a></center>
    </form>
    </td></tr>
    </table>
</div>

<a  class=link href="javascript:void(0)" id=url-add  onClick="document.getElementById('styled_popup_url').style.display = 'block'" title="Add a link to a web page in this folder"><img width=20 hieght=20 src="/resources/file-storage/new-url.png" border=0>New URL</a>

<div id='styled_popup' name='styled_popup' style='width: 380px; height: 300px; display:none; position: absolute; top: 250px; right: 250px;'>
    <table width='380' cellpadding='0' cellspacing='0' BGCOLOR='#EEEEEE' border='3' BORDERCOLOR="#0000CC" RULES=NONE FRAME=BOX>
    <tr>
    <td><img height='23' width='356' src='/resources/file-storage/x11_title.gif'></td>
    <td><a href='javascript:void(0);' onClick="document.getElementById('styled_popup').style.display = 'none'"><img height='23' width='24' src='/resources/file-storage/x11_close.gif' border='0'></a></td>
    </tr>
    <tr><td></tr></td>
        <tr><td>
    <form name="create_folder_form"  id="create_folder">
        <p><br>
        Name:<input type=text name="name" id="name"><p><br>
        <input type=hidden name="pretty_name" id="pretty_name"><p><br>
        <input type=hidden name="parent_id" id="parent_for_create" value=6466>
        <a href="javascript:void(0)" id="create_folder_a" onclick="javascript:create_folder();" class="link">Ok</a>
    </form>
    </td></tr>
    </table>
</div>

<a class=link href="javascript:void(0)" id=url-add onClick="document.getElementById('styled_popup').style.display = 'block'" title="Create a new folder"  ><img src="/resources/file-storage/new-folder.png" border=0 width=20 hieght=20>New Folder</a></td>

<td id="dwn_td">&nbsp;<a href="javascript:void(0)" onclick="javascript:url_download()" id=dwn shape=rectangle  title="Download an archive of the contents of this folder"><img src="/resources/file-storage/download.png" border=0> </a></td>

<td id="upld_td">&nbsp;<a class=link href="javascript:void(0)" id=url-add onclick="window_upload();"  title="Upload a compressed folder that will be unzipped as it was."><img src="/resources/file-storage/upload.png" border=0></a></td>

<!-- <td id="View_Menu_td"><a href="javascript:void(0)" id="View_Menu" onmouseover="javascript:ViewObjectVal(6466);">View<img src="/resources/file-storage/drop-down-icon.gif" border=0 height="10" width="10"/></a></td> -->

<td>&nbsp;<a href=index?folder_id=6466&view_flag=1 id=lst_view  title="List View"><img src="/resources/file-storage/list.png" border=0  > </a>

&nbsp;<a href=index?folder_id=6466&view_flag=0 id=grd_view  title="Grid View"><img src="/resources/file-storage/grid.png" border=0> </a>

&nbsp;<a href=index?folder_id=6466&view_flag=2 id=grd_view title="Detail View"><img src="/resources/file-storage/dtls.png" border=0> </a> </td>
</tr>
</table>

&nbsp;<a href="javascript:void(0)" id="trash" onclick="javascript:refresh_window(); "  name="trash" title="Recycle Bin" onmouseover="javascript:ContextMenuVal(6472,2,"");"><img src="/resources/file-storage/Trash.png" border=0 align=right> </a>

<hr color="#D6E9F8">






  <table id="main-tbl" cellpadding=5 cellspacing=5 border=0 bgcolor=#FFFFFF  >


    <!-- Begin row -->
    <tr>


  <!-- Cell layout -->
    <!-- Cells may be unoccupied at the end. -->



  <td  id="main-td" >

<a id="41067" name="folder" class="link" border=1 href="index?folder_id=41067" onmouseover="javascript:ContextMenuVal(41067,1,'IE');" onmouseover="return overlib('IE, 0&nbsp;items, /my-documents-2/index?folder%5fid=41067',TEXTSIZE,'2',FGCOLOR,'#DDDDDD',WIDTH,'70');" onmouseout="nd();" onmousedown="javascript:set_object_id(41067);">

    <img src="/resources/file-storage/folder.png" border=0  >

              IE

         0&nbsp;items

</a>
</a>

  </td>

    <!-- if  trash -->



  <!-- End cell layout -->



  <!-- Cell layout -->
    <!-- Cells may be unoccupied at the end. -->



  <td  id="main-td" >

<a id="6471" name="folder" class="link" border=1 href="index?folder_id=6471" onmouseover="javascript:ContextMenuVal(6471,1,'New Fol');" onmouseover="return overlib('New Fol, 1&nbsp;items, /my-documents-2/index?folder%5fid=6471',TEXTSIZE,'2',FGCOLOR,'#DDDDDD',WIDTH,'70');" onmouseout="nd();" onmousedown="javascript:set_object_id(6471);">

    <img src="/resources/file-storage/folder.png" border=0  >

              New Fol

         1&nbsp;items

</a>
</a>

  </td>

    <!-- if  trash -->



  <!-- End cell layout -->



  <!-- Cell layout -->
    <!-- Cells may be unoccupied at the end. -->
        <!-- if  trash -->



  <!-- End cell layout -->



  <!-- Cell layout -->
    <!-- Cells may be unoccupied at the end. -->



  <td  id="main-td" >

<a id="41061" name="file" href="/my-documents-2/view/C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Water lilies.jpg" class="link" onmouseover="javascript:ContextMenuVal(41061,0,'NameOfFile');" onmouseover="return overlib('NameOfFile, 4&nbsp;kb, /my-documents-2/view/C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Water lilies.jpg',TEXTSIZE,'2',FGCOLOR,'#DDDDDD',WIDTH,'70');" onmouseout="nd();" onmousedown="javascript:set_object_id(41061);">

        <img src="/resources/file-storage/jpeg.png" border=0  >

            NameOfFile

         4&nbsp;kb

</a>
</a>

  </td>

    <!-- if  trash -->



  <!-- End cell layout -->



  <!-- Cell layout -->
    <!-- Cells may be unoccupied at the end. -->



  <td  id="main-td" >

<a id="40010" name="file" href="http://www.google.com" class="link" onmouseover="javascript:ContextMenuVal(40010,0,'');" onmouseover="return overlib(', &nbsp;bytes, http://www.google.com',TEXTSIZE,'2',FGCOLOR,'#DDDDDD',WIDTH,'70';);" onmouseout="nd();" onmousedown="javascript:set_object_id(40010);">

        <img src="/resources/file-storage/url-button.png" border=0  >

              google

         &nbsp;bytes

</a>
</a>

  </td>

    <!-- if  trash -->



  <!-- End cell layout -->



  <!-- Cell layout -->
    <!-- Cells may be unoccupied at the end. -->



  <td  id="main-td" >

<a id="40005" name="file" href="/my-documents-2/view//home/alakade/Desktop/Images/b3t.jpg" class="link" onmouseover="javascript:ContextMenuVal(40005,0,'Image1');" onmouseover="return overlib('Image1, 4&nbsp;kb, /my-documents-2/view//home/alakade/Desktop/Images/b3t.jpg',TEXTSIZE,'2',FGCOLOR,'#DDDDDD',WIDTH,'70');" onmouseout="nd();" onmousedown="javascript:set_object_id(40005);">

        <img src="/resources/file-storage/jpeg.png" border=0  >

            Image1

         4&nbsp;kb

</a>
</a>

  </td>

    <!-- if  trash -->



  <!-- End cell layout -->



  <!-- Cell layout -->
    <!-- Cells may be unoccupied at the end. -->

      <!-- Placeholder to retain cell formatting -->
      &nbsp;


  <!-- End cell layout -->



  <!-- Cell layout -->
    <!-- Cells may be unoccupied at the end. -->

      <!-- Placeholder to retain cell formatting -->
      &nbsp;


  <!-- End cell layout -->


    <!-- End row -->
    </tr>

</table>
</else>
</div>
    </form>

</div>
</body>
</div>

</html>

<div id="styled_popup_compressed" name='styled_popup_compressed' style='width: 380px; height: 300px; display:none; position: absolute; top: 250px; right:
250px;'>
        <table width='380' cellpadding='0' cellspacing='0' BGCOLOR='#EEEEEE' border='3' BORDERCOLOR="#0000CC" RULES=NONE FRAME=BOX>
        <tr>
        <td><img height='23' width='356' src='/resources/file-storage/x11_title.gif'></td>
        <td><a href='javascript:void(0)' onClick="document.getElementById('styled_popup_compressed').style.display = 'none'"><img height='23' wid th='24' src='/resources/file-storage/x11_close.gif' border='0'></a></td>
        </tr>
    <tr><td></td></tr>
    <tr><td>
        <form name="add_file"  id="add_file">
        <p><br>
                Upload File:<input type=file name="name_compressed" id="name_compressed"><p><br>
                Title:<input type=text name="title_compressed" id="title_compressed"><p><br>
                <input type=hidden name="folder_for_compressed" id="folder_for_compressed" value=6466><p><br>
                <a href="javascript:void(0)" id="compressed_folder_a" onclick="javascript:compressed_folder();" class="link">Ok</a>
        </form>
        </td></tr>
        </table>
</div>

<div id="div_to_update">
</div>

<div id="styled_popup_file_move"  style=' width: 380px; height: 300px; display:none; position: absolute; top: 250px; right: 450px; ' >

<div style=" width:400px; height:400px; overflow:auto;">
<table width='380' id="pop_up_table" cellpadding='0' cellspacing='0'  BGCOLOR='#EEEEEE' border='3' BORDERCOLOR="#0000CC" RULES=NONE FRAME=BOX>
        <tr>
        <td><img height='23' width='356' src='/resources/file-storage/x11_title.gif'></td>
        <td><a href='javascript:void(0)' onClick="javascript:styledPopupClose()"><img height='23' wid th='24' src='/resources/file-storage/x11_close.gif' border='0'></a></td>
        </tr>
        <tr ><td><div id="set_title"></div> </td></tr>
    <tr><td>
        <div id="new"></div>
        </td></tr>
        <tr><td height=50></tr>
        </table>
</div>

</div>
<script language="javascript" type="text/javascript">
new Draggable ('styled_popup_file_move',{});
</script>
<script language="javascript" type="text/javascript">
new Draggable ('styled_popup_file',{});
</script>
<script language="javascript" type="text/javascript">
new Draggable ('styled_popup_url',{});
</script>
<script language="javascript" type="text/javascript">
new Draggable ('styled_popup',{});
</script>
<script language="javascript" type="text/javascript">
new Draggable ('trash',{});
</script>

<p><a href="/notifications/request-new?pretty%5fname=My+Documents&amp;return%5furl=%2fmy%2ddocuments%2d2%2f%3ffolder%5fid%3d6466&amp;type%5fid=728&amp;object%5fid=6466&amp;user%5fid=4629" title="Request Email notification when something is added to My Documents"><img src="/resources/acs-subsite/email_add.gif" alt="MESSAGE KEY MISSING: 'acs-subsite.icon_of_envelope'"> Request notifications</a></p>

</td></tr>
</table>
</div>

<div id="nav-bar" >

<!--

<table class="list-table" cellpadding="3" cellspacing="1"  summary="Data for applications">

    <thead>
      <tr class="list-header">

        <th class="list-table" id="applications_instance_name">



        </th>

        <th class="list-table" id="applications_icon">



        </th>

        <th class="list-table" id="applications_alt_icon">



        </th>

        <th class="list-table" id="applications_url_link">



        </th>

    </tr>
    </thead>



    <tbody>

              <tr class="odd">


              <td class="list-table" headers="applications_instance_name">
                <a href="/address-book-2/">Address Book</a>
              </td>

              <td class="list-table" headers="applications_icon">
                /resources/acs-subsite/address-book-2.gif
              </td>

              <td class="list-table" headers="applications_alt_icon">
                /resources/acs-subsite/default_app.gif
              </td>

              <td class="list-table" headers="applications_url_link">
                /address-book-2
              </td>

          </tr>


              <tr class="even">


              <td class="list-table" headers="applications_instance_name">
                <a href="/blogs/">Blogs</a>
              </td>

              <td class="list-table" headers="applications_icon">
                /resources/acs-subsite/blogs.gif
              </td>

              <td class="list-table" headers="applications_alt_icon">
                /resources/acs-subsite/default_app.gif
              </td>

              <td class="list-table" headers="applications_url_link">
                /blogs
              </td>

          </tr>


              <tr class="odd">


              <td class="list-table" headers="applications_instance_name">
                <a href="/calendar-2/">Calendar</a>
              </td>

              <td class="list-table" headers="applications_icon">
                /resources/acs-subsite/calendar-2.gif
              </td>

              <td class="list-table" headers="applications_alt_icon">
                /resources/acs-subsite/default_app.gif
              </td>

              <td class="list-table" headers="applications_url_link">
                /calendar-2
              </td>

          </tr>


              <tr class="even">


              <td class="list-table" headers="applications_instance_name">
                <a href="/forums-2/">Forums</a>
              </td>

              <td class="list-table" headers="applications_icon">
                /resources/acs-subsite/forums-2.gif
              </td>

              <td class="list-table" headers="applications_alt_icon">
                /resources/acs-subsite/default_app.gif
              </td>

              <td class="list-table" headers="applications_url_link">
                /forums-2
              </td>

          </tr>


              <tr class="odd">


              <td class="list-table" headers="applications_instance_name">
                <a href="/issue-tracker-2/">Issue Tracker</a>
              </td>

              <td class="list-table" headers="applications_icon">
                /resources/acs-subsite/issue-tracker-2.gif
              </td>

              <td class="list-table" headers="applications_alt_icon">
                /resources/acs-subsite/default_app.gif
              </td>

              <td class="list-table" headers="applications_url_link">
                /issue-tracker-2
              </td>

          </tr>


              <tr class="even">


              <td class="list-table" headers="applications_instance_name">
                <a href="/messaging/">Messaging</a>
              </td>

              <td class="list-table" headers="applications_icon">
                /resources/acs-subsite/messaging.gif
              </td>

              <td class="list-table" headers="applications_alt_icon">
                /resources/acs-subsite/default_app.gif
              </td>

              <td class="list-table" headers="applications_url_link">
                /messaging
              </td>

          </tr>


              <tr class="odd">


              <td class="list-table" headers="applications_instance_name">
                <a href="/my-documents-2/">My Documents</a>
              </td>

              <td class="list-table" headers="applications_icon">
                /resources/acs-subsite/my-documents-2.gif
              </td>

              <td class="list-table" headers="applications_alt_icon">
                /resources/acs-subsite/default_app.gif
              </td>

              <td class="list-table" headers="applications_url_link">
                /my-documents-2
              </td>

          </tr>


              <tr class="even last">


              <td class="list-table" headers="applications_instance_name">
                <a href="/notifications/">Notifications</a>
              </td>

              <td class="list-table" headers="applications_icon">
                /resources/acs-subsite/notifications.gif
              </td>

              <td class="list-table" headers="applications_alt_icon">
                /resources/acs-subsite/default_app.gif
              </td>

              <td class="list-table" headers="applications_url_link">
                /notifications
              </td>

          </tr>

</tbody>

</table>



-->

<p>

<table border=1>
<th height=60>Applications </th>

                <tr>

        <td>
              <a class="link" href="/address-book-2"><img height="20" width="20" border=0 src="/resources/acs-subsite/address-book-2.gif" alt="/resources/acs-subsite/default_app.gif"/>Address Book </a>
        </td>
                </tr>


                <tr>

        <td>
              <a class="link" href="/blogs"><img height="20" width="20" border=0 src="/resources/acs-subsite/blogs.gif" alt="/resources/acs-subsite/default_app.gif"/>Blogs </a>
        </td>
                </tr>


                <tr>

        <td>
              <a class="link" href="/calendar-2"><img height="20" width="20" border=0 src="/resources/acs-subsite/calendar-2.gif" alt="/resources/acs-subsite/default_app.gif"/>Calendar </a>
        </td>
                </tr>


                <tr>

        <td>
              <a class="link" href="/forums-2"><img height="20" width="20" border=0 src="/resources/acs-subsite/forums-2.gif" alt="/resources/acs-subsite/default_app.gif"/>Forums </a>
        </td>
                </tr>


                <tr>

        <td>
              <a class="link" href="/issue-tracker-2"><img height="20" width="20" border=0 src="/resources/acs-subsite/issue-tracker-2.gif" alt="/resources/acs-subsite/default_app.gif"/>Issue Tracker </a>
        </td>
                </tr>


                <tr>

        <td>
              <a class="link" href="/messaging"><img height="20" width="20" border=0 src="/resources/acs-subsite/messaging.gif" alt="/resources/acs-subsite/default_app.gif"/>Messaging </a>
        </td>
                </tr>


                <tr>

        <td>
              <a class="link" href="/my-documents-2"><img height="20" width="20" border=0 src="/resources/acs-subsite/my-documents-2.gif" alt="/resources/acs-subsite/default_app.gif"/>My Documents </a>
        </td>
                </tr>


                <tr>

        <td>
              <a class="link" href="/notifications"><img height="20" width="20" border=0 src="/resources/acs-subsite/notifications.gif" alt="/resources/acs-subsite/default_app.gif"/>Notifications </a>
        </td>
                </tr>

</table>

<!-- <div class="application nav-bar " id="tree_view" > </div> -->
<p>
<div id="folders"></div>
</div>

<div id="site-footer">
  <div class="action-list">

  </div>
Great India Consulting Services © 2008 QualEx Systems Pvt. Ltd.

</div>

</body>
</html>

Thanks for helping me.

Amruta

Collapse
Posted by Amruta Lakade on
Hi Hamilton,

I think you have confused with above code.So I am posting you the test script for Ajax ContextMenu.

The test file is properly working on Mozilla but not on IE 6.
When I try to run this on IE,it gives me error as :'Done with error on page'

The code is:
TCL part

set menulist1 { { { "text" "Yipeeeee" } { "onclick:" "javascript:alert('')" } } \
                { { "text" "Yahoo"} { "url" "http://www.yahoo.com"} } \
                { { "text" "Ask.com"} { "url" "javascript:alert('You clicked Ask.com')"} } }

ah::yui::contextmenu \
    -varname "oContextMenu" \
    -id "mycontextmenu" \
    -menulist $menulist1 \
    -triggerel "document"

ADP part:

<master>
<property name="title"> TEST : Yahoo Context Menu</property>
<p>Right click anywhere on this page
<div id="div_for_ajax">
</div>

Please reply me. I am stucked on the issue.
-Amruta

Collapse
Posted by Hamilton Chua on
Hi Amruta,

In your copy of AjaxHelper, can your replace the proc ah::yui::contextmenu in the file tcl/ajax-yahoo-procs.tcl with this

****************************
ad_proc -public ah::yui::contextmenu {
-varname:required
-id:required
-menulist:required
{-css ""}
{-options ""}
{-triggerel "document"}
{-renderin "document.body"}
} {
Generates the javascript to create a YUI context menu from a tcl list.
http://developer.yahoo.com/yui/menu/

@author Hamilton Chua (mailto:ham@solutiongrove.com)
@creation-date 2006-12-25

@param varname The javascript variable to represent the menu object.
@param menulist A list of lists with the parameters this script needs to generate your menu.
@param id The html id the menu element.
@param css Specify the full path to a css style sheet file to use an alternative to the menu.css that is used.
@param options Additional options that you want to pass to the javascript object constructor.
@param triggerel What element on the page which when right clicked will show the contextmenu
@param renderin The element on the html page where the menu will be rendered. Default is the body of the page.

} {

ah::yui::requires -sources "menu,container,overlay"

if { [exists_and_not_null css] } { template::head::add_css -href $css }

set jsonlist [ah::yui::menu_list_to_json -lists_of_pairs $menulist]

set initoptions "trigger: ${triggerel}, lazyload:true"
if { [exists_and_not_null options] } {
set options "${initoptions},${options}"
} else {
set options "${initoptions}"
}

append options ", itemdata: \[${jsonlist}\]"

set script "var $varname = new YAHOO.widget.ContextMenu(\"${id}\", { ${options} } ); "

global ajax_helper_init_scripts

append ajax_helper_init_scripts ${script}

}

****************************

I have to apologize, AjaxHelper isn't up to date anymore, Yahoo has already released 2.5.1 and it's still stuck with 2.3.0.

I'm going to try and find time to get it up to speed.

Please let me know if that fixes the problem for you.

Thanks,

Hamilton

Hi Hamilton,

I replaced the code of ah::yui::contextmenu by your code.
As usual it works on Mozilla but to get it work on IE it needs two refresh.

When page loads for the first time, the context menu doesn't appear whereas when i refresh the page, it appears.

Thanks for Coordination.
Please let me know the solution for above problem.

Regards,
-Amruta

Have you tried clearing your browser cache ?