I have the following clay composite:

<component jsfid="requiredInputText" extends="inputText">
        <validator jsfid="commonsValidator">
                <attributes>
                        <set name="client" value="false" />
                        <set name="server" value="true" />
                        <set name="type" value="required" />
                </attributes>
        </validator>
</component>

This enables me to do the following and get validation for free:

<component jsfid="lastName" extends="requiredInputText">
        <attributes>
                        <set name="value" value="#{myBean.lastName}" />
        </attributes>
</component>


Now I want to add an associated jsf message component right next to the 
inputText in a reusable way - like I was able to do with the validator.

For example,

<component jsfid="requiredInputPanel" extends="panelGroup">
        <element renderId="1" jsfid="requiredInputText"/>
        <element renderId="2" jsfid="message">
                <attributes>
                        <set name="for" value="?"/>
                        <set name="styleClass" value="errors"/>
                </attributes>
        </element>
</component>

First question, if there any way in clay to support matching the for 
attribute of the message above with the dynamically assigned id from the 
requiredInputText?

Second question, can I define a component that extends requiredInputPanel 
and overrides the value attribute of the nested requiredInputText?

Also, any suggestions on accomplishing this are welcome.

Thanks,
Ryan



Reply via email to