custom component like button

I want to create a custom component which should inherit all the property of button. Then i want to write some of my own logic based on some DB condition, which will decide when to hide or show button.
I am working in salesforce skuid central.
Is it possible, If yes then how can i achieve it?

Maybe, but what can’t you do with Skuid that you need to write a custom component? Buttons have conditional rendering and can run all sorts of actions including javascript.

I am trying to display button, if Approval.isLocked() apex function is true. Now I have to do this in more then 80 places. and every time it is same code parameter passed in this method. So i am trying to create a global custom component like button, In which i can define my condition once and use it in every needed place without writing same code for checking display condition.

By this way code will be easily manageable and reusable.

Hi skuid, unfortunately there’s not currently a way to inherit an existing component into a custom component. I’ve added this idea (the ability to use out of the box Skuid components within custom components) as a product enhancement request for a future release.

If you’d like, you can also create this enhancement request as an idea here on the Skuid community so that other users can vote it up.

For now, if you build out this capability on one Skuid page, here are the existing methods for re-using content across Skuid pages:

Master/Child pages:

  1. This seems like it may be a good strategy for you in this case. You can create a master page with a page region that only display when Approval.IsLocked() is true. Then, for each of the pages where you want this button, you can create them as child pages of this master.

Child Page / Normal Page converter tool

  • that will help you convert existing pages to child pages
  • Skuid documentation on master-child pages
  • Page include that you use across all pages.
  • Snippet of page XML that you copy and paste across all pages.