Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-3473

JSF Mongo nested documents set: insert causes error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.5.RELEASE
    • Fix Version/s: None
    • Component/s: JSF
    • Labels:
      None
    • Environment:
      Ubuntu 12.04 64; STS

      Description

      Test Spring Roo application has two documents:

      @RooJavaBean
      @RooToString
      @RooJpaActiveRecord
      public class Amount {

      private Long base;

      @ManyToMany(cascade = CascadeType.ALL)
      private Set<Cat> cats = new HashSet<Cat>();
      }

      and

      @RooJavaBean
      @RooToString
      @RooJpaActiveRecord
      public class Cat {

      private String category;
      }

      Application also has a Roo-generated JSF (Primefaces) interface, and insert dialog looks as fallows:

      SelectManyMenu catsCreateInput = (SelectManyMenu) application.createComponent(SelectManyMenu.COMPONENT_TYPE);
      catsCreateInput.setId("catsCreateInput");
      catsCreateInput.setConverter(new CatConverter());
      catsCreateInput.setValueExpression("value", expressionFactory.createValueExpression(elContext, "#

      {amountBean.selectedCats}

      ", List.class));
      UISelectItems catsCreateInputItems = (UISelectItems) application.createComponent(UISelectItems.COMPONENT_TYPE);
      catsCreateInputItems.setValueExpression("value", expressionFactory.createValueExpression(elContext, "#

      {catBean.allCats}

      ", List.class));
      catsCreateInput.setRequired(false);
      catsCreateInputItems.setValueExpression("var", expressionFactory.createValueExpression(elContext, "cat", String.class));
      catsCreateInputItems.setValueExpression("itemLabel", expressionFactory.createValueExpression(elContext, "#

      {cat}", String.class));
      catsCreateInputItems.setValueExpression("itemValue", expressionFactory.createValueExpression(elContext, "#{cat}

      ", Cat.class));
      catsCreateInput.getChildren().add(catsCreateInputItems);
      htmlPanelGrid.getChildren().add(catsCreateInput);

      When I try to insert new Amount, I get:

      Cats:: Validation Error: Value is not valid

      I tested the same case using Roo Spring MVC web front-end, everything works. So, it's a problem of Roo JSF configuration. JSF front-end also doesn't work with PostgreSQL (the same data schema), but MVC works perfectly.

        Attachments

          Activity

            People

            Assignee:
            stewarta Alan Stewart
            Reporter:
            golfp-96 Dmitry
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Time Tracking

                Estimated:
                Original Estimate - 2d
                2d
                Remaining:
                Remaining Estimate - 2d
                2d
                Logged:
                Time Spent - Not Specified
                Not Specified