Announcement Announcement Module
Collapse
No announcement yet.
JSF and nullable fields Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JSF and nullable fields

    Hi folks,

    we are using Spring Roo several months. We have finished a production project with 100+ entities using web mvc plugin. I can say that Spring Roo helped us a lot.
    Now, we have started another project and decided to use JSF plugin. After two weeks of playing with Spring Roo & JSF I can say that JSF support is not so good as support for spring MVC. I will state all problems that we experienced in the future posts.
    But, now I have following problem.
    In my entity class I have a field

    Code:
    @Cacheable
    @RooJavaBean
    @RooToString
    @RooSerializable
    @RooJpaActiveRecord(table = "caseclass", finders = { "findCaseClassesByCodeEquals" })
    public class CaseClass {
    ...
    @Size(max = 4000)
    private String description;
    ...
    }
    Spring roo generates managed bean with following

    Code:
    public HtmlPanelGrid CaseClassBean.populateCreatePanel() {
    ...
            InputTextarea descriptionCreateInput = (InputTextarea) application.createComponent(InputTextarea.COMPONENT_TYPE);
            descriptionCreateInput.setId("descriptionCreateInput");
            descriptionCreateInput.setValueExpression("value", expressionFactory.createValueExpression(elContext, "#{caseClassBean.caseClass.description}", String.class));
            LengthValidator descriptionCreateInputValidator = new LengthValidator();
            descriptionCreateInputValidator.setMaximum(4000);
            descriptionCreateInput.addValidator(descriptionCreateInputValidator);
            descriptionCreateInput.setRequired(true);
            htmlPanelGrid.getChildren().add(descriptionCreateInput);
    ...
    }
    The problem is in the statement>
    descriptionCreateInput.setRequired(true);

    I do not want to make field mandatory, I just want to limit size of user input to 4000 characters.

    In web mvc we did not have such a problem. Everything was working as expected.
    Is there any solution or workaround for problem described..

    Thanks in advance.
Working...
X