moqui

Moqui form shows up disabled


I am following the Moqui getting started tutorial. I have created a create form as below.

<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://staging.azpire.co.in/xsd/xml-screen-2.1.xsd"
    require-authentication="anonymous-all">

    <transition name="findTutorial"><default-response url="."/></transition>
    <transition name="createTutorial">
        <service-call name="create#tutorial.Tutorial"></service-call>
        <default-response url="."/>
    </transition>

    <actions>
        <entity-find entity-name="tutorial.Tutorial" list="tutorialList">
            <search-form-inputs/>
        </entity-find>
    </actions>

    <widgets>

        <container-dialog button-text="Create Tutorial" id="CreateTutorialDialog">
            <form-single name="CreateTutorial" transition="createTutorial">
                <auto-fields-entity entity-name="tutorial.Tutorial" field-type="edit"/>
                <field name="submitButton">
                    <default-field title="Create"><submit/></default-field>
                </field>
            </form-single>
        </container-dialog>

        <form-list name="ListTutorials" list="tutorialList" transition="findTutorial">
            <auto-fields-entity entity-name="tutorial.Tutorial" field-type="find-display"/>
        </form-list>
    </widgets>
</screen>

When I click "Create Tutorial", the form shows up. But, it is disabled(read only) including the submit button.


Solution

  • If you are following the Moqui getting started tutorial, you need import data about security screen as follow to fix this problem:

        <moqui.security.ArtifactGroup artifactGroupId="TUTORIAL" description="Tutorial"/>
        <moqui.security.ArtifactGroupMember artifactGroupId="TUTORIAL" artifactTypeEnumId="AT_XML_SCREEN"
                                                inheritAuthz="Y" artifactName="component://tutorial/screen/tutorial.xml"/>
    <!-- Full permissions for the ADMIN user group -->
        <moqui.security.ArtifactAuthz artifactAuthzId="TUTORIAL_AUTHZ_ALL" userGroupId="ADMIN" artifactGroupId="TUTORIAL"
                                          authzTypeEnumId="AUTHZT_ALWAYS" authzActionEnumId="AUTHZA_ALL"/>