create new row initially show components in edit mode not working

  • 2
  • Problem
  • Updated 1 year ago
  • Acknowledged
The Create Row action property "Have associated Components initially show this row in..." set to Edit Mode doesn't work with field editors.

Example:
<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true">
    <models>
        <model id="accountTest" limit="" query="false" createrowifnonefound="false" datasource="salesforce" type="" sobject="Account">
            <fields>
                <field id="Name"/>
                <field id="AccountNumber"/>
                <field id="Id"/>
            </fields>
            <conditions/>
            <actions/>
        </model>
    </models>
    <components>
        <buttonset model="accountTest" uniqueid="sk-2boQiu-116">
            <buttons>
                <button type="multi" label="Add in Edit Mode" icon="sk-icon-add">
                    <actions>
                        <action type="createRow" fieldmodel="accountTest" affectedrows="context" model="accountTest" appendorprepend="prepend" defaultmodefornewitems="edit"/>
                    </actions>
                </button>
            </buttons>
        </buttonset>
        <basicfieldeditor showheader="true" showsavecancel="true" showerrorsinline="true" model="accountTest" buttonposition="" uniqueid="sk-2boRIS-119" mode="read">
            <columns>
                <column width="50%">
                    <sections>
                        <section title="Section A" collapsible="no">
                            <fields>
                                <field id="Id"/>
                                <field id="Name"/>
                                <field id="AccountNumber"/>
                            </fields>
                        </section>
                    </sections>
                </column>
                <column width="50%">
                    <sections>
                        <section title="Section B">
                            <fields/>
                        </section>
                    </sections>
                </column>
            </columns>
        </basicfieldeditor>
    </components>
    <resources>
        <labels/>
        <javascript/>
        <css/>
    </resources>
    <styles>
        <styleitem type="background" bgtype="none"/>
    </styles>
</skuidpage>
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb

Posted 1 year ago

  • 2
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,856 Points 10k badge 2x thumb
It looks like you've set the "Add" to edit but the Field Editor isn't set to edit. Try this:

<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="false" useviewportmeta="true" showheader="false">    <models>
        <model id="accountTest" limit="" query="false" createrowifnonefound="false" datasource="salesforce" type="" sobject="Account">
            <fields>
                <field id="Name"/>
                <field id="AccountNumber"/>
                <field id="Id"/>
            </fields>
            <conditions/>
            <actions/>
        </model>
    </models>
    <components>
        <buttonset model="accountTest" uniqueid="sk-2boQiu-116">
            <buttons>
                <button type="multi" label="Add in Edit Mode" icon="sk-icon-add" uniqueid="sk-2btP5c-72">
                    <actions>
                        <action type="createRow" fieldmodel="accountTest" affectedrows="context" model="accountTest" appendorprepend="prepend" defaultmodefornewitems="edit"/>
                    </actions>
                </button>
            </buttons>
        </buttonset>
        <basicfieldeditor showheader="true" showsavecancel="true" showerrorsinline="true" model="accountTest" buttonposition="" uniqueid="sk-2boRIS-119" mode="edit" layout="">
            <columns>
                <column width="50%">
                    <sections>
                        <section title="Section A" collapsible="no">
                            <fields>
                                <field id="Id" uniqueid="sk-2btP63-78" valuehalign="" type=""/>
                                <field id="Name" uniqueid="sk-2btP66-80"/>
                                <field id="AccountNumber" uniqueid="sk-2btP68-82"/>
                            </fields>
                            <renderconditions logictype="and"/>
                        </section>
                    </sections>
                </column>
                <column width="50%">
                    <sections>
                        <section title="Section B">
                            <fields/>
                        </section>
                    </sections>
                </column>
            </columns>
            <renderconditions logictype="and"/>
        </basicfieldeditor>
    </components>
    <resources>
        <labels/>
        <javascript/>
        <css/>
    </resources>
    <styles>
        <styleitem type="background" bgtype="none"/>
    </styles>
</skuidpage>
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
I don't want the field editor in edit mode. I want it in read with inline edit mode in case the model has records on query (on the test page I have no records just to simplify). But I want it in edit mode for new records created by the button's action.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Is this clearer?
<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true">
    <models>
        <model id="accountTest" limit="2" query="true" createrowifnonefound="false" datasource="salesforce" type="" sobject="Account">
            <fields>
                <field id="Name"/>
                <field id="AccountNumber"/>
                <field id="Id"/>
            </fields>
            <conditions/>
            <actions/>
        </model>
    </models>
    <components>
        <buttonset model="accountTest" uniqueid="sk-2boQiu-116">
            <buttons>
                <button type="multi" label="Add in Edit Mode" icon="sk-icon-add">
                    <actions>
                        <action type="createRow" fieldmodel="accountTest" affectedrows="context" model="accountTest" appendorprepend="prepend" defaultmodefornewitems="edit"/>
                    </actions>
                </button>
            </buttons>
        </buttonset>
        <basicfieldeditor showheader="true" showsavecancel="true" showerrorsinline="true" model="accountTest" buttonposition="" uniqueid="sk-2boRIS-119" mode="read">
            <columns>
                <column width="50%">
                    <sections>
                        <section title="Section A" collapsible="no">
                            <fields>
                                <field id="Id"/>
                                <field id="Name"/>
                                <field id="AccountNumber"/>
                            </fields>
                        </section>
                    </sections>
                </column>
                <column width="50%">
                    <sections>
                        <section title="Section B">
                            <fields/>
                        </section>
                    </sections>
                </column>
            </columns>
        </basicfieldeditor>
    </components>
    <resources>
        <labels/>
        <javascript/>
        <css/>
    </resources>
    <styles>
        <styleitem type="background" bgtype="none"/>
    </styles>
</skuidpage>
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,856 Points 10k badge 2x thumb
Ah. Yes. This is now clear. I'll get that written up and let you know when this issue is resolved.