Link to home
Start Free TrialLog in
Avatar of 1jaws
1jawsFlag for United States of America

asked on

dont want function to execute

function onButtonClicked(sender, args)
            {
                var commandName = args.get_item().get_commandName();
                if (commandName == "message")
                 {
                    onWindowLoad(<%= RadToolBar1.ClientID %>, ""); <-------what can I write here that wont throw and error on that function.. I need onWindowLoad  shouldnt execute if commandName is message...
                 }  
               
            }

            function onWindowLoad(sender, args)
            {              
                var html = "<br /><br /><br /><hr />" +
                                    "<strong>From:</strong> " + $get("from").innerHTML + "<br />" +
                                    "<strong>Sent:</strong> " + $get("sent").innerHTML + "<br />" +
                                    "<strong>Subject:</strong> " + $get("subject").innerHTML + "<br />" +
                                    $get("message-body").innerHTML;
                sender.get_contentFrame().contentWindow.setEditorContent(html);                
            }
Avatar of leakim971
leakim971
Flag of Guadeloupe image

> I need onWindowLoad  shouldnt execute if commandName is message...

So it should be :  if (commandName == "message")
instead :  if (commandName != "message")
Avatar of 1jaws

ASKER

well, my radwindow opens up on OnClientPageLoad="onWindowLoad" so that is getting executed what I need what code I can put that while that function executes it wont throw and error.. because I really dont want to get the html content out of that function for that paticular commandname executed...
Avatar of 1jaws

ASKER

I need that function return no html ...basically.. so do Ineed to pass a "" or null or something?
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe 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 1jaws

ASKER

ok, I think you understood what I meant :) .. tried to code still can see the html content... passing null should have take care but didnt...for some reason by the way, sender of onwindowload is  radwindow...
Avatar of 1jaws

ASKER

I debugged... first this function function onButtonClicked(sender, args)  gets executed and we are passing null, null values.. which is ok and goes to function onWindowLoad(sender, args) ... this steps ok.. but than I noticed, function onWindowLoad(sender, args) gets executed again and this time sender is not null which is radwindow.. so still gives me html back....
Avatar of 1jaws

ASKER

thanks for trying to help.. got that work differently...