Search code examples
javatapestry

tapestry form type=image in input not working


I am trying to use an image for a submit buttin like this

<input t:id="submitButton" t:type="image" type="image" src="images/h_logon_button.png"/>

but when i render the page, i get this error

Unable to resolve 'image' to a component class name.

How do I use an image to create the submit button. if I use css, the image disappears after validation fails.

Any ideas? Tx


Solution

  • CSS will work. It sounds like another CSS rule with higher specificity is applied to the button on failed validation. Just inspect the button and see which rule overwrites it.

    The error you are seeing is due to the t:type="image". Here you are telling tapestry that your input should be of component type image. You can fix this in three ways:

    1. Remove the t:id="submitButton" and t:type="image" so that your submit will just be a plain old html submit
    2. change the t:type to submit like t:type="submit"
    3. Remove the t:type="image" and add a component relating to your provided id like @Component(id="submitButton") private Submit submitButton;