You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.
| Online: | 7 Members of 4087 |
| Forum: Seam Users |
09. May 2008, 15:01 CET | Link |
Hi there,
I'm trying to write some SeamTests for my application, but have run into a small problem.
I need to set a parameter for the request which is an Enum value. This works fine in the actual application, but the SeamTest throws a java.lang.IllegalArgumentException: no converter for type: class MyEnum
In my action I have the following request parameter:
@RequestParameter private MyEnum myParam
In the xhtml page I have:
<s:button id="save" value="Save" action="#{myAction.save}">
<f:param name="myParam" value="ONE" />
</s:button>
And as part of the test case I have:
@Override
protected void beforeRequest() {
setParameter("st", MyEnum.ONE.toString());
}
I've tried including a <s:convertEnum> in the xhtml, but no joy there. Has anyone had a similar problem - I imagine it's quite common, but can't seem to find any documentation for it.
Cheers,
Anton
Try using page parameters instead as they allow you to specify a converter.
Read about how to report a bug.