How hide some (not null) fields in a view or how can I set them as read only?
in the domain I have a custom logic that automatically set some not null fields (clearly I have in the view many other fields, that are not intresting here, that are instead set by the user), defined as follow:
private Integer numero;
private Integer anno;
@DateTimeFormat(style = "M-")
private Date dataCreazione;
I need only that these fields will be not shown on the view level, because I'll rewrite them at domain level, as I wrote above, when the user save the view data. Unlikely I have noticed that isn't so easy obtain this feature I really do not understand why... Anyway I had tried various approach and nothing seems to work...
I really hope that this can be with a really simple definition, I don't know at which level (domain, controller or view). Remember that these fields are define as not null (anyway if the not null definition this is the problem I may change the fields definition, hoping that this helps...).
Anyone has some suggestion?
ROO version: spring-roo-1.2.0.RELEASE
Paolo Del Signore
Solved with a little escamotage
No, thanks anyway... :-)!
Originally Posted by shvaber
I have solved in the following way:
1) in the domain I have set the fields ad nullable (comment out the @NotNull signature over each field)
2) stating roo and force "hint" command to assure that ROO made sync the create.jspx at view level
3) in the view I have set the render="false"
4) again, in the domain I have placed the inner code to each customized setter involved in the change into the this.persist() function
5) I haven't done any change to the DB (my persistent mode is always set as "update" and ROO doesn't change the DB field from not nul to null), than I have a "last bastion" for assuring consistence to the DB
Anyway this is a really CUSTOM way to approach this problem, but is fast (and a bit dirty, I know :rolleyes:)...