Hi,

I'm trying to create a mixin that pulls together a textfield, its label, and error message with the appropriate styling. Previously I used a component with parameters, but that interfered with validation.

Is it possible for a mixin to render a component?

I find myself continually writing:

        <t:AxFormField> <!-- simple <div> wrapping component -->
                <t:label t:for="txtfield" />
                <div class="ax_input">
                        <t:error
                                class='literal:errorMsg'
                                id="${txtfield}-msg"
                                for="txtfield"
                        />
                        <t:textfield
                                class='input txtinput'
                                t:label="${label}"
                                t:id="txtfield"
                        />
                </div>
        </t:AxFormField>

Which is pretty error prone.

I'd, instead like to write:

        <t:textfield
                t:mixin="AxField"
                t:label="Username"
                t:id="txtfield"
        />

Or something to that effect.

However, then the AxField mixin has to be able to include components somehow, which doesn't seem possible.

It seems like my only option is to make a wrapper component, eg, AxForm, that pre-processes the body, expanding Textfield components.

Is this as insane as it sounds?

Thank you!

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to