Gwtext-based data binding to create applications (2) Event Interceptor

sponsored links
The event interceptor is Dataset object ties being bound by the event interceptor data binding
public interface DatasetInterceptor {
        public boolean doBeforeIntercept(Dataset dataset, String action, Object[] params);
        public void onIntercept(Dataset dataset, String action, Object[] params);
        public void doAfterIntercept(Dataset dataset, String action, Object[] params, int resultCode);

A simple data binding TextField, when the Dataset occurs ACTION_MOVE (the current log line change) event to dynamically modify the binding field contents, as follows:
public class DatasetText extends TextField implements DatasetFormField {
        private Dataset dataset;
        private DatasetField field;
        private DatasetInterceptor interceptor;
        public DatasetText(Dataset dataset, DatasetField field) {
                this.dataset = dataset;
                this.field = field;
        public DatasetText(DatasetField field) {
                this(null, field);
        private void init() {
                if(dataset != null) {
                        this.addListener(new TextFieldListenerAdapter(){

                                public void onBlur(Field field) {
                                        dataset.set(field.getName(), DatasetText.this.getText());

                                public void onFocus(Field field) {

        public void bind() {
                if(this.dataset == null) return;
                if(this.interceptor == null)
                        this.interceptor = new DatasetInterceptorFormAdapter(Constants.ACTION_MOVE){
                                public void doAction(Dataset dataset, Object params) {
                                        Record rec = dataset.getRecordAtCursor();
                                        if(rec != null)
                Record rec = dataset.getRecordAtCursor();
                if(rec != null)

        public void unbind() {
                if(this.dataset == null) return;

        public Dataset getDataset() {
                return this.dataset;

        public DatasetField getField() {
                return this.field;
  • StumbleUpon
  • Digg
  • TwitThis
  • Mixx
  • Technorati
  • Facebook
  • NewsVine
  • Reddit
  • Google
  • LinkedIn
  • YahooMyWeb

Related Posts of Gwtext-based data binding to create applications (2) Event Interceptor

  • hibernate (jpa) composite primary key annotation statement Ways

    In the design of the database tables are designed with a composite primary key of the table, that table's record by more than one field joint identification, such as: Table CREATE TABLE TB_HOUR_DATA ( STAT_DATE DATE NOT NULL, PATH_ID NUMBER(20) NOT NULL,

  • Hibernate Inteceptor

    The end of the project stage, the client suddenly put forward a very troublesome but normal demand, the system records all changes must be carried out. Formats such as: 2004.1.1 12:30 Ikuya wind orders Sales Order Date 2004.1.2-> 2004.1.3 The firs ...

  • jboss ejb3 Message Driven Bean

    Super Medium ejb hate. . . . . . . . . . . . . . . . . . . ================================================ To configure a Message Driven Bean in a different application server parameters are not the same. Currently only passed the test jboss. Message Dri

  • Application of spring struts2.0 hibernate HQL

    Therefore, in the development of statistical inquiry system, as far as possible through the use of select statement to write the required query property way back relational data, and avoid using the first query return persistent object (in this way are in

  • hibernate generic generic DAO

    package org.lzpeng.dao; import; import java.util.List; import org.hibernate.Criteria; import org.hibernate.Query; import org.hibernate.criterion.Criterion; import org.springside.modules.orm.hibernate.Page; /** * * @version 2009-1-10 *

  • Struts2 + hibernate + spring problem user log in

    dao layer services layer action jsp <tr> <td align="center"> <b> user name: </ b> </ td> <td> <s: textfield name = "czyNumber" cssClass = "textstyle" theme = "simple" size = &q

  • Great collection of java interview topics

    1, object-oriented features of what has 1. Abstract: Abstract is that it has overlooked a subject has nothing to do with the current goal of those aspects in order to more fully with the current objectives of the attention-related aspects. Abstract does n

blog comments powered by Disqus
Recent Entries
Tag Cloud
Random Entries