Exemple #1
0
func (db DataBinder) create() (*walk.DataBinder, error) {
	if db.DataSource == nil {
		return nil, nil
	}

	b := walk.NewDataBinder()

	if db.ErrorPresenter != nil {
		ep, err := db.ErrorPresenter.Create()
		if err != nil {
			return nil, err
		}
		b.SetErrorPresenter(ep)
	}

	b.SetDataSource(db.DataSource)

	b.SetAutoSubmit(db.AutoSubmit)

	if db.OnSubmitted != nil {
		b.Submitted().Attach(db.OnSubmitted)
	}

	if db.AssignTo != nil {
		*db.AssignTo = b
	}

	return b, nil
}
Exemple #2
0
func (db DataBinder) create() (*walk.DataBinder, error) {
	if db.DataSource == nil {
		return nil, nil
	}

	b := walk.NewDataBinder()

	b.SetDataSource(db.DataSource)

	if db.AssignTo != nil {
		*db.AssignTo = b
	}

	return b, nil
}
Exemple #3
0
func (db DataBinder) create() (*walk.DataBinder, error) {
	if db.DataSource == nil {
		return nil, nil
	}

	b := walk.NewDataBinder()

	if db.ErrorPresenter != nil {
		ep, err := db.ErrorPresenter.Create()
		if err != nil {
			return nil, err
		}
		b.SetErrorPresenter(ep)
	}

	b.SetDataSource(db.DataSource)

	if db.AssignTo != nil {
		*db.AssignTo = b
	}

	return b, nil
}