Posted 7/27/2007 8:54:37 AM | | | 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 AM | | | Further investigation reveals that at the very least this script block has "gone missing" (seee attachment).
Strange...
--
Henrik Nielsen
|
| Posted 7/27/2007 10:32:10 AM | | | 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 AM | | | 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 AM | | | Ah! That makes sense Thanks for clearing that up Jeremie.
- Henrik Nielsen
--
Henrik Nielsen |
| |
|