How to use skip-end and skip-start in form-single

I need some examples of how to use the skip-end and skip-start attributes. I created a basic input field, but I am not getting the value after submitting the form. How should I pass values to the transition? I also need some examples of skip-start attributes because I was getting errors on my browser log, saying the tags needed to be closed, but I’m not sure which tags should be closed.

    <transition name="createData">
        <actions><script>
            <![CDATA[ 
                println "context " + context
            ]]>
        </script></actions>
        <default-response url="./"/>
    </transition>
<form-single name="Test" skip-end="true" transition="createData">
    <field name="submitButton">
        <default-field title="Create">
            <submit />
        </default-field>
    </field>
</form-single>
<render-mode><text type="qvt">
    <![CDATA[
                    <q-input label="test" size="30" name="test" id="test" ></q-input>
                </m-form>
            </m-form-link>
        </div>
    ]]>
</text></render-mode>
1 Like

Welcome to the Moqui Forum!

If you want to see what an attribute is doing, you can always check the runtime/template/screen-macros/DefaultScreenMacros.${renderType}.ftl.

What skip-start does in form-single is skip the beginning div and formSingleType (see here).

What skip-end does in form-single is skip the ending formSingleType. A formSingleType can either be a m-form or m-form-link. The type is based on whether the transition it points to is going to redirect to another screen or not.

So if you want to do what you’re doing you would do something like this:

<form-single name="Test" skip-end="true" transition="createData">
    <field name="submitButton">
        <default-field title="Create">
            <submit />
        </default-field>
    </field>
</form-single>
<render-mode><text type="qvt">
    <![CDATA[
                    <q-input label="test" size="30" name="test" id="test" ></q-input>
                </m-form></div>
    ]]>
</text></render-mode>

I didn’t test the code above, but hopefully that gives you enough information to figure it out.

1 Like

Thank you for the response, now I understand how to use the attributes.

But my issue still exists I am unable to pass the values to the transition, maybe I am missing any attribute to the field. I suspect the v-model holds values and passes to the transition. But not sure how can I use this in the input field, I tried to use v-model in the input field but I was getting an error [Vue warn]: Property or method "test" is not defined on the instance but referenced during render. Make sure that this property is reactive

2 Likes

It might help to step back a bit. What are you trying to do that requires the use of the skip-end / skip-start attributes? Are you extending simple screens to your use-case?

what I am trying to do is create a dynamic form based on data. Mostly I want to create dynamic dropdown fields, the dropdowns could be multiple, depending on the data. In Moqui, there is no way to iterate fields based on data. I also want to use some existing fields which is available in Moqui that’s why I didn’t go with 100% custom screen and chose the skip-end attribute to add some custom dynamic fields into the form-single tag. I am not sure if it is possible with the skip-end attribute.

The only problem I am not able to figure out how can I hold the values and pass them to the transition. since the fields are dynamic I need to hold the values dynamically. Is it doable or I should go for 100% custom screen?