ColdFusion 8 Ajax UI Controls: Refresh active tab???????

Where are you?

I’ve tried numerous things to get the tab to refresh. First off I was looking at Ext 2.0 docs but I didn’t realize it until I did a dump on the _ColdFusion.Layout.getTabLayout(“tabs”).getActiveTab()_ and noticed a method not mentioned on the docs. Oops…my bad! ;-)

So…instead of just bashing CF8′s attempt at UI Controls via Ajax I figured I’d ask anyone listening.

bq. How do you refresh the active tab dynamically?

Before you answer, let me clarify. I have N number of tabs and inside this particular tab I open a _CFWindow_ (a few gripes about this too) which does some updating and when done I need the selected tab to refresh the contents so it properly shows the latest and greatest info.

Here is what I found to work (and all that worked):

bq. function refreshActiveTab(){
var activeID = ColdFusion.Layout.getTabLayout(“tabs”).getActiveTab().id;
ColdFusion.Layout.hideTab(“tabs”, activeID);
ColdFusion.Layout.showTab(“tabs”, activeID);
ColdFusion.Layout.selectTab(“tabs”, activeID);
return;
}

That’s quite a sucky way to do it, IMO. The user doesn’t see the hide/show…at least in FF. In IE7 the modal background has no alpha (which looks crappy) so I can’t see it anyway.

Either way, after my trials tonight it merely validates my thoughts on CF’s Ajax UI Controls: they need a lot of work! I’ll rant later but the CF Ajax binding is SWEET (lacking a couple things but still sweet). I just want to see the UI controls come up to a really professional level.
</partialRant>

  • claudia

    I resolved this by having my function do a cflocation back to the tab panel by passing a url to the id of the tab. Works great !

  • John C. Bland II

    I don’t want to have to know my url’s for every tab and don’t want to store them anywhere except in the cflayout child nodes.

    I had the url in there initially and did that exact thing but it wasn’t dynamic enough for me.

    Thanks for the response though.

  • Andy Sandefer

    @John
    Did you ever figure this out?

    • http://www.johncblandii.com John C. Bland II

      I did but it has been so long I couldn’t tell you how I fixed it. The code is out there so I’ll see if I can find it to let you know.