D'Arcy from Winnipeg
Solution Architecture, Business & Entrepreneurship, Microsoft, and Adoption

*DING* Congratulations, you're now a level 30 developer, which means you're available for this quest: UltraWebListBar of HELL

Thursday, August 9, 2007 6:46 AM

Now that I've conquered the UltraWebGrid, I've moved out of the Arathi highlands and into the mire that is the Wetlands further south. Here is where my next quest waits for me, and its name is "UltraWebListBar...of HELL". I encountered this nice little undead apothecary named Fred of the Dead who said to me...

"Oh no, I'm so upset. The dwarven hordes are closing in on all sides, and the only way to stop them is to implement this UltraWebListBar...but it won't maintain its selected group through postbacks! Blood Elf, you must help me get this UltraWebListBar working so I can fend them off!"

Normally I'd say "whatever", but he offered 50 silver and my choice between a Microsoft Optical Mouse of Dexterity and and iPod Cable of the Owl. So I'm in.

Apparantly the UltraWebListBar is a wonderful tool...but in its default form (as in, you drop it on the webform without changing ANY settings) it won't maintain your group selection on a postback. Odd, since you'd think that most people would WANT to maintain that as a DEFAULT.

This better get me some good rep with Sylvanis's brood...

Edit: So apparantly it DOES keep state on a postback...unfortunately most people are probably using it to navigate to different pages, possibly using the control in a Master Page like I am. But that means that when you go to a new page its not a postback, and the control refreshes itself. So for right now I'm thinking of just grabbing the associated value (whatever that is) of the group on the client, passing that back via querystring, and then re-applying it in the code behind...Oi!...more to come...

Edit 2: Alright, got it working. The issue is that the control was placed inside a MasterPage. Because we were navigating to different pages, we weren't "posting back", but calling for new pages...which meant that the listbar control was refreshing iteself as if new. So what I had to do was setup a way for the pages to pass a value into session that the Master Page could access and use to select the desired group from. One other annoyance though: sitemap "keys" seem to be url values by default...and if you have a sitemap node intended to be a grouping item, you can't really set the url value if you don't want it to be a clickable, navigational item...but you can't use "key = ..." either, because the "key" value is really the "url" value. Long story short, to get the solution working I had to use the title value of the node instead...which I'm not crazy happy about...but it works.

I returned to Fred after ensuring the UltraListBar from Hell wouldn't be giving him any more problems. He thanked me profusly and paid me my 50 silver. I didn't have time to enjoy my Optical Mouse of Dexterity though...I had some Java Developer n008s to gank.

D




Feedback

No comments posted yet.


Post a comment