Results 1 to 2 of 2

Thread: Enum and Web error

  1. #1
    Join Date
    Nov 2009
    Posts
    12

    Default Enum and Web error

    Hi all,
    I am just a newbie on Roo and meet an issue when using enum.
    With the script below:

    persistence setup --provider HIBERNATE --database HYPERSONIC_PERSISTENT
    enum type --name ~.core.EStatus
    enum constant --name ACTIVATED
    enum constant --name DESACTIVATED

    entity --name ~.core.Project
    field string --fieldName projectId --notNull --sizeMax 15 --sizeMin 3
    field enum status --class ~.core.Project --type ~.core.EStatus --enumType STRING
    controller scaffold ~.web.ProjectController


    When I try to use the web form to create my object Project, I've got the following error when clicking on the save button:

    Failed to convert property value of type java.lang.String[] to required type xxx.core.EStatus for property status; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String[]] to required type [xxx.core.EStatus] for property status: no matching editors or conversion strategy found

    Any idea what I am doing wrong?
    I'm using ROO 1.0.0-RC3.

    Thanks in advance.

  2. #2
    Join Date
    Mar 2008
    Location
    Sydney, AU
    Posts
    974

    Default

    There were a number of changes and bug fixes related to type conversion and enums recently which cause this issue. I just tested your script against the current Roo trunk and it works there. We are planning to release Roo RC4 very soon which will rely on a new Spring 3 release candidate and therefore work with your enums.

    HTH,
    Stefan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •