Documentation ¶
Index ¶
- Constants
- Variables
- type ButtonField
- type ColorField
- type ControlField
- type DataField
- type DateField
- type Field
- func (f *Field) Compile() wajaf.NodeDef
- func (f *Field) ConvertValue(value interface{}) (interface{}, error)
- func (f *Field) GetInRecord() bool
- func (f *Field) GetName() string
- func (f *Field) GetType() string
- func (f *Field) GetValue(ctx *context.Context, mode Mode) (interface{}, bool, error)
- func (f *Field) PostDelete(ctx *context.Context, key interface{}, oldrec *xdominion.XRecord, ...) error
- func (f *Field) PostGet(ctx *context.Context, key interface{}, rec *xdominion.XRecord) error
- func (f *Field) PostInsert(ctx *context.Context, key interface{}, rec *xdominion.XRecord) (bool, error)
- func (f *Field) PostUpdate(ctx *context.Context, key interface{}, oldrec *xdominion.XRecord, ...) (bool, error)
- func (f *Field) PreDelete(ctx *context.Context, key interface{}, oldrec *xdominion.XRecord, ...) error
- func (f *Field) PreInsert(ctx *context.Context, rec *xdominion.XRecord) error
- func (f *Field) PreUpdate(ctx *context.Context, key interface{}, oldrec *xdominion.XRecord, ...) error
- type FieldDef
- type FileField
- func (f *FileField) CheckExtension(name string, mime string) error
- func (f *FileField) Compile() wajaf.NodeDef
- func (f *FileField) CreateTempName() string
- func (f *FileField) GetFinalFileName() string
- func (f *FileField) GetIconName() string
- func (f *FileField) GetIconNames() []string
- func (f *FileField) GetMime() string
- func (f *FileField) GetMultiFile() bool
- func (f *FileField) GetOriginalFileName() string
- func (f *FileField) GetOriginalFileNames() []string
- func (f *FileField) GetTemporalFileName() string
- func (f *FileField) GetTemporalFileNames() []string
- func (f *FileField) GetTemporalImage() string
- func (f *FileField) GetTemporalImages() []string
- func (f *FileField) PostDelete(ctx *context.Context, key interface{}, oldrec *xdominion.XRecord, ...) error
- func (f *FileField) PostGet(ctx *context.Context, key interface{}, rec *xdominion.XRecord) error
- func (f *FileField) PostInsert(ctx *context.Context, key interface{}, rec *xdominion.XRecord) (bool, error)
- func (f *FileField) PostUpdate(ctx *context.Context, key interface{}, oldrec *xdominion.XRecord, ...) (bool, error)
- func (f *FileField) PreInsert(ctx *context.Context, rec *xdominion.XRecord) error
- func (f *FileField) PreUpdate(ctx *context.Context, key interface{}, oldrec *xdominion.XRecord, ...) error
- func (f *FileField) PrepareFile(ctx *context.Context) error
- func (f *FileField) SaveImage(key interface{}, rec *xdominion.XRecord) error
- type FloatField
- type GroupField
- type HiddenField
- type Ifilefield
- type ImageField
- type InfoField
- type IntegerField
- type LOOField
- type LOVField
- type MailField
- type Mask
- func (m *Mask) AddField(f FieldDef)
- func (m *Mask) Compile(mode string, ctx *context.Context) wajaf.NodeDef
- func (m *Mask) PostGet(ctx *context.Context, key interface{}, rec *xdominion.XRecord) error
- func (m *Mask) Run(ctx *context.Context) (map[string]interface{}, error)
- func (m *Mask) RunMultipart(ctx *context.Context) (map[string]interface{}, error)
- type MaskHooks
- type MaskedField
- type Mode
- type SearchableTextField
- type TextAreaField
- type TextField
- type VideoField
Constants ¶
View Source
const ( CONTROL = "control" FIELD = "field" INFO = "info" HIDDEN = "hidden" GROUP = "group" )
View Source
const ( SEARCHABLETEXTTYPE_TEXT = "text" SEARCHABLETEXTTYPE_MASKED = "masked" SEARCHABLETEXTTYPE_INTEGER = "integer" SEARCHABLETEXTTYPE_FLOAT = "float" SEARCHABLETEXTTYPE_EMAIL = "email" )
View Source
const ( TEXTTYPE_TEXT = "text" TEXTTYPE_MASKED = "masked" TEXTTYPE_INTEGER = "integer" TEXTTYPE_FLOAT = "float" TEXTTYPE_EMAIL = "email" )
View Source
const VERSION = "0.2.0"
Variables ¶
View Source
var DEBUG bool = false
Functions ¶
This section is empty.
Types ¶
type ButtonField ¶
type ButtonField struct { *ControlField Action string }
func NewButtonField ¶
func NewButtonField(name string, action string) *ButtonField
func (*ButtonField) Compile ¶
func (f *ButtonField) Compile() wajaf.NodeDef
func (*ButtonField) GetName ¶ added in v0.1.0
func (f *ButtonField) GetName() string
type ColorField ¶ added in v0.1.0
type ColorField struct {
*TextField
}
func NewColorField ¶ added in v0.1.0
func NewColorField(name string) *ColorField
func (*ColorField) Compile ¶ added in v0.1.0
func (f *ColorField) Compile() wajaf.NodeDef
type ControlField ¶
type ControlField struct { *Field TitleInsert string TitleUpdate string TitleDelete string TitleView string Control bool }
func NewControlField ¶
func NewControlField(name string) *ControlField
func (*ControlField) Compile ¶
func (f *ControlField) Compile() wajaf.NodeDef
type DataField ¶
type DataField struct { *Field InRecord bool URLVariable string Title string DefaultValue string Auto bool AutoMessage string Encoded bool Entities bool NullOnEmpty bool NullValue string MD5Encrypted bool StatusNotNull string StatusCheck string }
func NewDataField ¶
func (*DataField) GetInRecord ¶ added in v0.2.0
type Field ¶
type Field struct { Name string Type string ID string Style string ClassName string AuthModes Mode ViewModes Mode ReadOnlyModes Mode NotNullModes Mode DisabledModes Mode HelpModes Mode HelpToolTip string HelpDescription string HelpTitle string TabIndex int Size string CheckJS string Focus string Blur string }
func (*Field) ConvertValue ¶ added in v0.1.0
ConvertValue will convert the entry value to the correct type for this field
func (*Field) GetInRecord ¶ added in v0.2.0
func (*Field) PostDelete ¶ added in v0.1.0
func (*Field) PostInsert ¶ added in v0.1.0
func (*Field) PostUpdate ¶ added in v0.1.0
type FieldDef ¶
type FieldDef interface { Compile() wajaf.NodeDef GetType() string GetName() string GetInRecord() bool GetValue(ctx *context.Context, mode Mode) (interface{}, bool, error) ConvertValue(value interface{}) (interface{}, error) PostGet(ctx *context.Context, key interface{}, rec *xdominion.XRecord) error PreInsert(ctx *context.Context, rec *xdominion.XRecord) error PostInsert(ctx *context.Context, key interface{}, rec *xdominion.XRecord) (bool, error) // bool = field changed true/false, need an update PreUpdate(ctx *context.Context, key interface{}, oldrec *xdominion.XRecord, newrec *xdominion.XRecord) error PostUpdate(ctx *context.Context, key interface{}, oldrec *xdominion.XRecord, newrec *xdominion.XRecord) (bool, error) PreDelete(ctx *context.Context, key interface{}, oldrec *xdominion.XRecord, rec *xdominion.XRecord) error PostDelete(ctx *context.Context, key interface{}, oldrec *xdominion.XRecord, rec *xdominion.XRecord) error }
type FileField ¶
type FileField struct { *DataField AcceptExternal bool // true if third parties images are accepted (will show the value field and it is editable), like facebook links, instagram, google, etc DeleteButton string Loading string MultiFile bool // true accept multifiles MaxSize int64 ExtensionsAuth map[string]bool MimesAuth map[string]string // format: mime => icon. If icon == "*" will use the file image itself (if it's an image authorized, png, gif, jpeg only) OriginDir string OriginPath string DestinationDir string DestinationPath string DestinationName string TemporalFileName string // Set only when a new upload happens TemporalFileNames []string // when it's multifile OriginalFileName string // Set only when a new upload happens OriginalFileNames []string // Set only when a new upload happens FinalFileName string // Official name of file, not modified if no upload, or temporal value if new upload IconPath string IconName string IconNames []string Ext string Mime string Image string // only if filename is an official image (jpeg, png) Images []string // only if filename is an official image (jpeg, png) // contains filtered or unexported fields }
func NewFileField ¶
func (*FileField) CheckExtension ¶ added in v0.2.0
func (*FileField) CreateTempName ¶ added in v0.2.0
func (*FileField) GetFinalFileName ¶ added in v0.2.0
func (*FileField) GetIconName ¶ added in v0.2.0
func (*FileField) GetIconNames ¶ added in v0.2.0
func (*FileField) GetMultiFile ¶ added in v0.2.0
func (*FileField) GetOriginalFileName ¶ added in v0.2.0
func (*FileField) GetOriginalFileNames ¶ added in v0.2.0
func (*FileField) GetTemporalFileName ¶ added in v0.2.0
func (*FileField) GetTemporalFileNames ¶ added in v0.2.0
func (*FileField) GetTemporalImage ¶ added in v0.2.0
func (*FileField) GetTemporalImages ¶ added in v0.2.0
func (*FileField) PostDelete ¶ added in v0.2.0
func (*FileField) PostInsert ¶ added in v0.2.0
func (*FileField) PostUpdate ¶ added in v0.2.0
func (*FileField) PrepareFile ¶ added in v0.2.0
type FloatField ¶
type FloatField struct { *TextField DefaultValue float64 Min float64 Max float64 StatusTooLow string StatusTooHigh string }
func NewFloatField ¶
func NewFloatField(name string) *FloatField
func (*FloatField) Compile ¶
func (f *FloatField) Compile() wajaf.NodeDef
func (*FloatField) ConvertValue ¶ added in v0.1.0
func (f *FloatField) ConvertValue(value interface{}) (interface{}, error)
type GroupField ¶ added in v0.2.0
func NewGroupField ¶ added in v0.2.0
func NewGroupField(name string, mask *Mask) *GroupField
func (*GroupField) Compile ¶ added in v0.2.0
func (f *GroupField) Compile() wajaf.NodeDef
type HiddenField ¶
hiddenfield is a hidden field to pass information between field group and server. It should have a default value and is setable by code. Its value will be send to the server in any mode if authorized
func NewHiddenField ¶
func NewHiddenField(name string) *HiddenField
func (*HiddenField) Compile ¶
func (f *HiddenField) Compile() wajaf.NodeDef
type Ifilefield ¶ added in v0.2.0
type Ifilefield interface { PrepareFile(ctx *context.Context) error GetOriginalFileName() string GetTemporalFileName() string GetFinalFileName() string GetMime() string GetIconName() string GetTemporalImage() string GetMultiFile() bool GetOriginalFileNames() []string GetTemporalFileNames() []string GetIconNames() []string GetTemporalImages() []string }
type ImageField ¶
type ImageField struct {
*FileField
}
func NewImageField ¶
func NewImageField(name string) *ImageField
type InfoField ¶
func NewInfoField ¶
type IntegerField ¶
type IntegerField struct { *TextField DefaultValue int Min int Max int StatusTooLow string StatusTooHigh string }
func NewIntegerField ¶
func NewIntegerField(name string) *IntegerField
func (*IntegerField) Compile ¶
func (f *IntegerField) Compile() wajaf.NodeDef
func (*IntegerField) ConvertValue ¶ added in v0.1.0
func (f *IntegerField) ConvertValue(value interface{}) (interface{}, error)
type LOOField ¶
type LOOField struct { *DataField DefaultValue string Options map[string]string MultiSelect bool FocusJS string BlurJS string }
List Of Options field: it is dynamic. when the user write the field, a list of possible options displays under the field and can be selected.
func NewLOOField ¶
type LOVField ¶
type LOVField struct { *DataField DefaultValue string Options map[string]string MultiSelect bool RadioButton bool Table *xdominion.XTable Order *xdominion.XOrder Conditions *xdominion.XConditions FieldSet *xdominion.XFieldSet FocusJS string BlurJS string ChangeJS string }
List Of Values field: it is static. The list comes as tags. Can come from table or array of values, can be reloaded with a listener (sub-list)
func NewLOVField ¶
type Mask ¶
type Mask struct { Hooks MaskHooks ID string Display string Style string ClassName string ClassNameZone string VarMode string VarOrder string VarKey string VarField string Maingroup string Template string Mode Mode AuthModes Mode KeyField string Key interface{} InsertedKey interface{} Variables map[string]string SuccessJS string FailureJS string AlertMessage string ServerMessage string InsertTitle string UpdateTitle string DeleteTitle string ViewTitle string DoInsertMessage string DoUpdateMessage string DoDeleteMessage string ConfirmDeleteMessage string Counter int Fields []FieldDef Table *xdominion.XTable Order *xdominion.XOrder Conditions *xdominion.XConditions FieldSet *xdominion.XFieldSet }
type MaskHooks ¶ added in v0.1.0
type MaskHooks struct { Build func(m *Mask, ctx *context.Context) error GetRecord func(m *Mask, ctx *context.Context, key interface{}, mode int) (string, *xdominion.XRecord, error) PreInsert func(m *Mask, ctx *context.Context, rec *xdominion.XRecord) error Insert func(m *Mask, ctx *context.Context, rec *xdominion.XRecord) (interface{}, error) PostInsert func(m *Mask, ctx *context.Context, key interface{}, rec *xdominion.XRecord) error PreUpdate func(m *Mask, ctx *context.Context, key interface{}, oldrec *xdominion.XRecord, newrec *xdominion.XRecord) error Update func(m *Mask, ctx *context.Context, key interface{}, newrec *xdominion.XRecord) error PostUpdate func(m *Mask, ctx *context.Context, key interface{}, oldrec *xdominion.XRecord, newrec *xdominion.XRecord) error PreDelete func(m *Mask, ctx *context.Context, key interface{}, oldrec *xdominion.XRecord, rec *xdominion.XRecord) error Delete func(m *Mask, ctx *context.Context, key interface{}, oldrec *xdominion.XRecord, rec *xdominion.XRecord) error PostDelete func(m *Mask, ctx *context.Context, key interface{}, oldrec *xdominion.XRecord, rec *xdominion.XRecord) error }
type MaskedField ¶ added in v0.1.0
type MaskedField struct {
*TextField
}
func NewMaskedField ¶ added in v0.1.0
func NewMaskedField(name string) *MaskedField
type SearchableTextField ¶ added in v0.2.0
type SearchableTextField struct { *DataField TextType string Format string FormatJS string MinLength int MaxLength int MinWords int MaxWords int StatusBadFormat string StatusTooShort string StatusTooLong string StatusTooFewWords string StatusTooManyWords string KeyUpJS string FocusJS string BlurJS string Check func(ctx *context.Context, mode Mode, value interface{}) error Calc func(ctx *context.Context, mode Mode, rec *xdominion.XRecord) (interface{}, error) }
func NewSearchableTextField ¶ added in v0.2.0
func NewSearchableTextField(name string) *SearchableTextField
func (*SearchableTextField) Compile ¶ added in v0.2.0
func (f *SearchableTextField) Compile() wajaf.NodeDef
type TextAreaField ¶
func NewTextAreaField ¶
func NewTextAreaField(name string) *TextAreaField
func (*TextAreaField) Compile ¶
func (f *TextAreaField) Compile() wajaf.NodeDef
type TextField ¶
type TextField struct { *DataField TextType string Format string FormatJS string MinLength int MaxLength int MinWords int MaxWords int StatusBadFormat string StatusTooShort string StatusTooLong string StatusTooFewWords string StatusTooManyWords string KeyUpJS string FocusJS string BlurJS string Check func(ctx *context.Context, mode Mode, value interface{}) error Calc func(ctx *context.Context, mode Mode, rec *xdominion.XRecord) (interface{}, error) }
func NewTextField ¶
type VideoField ¶
type VideoField struct {
*FileField
}
func NewVideoField ¶
func NewVideoField(name string) *VideoField
Source Files ¶
Click to show internal directories.
Click to hide internal directories.