create new row initially show components in edit mode not working

Matt SonesMatt Sones Member ✭✭
edited March 2018 in Problems
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>

Answers

  • Stephen SellsStephen Sells Member
    edited September 2017
    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>


  • Matt SonesMatt Sones Member ✭✭
    edited September 2017
    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.
  • Matt SonesMatt Sones Member ✭✭
    edited September 2017
    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>
  • Stephen SellsStephen Sells Member
    edited September 2017
    Ah. Yes. This is now clear. I'll get that written up and let you know when this issue is resolved.
Sign In or Register to comment.