0

Disable / Enable Wrongvalueexception for a page

asked 2011-03-07 08:48:36 +0800

moloch gravatar image moloch
606 1 13

Hello,
is there a solution to disable / enable the wrongvalueexceptions for a zul page? Because i dont want the validation when i blur a input component. i only want to validate when i click the save button from my zul page.

greets

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2011-03-30 03:33:11 +0800

moloch gravatar image moloch
606 1 13

nobody has an idea?

link publish delete flag offensive edit

answered 2011-03-30 03:53:32 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

You can set all your constraints in a java method.

       .  . .
	private  boolean validationOn;
      . . .

	/**
	 * Saves the components to table. <br>
	 * 
	 * @throws InterruptedException
	 */
	public void doSave() throws InterruptedException {

	 . . .
		// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
		// force validation, if on, than execute by component.getValue()
		// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
		if (!isValidationOn()) {
			doSetValidation();
		}

		try {
			getguestBookService().saveOrUpdate(aGuestBook);
		} catch (DataAccessException e) {
			ZksampleMessageUtils.showErrorMessage(e.getMostSpecificCause().toString());
               }
             
              . . .

	/**
	 * Sets the Validation by setting the accordingly constraints to the fields.
	 */
	private void doSetValidation() {
		textbox_gubUsrName.setConstraint("NO EMPTY");
		textbox_gubSubject.setConstraint("NO EMPTY");
	}

.


	/**
	 * Disables the Validation by setting empty constraints.
	 */
	private void doRemoveValidation() {
		textbox_gubUsrName.setConstraint("");
		textbox_gubSubject.setConstraint("");
	}

getters/setters

	public void setValidationOn(boolean validationOn) {
		this.validationOn = validationOn;
	}

	public boolean isValidationOn() {
		return this.validationOn;
	}


best
Stephan

link publish delete flag offensive edit

answered 2011-03-30 05:58:20 +0800

moloch gravatar image moloch
606 1 13

yes i know this solution. but i hope there would be another simple solution.
thanks stephan

link publish delete flag offensive edit
Your reply
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

RSS

Stats

Asked: 2011-03-07 08:48:36 +0800

Seen: 676 times

Last updated: Mar 30 '11

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