Component Condition

New post to get additional comments since this other postis closed for comments. :wink:

Here’s a simple example of this mornings use of this requested feature.


Would something like this work?

I have a page with 1 model, 1 page title, 2 tabs, and 1 table. The table is BELOW the tab component. I use the tab actions to set any filters on the model that I want. Clicking the tabs can change the filter conditions and re-query the single model/table. With conditional rendering of columns, you can adjust the columns that appear for each tab.

Here is a sample page so you can see it in action.

<skuidpage unsavedchangeswarning="yes" personalizationmode="server" useviewportmeta="true" showsidebar="true" showheader="true" tabtooverride="Opportunity">
    <model id="Opportunity" limit="100" query="false" createrowifnonefound="false" datasource="salesforce" sobject="Opportunity">
            <field id="Name"></field>
            <field id="CreatedDate"></field>
            <field id="StageName"></field>
            <field id="Amount"></field>
            <field id="CloseDate"></field>
            <condition type="fieldvalue" value="" enclosevalueinquotes="true" field="StageName" state="filterableoff" inactive="true" name="StageName"></condition>
    <pagetitle model="Opportunity" uniqueid="sk-2Sc1-199">
        <subtitle>Single Model/MultiTab</subtitle>
            <action type="savecancel" uniqueid="sk-2Sc1-197"></action>
    <tabset rememberlastusertab="true" defertabrendering="true" uniqueid="sk-2Sc1-314">
            <tab name="Qualification">
                    <action type="setCondition" model="Opportunity" condition="StageName" value="Qualification"></action>
                    <action type="requeryModel" model="Opportunity" behavior="standard"></action>
            <tab name="Proposal/Price Quote" loadlazypanels="true">
                    <action type="setCondition" model="Opportunity" condition="StageName" value="Proposal/Price Quote"></action>
                    <action type="requeryModel" model="Opportunity" behavior="standard"></action>
    <skootable showconditions="true" showsavecancel="false" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="true" model="Opportunity" mode="read" allowcolumnreordering="true" uniqueid="sk-2Sc1-213">
            <field id="Name" hideable="true" allowordering="true" uniqueid="fi-2Sbw-940"></field>
            <field id="StageName" hideable="true" uniqueid="fi-2Sc1-257"></field>
            <field id="CreatedDate" hideable="true" allowordering="true" uniqueid="fi-2Sbw-941"></field>
            <field id="Amount" hideable="true" uniqueid="fi-2Sc1-295"></field>
            <field id="CloseDate" hideable="true" uniqueid="fi-2Sc1-296"></field>
            <action type="edit"></action>
            <action type="delete"></action>
        <massactions usefirstitemasdefault="true">
            <action type="massupdate"></action>
            <action type="massdelete"></action>
            <view type="standard"></view>
    <actionsequences uniqueid="sk-2Sc1-254"></actionsequences>
    <styleitem type="background" bgtype="none"></styleitem>



Hey Bill, In some circumstances this will work. In others not so much. This multiple related lists example works. User would be subject to waiting for a query but it would work. I have other use cases which need to display multiple components at the same time. Thanks, Pat

^^^ bump ^^^

Came up again. I have multiple models that are exactly the same except for 1-2 static conditions.

This option would reduce the number of models by 10 at this point of the page development.

I could add the condition via xml to the component, but then managing this in the future would require remembering the condition is there as it’s not something I could see in the page builder. I would be ok with this if I could include developer notes specifically on the component and/or model.

I just used component conditions for the first time. So awesome!

Best part is you can actually write conditions on ui-only fields this way…


I see why your request is so valuable.  Being able to declaratively set component conditions will make your pages load faster and easier to maintain.