Redian新闻
>
display field validation message with the field
avatar
h*d
2
any suggestion for a good approach? would like to have an elegant way to
implement this,
since this will be the requirement for all the fields across the whole
project.
tools are used:
Waffle as web framework, validation is done in controller(action),
and validation messages are exposed in ${errors},
JSP and DOJO are used.
Business requirement:
when field validation fails, change the label to red, and display the error
message with the field
thanks.
avatar
M*N
3
avatar
g*g
4
Not familiar with Waffle, but most frameworks have a concept
of validator. e.g. Spring MVC has a validator interface that
has these two functions.
public boolean supports(Class givenClass)
public void validate(Object obj, Errors errors)
The first function specify the type of form bean,
the second one processes the form bean and append errors.
Then you can have a custom jsp tag to do view if the framework
doesn't already have one.

error

【在 h**d 的大作中提到】
: any suggestion for a good approach? would like to have an elegant way to
: implement this,
: since this will be the requirement for all the fields across the whole
: project.
: tools are used:
: Waffle as web framework, validation is done in controller(action),
: and validation messages are exposed in ${errors},
: JSP and DOJO are used.
: Business requirement:
: when field validation fails, change the label to red, and display the error

avatar
wh
5
好听。

【在 M****N 的大作中提到】

avatar
h*d
6
Thanks for the suggestion.
I don't have any problem from the server side, web framework does not really
matter.
In my case, after the validation, all the validation errors will be exposed
in ${errors},
need to have a good way of linking the specific error to the field(maybe use
custom tag?),
and change the label for that field to a different color.
I have not tried custom tag yet, since it needs to change the label color,
and append error message to the field. Also it needs to handle all possibl

【在 g*****g 的大作中提到】
: Not familiar with Waffle, but most frameworks have a concept
: of validator. e.g. Spring MVC has a validator interface that
: has these two functions.
: public boolean supports(Class givenClass)
: public void validate(Object obj, Errors errors)
: The first function specify the type of form bean,
: the second one processes the form bean and append errors.
: Then you can have a custom jsp tag to do view if the framework
: doesn't already have one.
:

avatar
s*e
7
Even I do not think that you should use innerhtml, it should be doable.
If I were you, I would first check waffle doc to see if it has some built-in
tags. If there is none, you might want to email the guy who found the
waffle. Never used waffle before, but several years ago had a quick look at
the project. The guy should be from thoughtworks. I am not sure if he is
still with them.
For me, innerhtml should be used in xmlhttprequest(ajax) for partial refresh
or some client side only action such
avatar
h*d
8
agreed...
Mike ward is one of my best friends...unfortunately, waffle does not provide
good tags to let you select where to display error messages:(
I was not the one who chose waffle, the person who chose the framework left
the project:( Actually I like waffle a lot, but I would not suggest it for
professional projects, since it does not have strong community. Lack of tag
support is another issue.

in
at
refresh

【在 s******e 的大作中提到】
: Even I do not think that you should use innerhtml, it should be doable.
: If I were you, I would first check waffle doc to see if it has some built-in
: tags. If there is none, you might want to email the guy who found the
: waffle. Never used waffle before, but several years ago had a quick look at
: the project. The guy should be from thoughtworks. I am not sure if he is
: still with them.
: For me, innerhtml should be used in xmlhttprequest(ajax) for partial refresh
: or some client side only action such

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。