0

Validate File upload exist?

asked 2013-05-15 08:16:32 +0800

dearest555 gravatar image dearest555
111

updated 2013-05-15 10:53:18 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

I try to validate File upload using AbstractValidator but Invalid message not show.

public class FormValidator extends AbstractValidator {
        validateAttachment(ctx, "quotationAttachmentLocation");
    @WireVariable("generalDAO")
    GeneralDAO generalDAO;
    @Override
    public void validate(ValidationContext ctx) {
        private void validateAttachment(ValidationContext ctx, String key) 
        {   
            if(ctx.getCommand().equals("save"))
            {
                NewPhaseRequest request = (NewPhaseRequest)((GeneralController)ctx.getBindContext().getBinder().getViewModel()).getSelectedRequest();  

                if(request.getQuotationAttachmentLocation() == null)
                {
                      this.addInvalidMessage(ctx, key, "No attach file.");
                }           
            }

        }
delete flag offensive retag edit
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2013-05-15 08:16:32 +0800

Seen: 8 times

Last updated: May 15 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More