org.zkoss.zk.ui.ext.client
Interface Errorable

All Known Implementing Classes:
Combobox.ExtraCtrl, InputElement.ExtraCtrl

public interface Errorable

Implemented by the object returned by ComponentCtrl.getExtraCtrl(), if users might enter a wrong value for a component.

ErrorEvent is sent when the client detects users entered a wrong value. Note: if the client doesn't detect the error, the value is sent back to the server with regular event, such as InputEvent.

The server must memorize the error until another setErrorByClient(java.lang.String, java.lang.String) is called with null message. Then, when getValue() or similar method is called, it shall throw WrongValueException with the error message (set by setErrorByClient(java.lang.String, java.lang.String)).

Author:
tomyeh

Method Summary
 void setErrorByClient(java.lang.String value, java.lang.String message)
          Sets or clears the error by client.
 

Method Detail

setErrorByClient

void setErrorByClient(java.lang.String value,
                      java.lang.String message)
Sets or clears the error by client.

This method is designed to be used by engine. Don't invoke it directly. Otherwise, the client and server might mismatch.

Parameters:
value - the vaue that user entered and causes an error.
message - the message describes the error, if not null. If null, it means user at the client cleared the error. This happens: user entered a wrong value and corrected by restoring the default value. If user restored the error by typing another value, a regular event, like InputEvent, is sent instead.


Copyright © 2005-2009 Potix Corporation. All Rights Reserved.