Archive

Posts Tagged ‘popup’

Window angst

December 4th, 2007

OK here’s the scenario. Pretty much all the records in the database have a logical key, such as the CustomerCode in Customer, UserName in UserAccount, TicketReference in Ticket and so on. So if I want to define the customer for a ticket, I have a search control on the ticket form that should be working as follows: you input the customer code into a textbox and click the search button and since the code is (or rather should be) unique, the only match is referred on the ticket.

If, on the other hand, you input e.g. the first 3 letters or so and get multiple matches for the query, a grid should be displayed on a modal popup dialog. Not a popup window as such, since popup windows are annoying and stupid, but a control like the RadWindow.

Now don’t get me wrong, I really like the RadControls, but occasionally they tend to run my nut in with their extensive client-side focus. Also, working with RadControls and the AjaxControlToolkit controls, I have found them a bit artificially restricted in functionality. I have found several requests in the Telerik forums for the ability show content within a RadWindow merely declaring the window like a panel:

<telerik:RadWindow ID="RadWindow1" runat="Server">some content here</telerik:RadWindow>

The answer to these requests remains “the RadWindow isn’t intended to be used like that, but hey here’s the handy javascript function SetContent, that allows you to set the content to whatever you want.” Yea sure, if it would actually work (which for some unfathomable reason it didn’t for me) and all this javascript business gives you hell if you want to append some server-side controls into the window.

There is of course the possibility show a page in the window with all the functionality I need, but I couldn’t sleep at night knowing that I had just wasted several roundtrips through the layers and built stupid load on the session variables and so on that it would require. Additionally, it would be ugly code and annoying to implement.

Putting RadWindow aside after a tiresome jiu jitsu duel (that took way too much of my precious time), I decided to give the AjaxControlToolkit ModalPopupExtender a go. Once again, some clever developer somewhere had decided that the popup extender is just meant to show simple dialogs such as “Are you sure you want to delete the internet?” or so. Resulting in the frustrating behaviour of the popup to hide itself whenever a postback occurs inside it. Really handy considering my scenario, where the popup shows a grid and some controls to refine the search.

The ModalPopupExtender also refused to show itself from the codebehind when it was enclosed within a RadAjaxPanel, which I really prefer over UpdatePanel because of the handy LoadingPanel functionality.

If only it had the features, RadWindow would be the preferred choice of the two, primarily for its skinning features and resizability. Sure, the control I’m after isn’t that complex and shouldn’t be that hard to code myself, but I just want to avoid developing my own controls until the very last, to take at least some of the support pressure off of my back.

Oh how I miss developing Windows Forms applications. I don’t miss deploying them, though.

bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Technology , , ,