FORUMS

c360 Forums
 Home        Members    Calendar    Who's On

Welcome Guest ( Login | Register )
      



SavePage ok-button stopped workingExpand / Collapse
Message
Posted 7/27/2007 8:54:37 AMPost #1675
 

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member
Hi,

I have just deployed an update of some code to our a test server, and encountered a strange issue. We have a handful of pages that are SavePage pages. Normally "stuff" happens when you click the ok button, but now - after my deployment - all the ok-buttons simply don't work, apparently because the javascript function that is bound as eventhandler to the click event no longer exists. An inspection of the source of the page reveals that the chunk of javascript that normally handles this is missing.

Has anyone experienced something similar or have some insight into why this might happen? Thanks in advance.

- Henrik Nielsen

--
Henrik Nielsen
Posted 7/27/2007 9:15:25 AMPost #1676
 

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member
Further investigation reveals that at the very least this script block has "gone missing" (seee attachment).

Strange...

--
Henrik Nielsen

  Post Attachments 
missing_scriptblock.txt (148 views, 981 bytes)
Posted 7/27/2007 10:32:10 AMPost #1677
 

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member
Workaround found. But I'm somewhat baffled, though... what caused the trouble was this innocent looking codeblock:

public override void BuildMenuArea()
{
// Set the title
Instance.DialogTitle = Translation.GetText("Screening.Approve.PageTitle", "Web");
Instance.DialogDescription = Translation.GetText("Screening.Approve.PageTitle", "Web");
}


Translation.GetText simply loads some localized strings from a satellite assembly with resource files, nothing fancy, just returns a string.

Commenting out the BuildMenuArea restored the full functionality again. I have no idea why this is - I guess the test users will have to do without text in the menuarea

I am still curious as to why this caused all this trouble - I have had trouble getting the DialogTitle and DialogDescription set properly before, come to think of it. Anyone experienced something similar?

- Henrik Nielsen

--
Henrik Nielsen
Posted 7/27/2007 10:44:56 AMPost #1678
 

c360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guru
Commenting out the BuildMenuArea restored the full functionality again. I have no idea why this is - I guess the test users will have to do without text in the menuarea

You are overriding the BuildMenuArea event which prevents the SavePage's event from being execute and therefore prevents the expected JavaScript from being added to the page.

The solution is very simple: you need to invoke the base page's BuildMenuAre like so:

public override void BuildMenuArea() {
     // Invoke the base event
     base.BuildMenuArea();


     // Set the title
     Instance.DialogTitle = Translation.GetText("Screening.Approve.PageTitle", "Web");

     Instance.DialogDescription = Translation.GetText("Screening.Approve.PageTitle", "Web");

}



 

Posted 7/27/2007 11:00:21 AMPost #1679
 

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member
Ah! That makes sense Thanks for clearing that up Jeremie.

- Henrik Nielsen

--
Henrik Nielsen
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: kanika.jackson, Ken Champion

PermissionsExpand / Collapse

All times are GMT -5:00, Time now is 7:38pm

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.437. 15 queries. Compression Enabled.