Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 236
  • Last Modified:

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);                
            }
0
1jaws
Asked:
1jaws
  • 5
  • 2
1 Solution
 
leakim971PluritechnicianCommented:
> I need onWindowLoad  shouldnt execute if commandName is message...

So it should be :  if (commandName == "message")
instead :  if (commandName != "message")
0
 
1jawsAuthor Commented:
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...
0
 
1jawsAuthor Commented:
I need that function return no html ...basically.. so do Ineed to pass a "" or null or something?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
leakim971PluritechnicianCommented:
function onWindowLoad(sender, args)
{            
          if(sender != null ) {
 
                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);                
         }
 }

so you can use : onWindowLoad(null, null);
0
 
1jawsAuthor Commented:
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...
0
 
1jawsAuthor Commented:
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....
0
 
1jawsAuthor Commented:
thanks for trying to help.. got that work differently...
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now