Auto Generate New Component ID

Even if theres not a way to make component IDs Unique app wide wich i think they should be… Please make a way I can click to auto generate a new componentID

I don’t believe this is possible the way the platform is currently built.

What’s the reason you need this?

Hi @moe - this is because we build a lot with popups and if we hide components with the same ID’s they’ll disappear off the main page (other pages open behind the popup modal)

In case anybody out there is wondering - I’ve been using a sort of workaround

Rather than
TB.showComponent(Component_ID)

I’m using
$(#element_pagexx_idxx).show() – and this seems to more or less do the trick since these elements Id’s are in fact unique (unless of course, we have two components with the same ID on one page - which i don’t think I’ve come across.)

ps. in that case id delete one and recreate it

@avromiRussell @moe
I faced the same issue in my app. I applied a small patch in the JavaScript code. Since both the parent page and the detail popup have the same component ID, I added a unique CSS class to the parent component, and it now works perfectly as I needed.

I hope this might helpfull.

TB.render('YOUR_COMPONENT_ID', function(data) {
    if ((data.records === undefined || data.records.length === 0) && data.ele.hasClass('your-unique-class')) {
        data.ele.css('display', 'none');
    }
});
1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.