Documentation ¶
Index ¶
- Constants
- Variables
- func SetAlertFunction(f AlertFuncType)
- func SortIds(ids []string)
- type AlertFuncType
- type Button
- func (b *Button) Deserialize(d page.Decoder, p *page.Page) (err error)
- func (b *Button) DrawingAttributes() *html.Attributes
- func (b *Button) Init(self page.ControlI, parent page.ControlI, id string)
- func (b *Button) IsPrimary() bool
- func (b *Button) On(e page.EventI, actions ...action.ActionI) page.EventI
- func (b *Button) OnSubmit(actions ...action.ActionI) page.EventI
- func (b *Button) Serialize(e page.Encoder) (err error)
- func (b *Button) SetIsPrimary(isPrimary bool)
- func (b *Button) SetLabel(label string) page.ControlI
- func (b *Button) ΩisSerializer(i page.ControlI) bool
- type ButtonI
- type Canvas
- type CanvasI
- type CellTexter
- type Checkbox
- type CheckboxBase
- func (c *CheckboxBase) Checked() bool
- func (c *CheckboxBase) Deserialize(d page.Decoder, p *page.Page) (err error)
- func (c *CheckboxBase) DrawTag(ctx context.Context) (ctrl string)
- func (c *CheckboxBase) DrawingAttributes() *html.Attributes
- func (c *CheckboxBase) GetDrawingInputLabelAttributes() *html.Attributes
- func (c *CheckboxBase) Init(self page.ControlI, parent page.ControlI, id string)
- func (c *CheckboxBase) InputLabelAttributes() *html.Attributes
- func (c *CheckboxBase) MarshalState(m maps.Setter)
- func (c *CheckboxBase) Serialize(e page.Encoder) (err error)
- func (c *CheckboxBase) SetChecked(v bool) CheckboxI
- func (c *CheckboxBase) SetCheckedNoRefresh(v interface{})
- func (c *CheckboxBase) SetLabelDrawingMode(m html.LabelDrawingMode)
- func (c *CheckboxBase) SetValue(v interface{}) CheckboxI
- func (c *CheckboxBase) TextIsLabel() bool
- func (c *CheckboxBase) UnmarshalState(m maps.Loader)
- func (c *CheckboxBase) Value() interface{}
- func (c *CheckboxBase) ΩisSerializer(i page.ControlI) bool
- type CheckboxI
- type CheckboxList
- func (l *CheckboxList) ColumnCount() int
- func (l *CheckboxList) Direction() ItemDirection
- func (l *CheckboxList) DrawInnerHtml(ctx context.Context, buf *bytes.Buffer) (err error)
- func (l *CheckboxList) DrawingAttributes() *html.Attributes
- func (l *CheckboxList) Init(self page.ControlI, parent page.ControlI, id string)
- func (l *CheckboxList) RenderItem(tag string, item ListItemI) (h string)
- func (l *CheckboxList) SetColumnCount(columns int) CheckboxListI
- func (l *CheckboxList) SetDirection(direction ItemDirection) CheckboxListI
- func (l *CheckboxList) SetIsScrolling(s bool) CheckboxListI
- func (l *CheckboxList) SetLabelDrawingMode(mode html.LabelDrawingMode) CheckboxListI
- func (l *CheckboxList) UpdateFormValues(ctx *page.Context)
- type CheckboxListI
- type ColumnBase
- func (c *ColumnBase) Action(ctx context.Context, params page.ActionParams)
- func (c *ColumnBase) AddActions(ctrl page.ControlI)
- func (c *ColumnBase) CellAttributes(ctx context.Context, row int, col int, data interface{}) *html.Attributes
- func (c *ColumnBase) CellText(ctx context.Context, row int, col int, data interface{}) string
- func (c *ColumnBase) CellTexter() CellTexter
- func (c *ColumnBase) ColTagAttributes() *html.Attributes
- func (c *ColumnBase) DrawCell(ctx context.Context, row int, col int, data interface{}, buf *bytes.Buffer)
- func (c *ColumnBase) DrawColumnTag(ctx context.Context, buf *bytes.Buffer)
- func (c *ColumnBase) DrawFooterCell(ctx context.Context, row int, col int, count int, buf *bytes.Buffer)
- func (c *ColumnBase) FooterAttributes(row int, col int) *html.Attributes
- func (c *ColumnBase) FooterCellHtml(ctx context.Context, row int, col int) string
- func (c *ColumnBase) HeaderAttributes(row int, col int) *html.Attributes
- func (c *ColumnBase) HeaderCellHtml(ctx context.Context, row int, col int) (h string)
- func (c *ColumnBase) ID() string
- func (c *ColumnBase) Init(self ColumnI)
- func (c *ColumnBase) IsHidden() bool
- func (c *ColumnBase) IsSortable() bool
- func (c *ColumnBase) ParentTable() TableI
- func (c *ColumnBase) RenderSortButton(labelHtml string) string
- func (c *ColumnBase) SetCellStyler(s html.Attributer)
- func (c *ColumnBase) SetCellTexter(s CellTexter)
- func (c *ColumnBase) SetFooterTexter(s CellTexter)
- func (c *ColumnBase) SetHeaderTexter(s CellTexter)
- func (c *ColumnBase) SetHidden(h bool)
- func (c *ColumnBase) SetID(id string) ColumnI
- func (c *ColumnBase) SetIsHtml(columnIsHtml bool)
- func (c *ColumnBase) SetRenderAsHeader(r bool)
- func (c *ColumnBase) SetSortDirection(d SortDirection)
- func (c *ColumnBase) SetSpan(span int) ColumnI
- func (c *ColumnBase) SetTitle(title string) ColumnI
- func (c *ColumnBase) SortDirection() SortDirection
- func (c *ColumnBase) Sortable() ColumnI
- func (c *ColumnBase) Span() int
- func (c *ColumnBase) Title() string
- func (c *ColumnBase) UpdateFormValues(ctx *page.Context)
- type ColumnI
- type DataPager
- func (d *DataPager) Action(ctx context.Context, params page.ActionParams)
- func (d *DataPager) CalcBunch() (pageStart, pageEnd int)
- func (d *DataPager) Deserialize(dec page.Decoder, p *page.Page) (err error)
- func (d *DataPager) DrawInnerHtml(ctx context.Context, buf *bytes.Buffer) (err error)
- func (d *DataPager) DrawingAttributes() *html.Attributes
- func (d *DataPager) Init(self page.ControlI, parent page.ControlI, id string, ...)
- func (d *DataPager) MarshalState(m maps.Setter)
- func (d *DataPager) NextButtonsHtml() string
- func (d *DataPager) PageButtonsHtml(i int) string
- func (d *DataPager) PaginatedControl() PaginatedControlI
- func (d *DataPager) PreRender(ctx context.Context, buf *bytes.Buffer) (err error)
- func (d *DataPager) PreviousButtonsHtml() string
- func (d *DataPager) Serialize(e page.Encoder) (err error)
- func (d *DataPager) SetLabels(previous string, next string)
- func (d *DataPager) SetMaxPageButtons(b int)
- func (d *DataPager) SetObjectNames(singular string, plural string)
- func (d *DataPager) SliceOffsets() (start, end int)
- func (d *DataPager) SqlLimits() (maxRowCount, offset int)
- func (d *DataPager) UnmarshalState(m maps.Loader)
- func (d *DataPager) ΩisSerializer(i page.ControlI) bool
- type DataPagerI
- type DateTextbox
- func (d *DateTextbox) Date() datetime.DateTime
- func (d *DateTextbox) Init(self TextboxI, parent page.ControlI, id string)
- func (d *DateTextbox) SetDate(dt datetime.DateTime)
- func (d *DateTextbox) SetFormat(format DateTextboxFormat)
- func (d *DateTextbox) SetText(s string) page.ControlI
- func (d *DateTextbox) SetValue(val interface{}) *DateTextbox
- func (d *DateTextbox) Value() interface{}
- type DateTextboxFormat
- type DateTimeSpan
- func (s *DateTimeSpan) DrawInnerHtml(ctx context.Context, buf *bytes.Buffer) error
- func (s *DateTimeSpan) Init(self page.ControlI, parent page.ControlI, id string)
- func (s *DateTimeSpan) SetDateTime(d datetime.DateTime)
- func (s *DateTimeSpan) SetFormat(format string) *DateTimeSpan
- func (s *DateTimeSpan) SetValue(v interface{})
- func (s *DateTimeSpan) Value() datetime.DateTime
- type DateValidator
- type Dialog
- func (d *Dialog) Action(ctx context.Context, a page.ActionParams)
- func (d *Dialog) AddButton(label string, id string, options *DialogButtonOptions) page.ControlI
- func (d *Dialog) AddCloseButton(label string, id string)
- func (d *Dialog) Close()
- func (d *Dialog) DrawTemplate(ctx context.Context, buf *bytes.Buffer) (err error)
- func (d *Dialog) DrawingAttributes() *html.Attributes
- func (d *Dialog) HasCloseBox() page.ControlI
- func (d *Dialog) Init(self DialogI, parent page.ControlI, id string)
- func (d *Dialog) Open()
- func (d *Dialog) RemoveAllButtons()
- func (d *Dialog) RemoveButton(id string)
- func (d *Dialog) SetButtonStyles(id string, a *html.Style)
- func (d *Dialog) SetButtonVisible(id string, visible bool)
- func (d *Dialog) SetDialogState(s int) *Dialog
- func (d *Dialog) SetState(state int) DialogI
- func (d *Dialog) SetTitle(t string) DialogI
- func (d *Dialog) Title() string
- type DialogButtonOptions
- type DialogI
- type EmailTextbox
- type Fieldset
- type FieldsetI
- type FloatTextbox
- func (i *FloatTextbox) Float32() float32
- func (i *FloatTextbox) Float64() float64
- func (i *FloatTextbox) Init(self TextboxI, parent page.ControlI, id string)
- func (i *FloatTextbox) SetFloat32(v float32) *FloatTextbox
- func (i *FloatTextbox) SetFloat64(v float64) *FloatTextbox
- func (i *FloatTextbox) SetMaxValue(maxValue float64, invalidMessage string)
- func (i *FloatTextbox) SetMinValue(minValue float64, invalidMessage string)
- func (i *FloatTextbox) Value() interface{}
- type FloatValidator
- type FormBase
- type IDSetter
- type IDer
- type IdSlice
- type Image
- func (i *Image) Alt() string
- func (i *Image) Data() []byte
- func (i *Image) DrawingAttributes() *html.Attributes
- func (i *Image) Height() int
- func (i *Image) Init(self ImageI, parent page.ControlI, id string)
- func (i *Image) SetAlt(alt string)
- func (i *Image) SetData(data []byte)
- func (i *Image) SetHeight(height int)
- func (i *Image) SetMimeType(typ string)
- func (i *Image) SetSrc(src string)
- func (i *Image) SetWidth(width int)
- func (i *Image) Src() string
- func (i *Image) Width() int
- type ImageCapture
- func (i *ImageCapture) Data() []byte
- func (i *ImageCapture) DrawingAttributes() *html.Attributes
- func (i *ImageCapture) Init(self ImageCaptureI, parent page.ControlI, id string)
- func (i *ImageCapture) PutCustomScript(ctx context.Context, response *page.Response)
- func (i *ImageCapture) SetData(data []byte)
- func (i *ImageCapture) SetMaskShape(shape ImageCaptureShape)
- func (i *ImageCapture) SetMimeType(typ string)
- func (i *ImageCapture) SetPixelSize(width int, height int)
- func (i *ImageCapture) SetQuality(quality float32)
- func (i *ImageCapture) SetZoom(zoom int)
- func (i *ImageCapture) TurnOff()
- func (i *ImageCapture) UpdateFormValues(ctx *page.Context)
- type ImageCaptureI
- type ImageCaptureShape
- type ImageI
- type IntValidator
- type IntegerTextbox
- func (i *IntegerTextbox) Init(self TextboxI, parent page.ControlI, id string)
- func (i *IntegerTextbox) Int() int
- func (i *IntegerTextbox) Int64() int64
- func (i *IntegerTextbox) SetInt(v int) *IntegerTextbox
- func (i *IntegerTextbox) SetMaxValue(maxValue int, invalidMessage string)
- func (i *IntegerTextbox) SetMinValue(minValue int, invalidMessage string)
- func (i *IntegerTextbox) SetValue(v interface{}) *IntegerTextbox
- func (i *IntegerTextbox) Value() interface{}
- type ItemDirection
- type ItemIDer
- type ItemList
- func (l *ItemList) AddItem(label string, value ...interface{}) ListItemI
- func (l *ItemList) AddItemAt(index int, label string, value ...interface{})
- func (l *ItemList) AddListItemAt(index int, item ListItemI)
- func (l *ItemList) AddListItems(items ...interface{})
- func (l *ItemList) Clear()
- func (l *ItemList) GetItem(id string) (foundItem ListItemI)
- func (l *ItemList) GetItemAt(index int) ListItemI
- func (l *ItemList) GetItemByValue(value interface{}) (id string, foundItem ListItemI)
- func (l *ItemList) Len() int
- func (l *ItemList) ListItems() []ListItemI
- func (l *ItemList) RemoveAt(index int)
- type ItemListI
- type ItemLister
- type Labeler
- type ListItem
- func (i *ListItem) Anchor() string
- func (i *ListItem) AnchorAttributes() *html.Attributes
- func (i *ListItem) Attributes() *html.Attributes
- func (i *ListItem) Disabled() bool
- func (i *ListItem) HasChildItems() bool
- func (i *ListItem) ID() string
- func (i *ListItem) IntValue() int
- func (i *ListItem) IsDivider() bool
- func (i *ListItem) Label() string
- func (i *ListItem) RenderLabel() (h string)
- func (i *ListItem) SetAnchor(a string)
- func (i *ListItem) SetDisabled(d bool)
- func (i *ListItem) SetID(id string)
- func (i *ListItem) SetIsDivider(d bool)
- func (i *ListItem) SetLabel(l string)
- func (i *ListItem) SetShouldEscapeLabel(e bool) *ListItem
- func (i *ListItem) SetValue(v interface{}) *ListItem
- func (i *ListItem) StringValue() string
- func (i *ListItem) Value() interface{}
- type ListItemI
- type MaxFloatValidator
- type MaxIntValidator
- type MaxLengthValidator
- type MinFloatValidator
- type MinIntValidator
- type MinLengthValidator
- type MultiselectList
- func (l *MultiselectList) DrawInnerHtml(ctx context.Context, buf *bytes.Buffer) (err error)
- func (l *MultiselectList) DrawingAttributes() *html.Attributes
- func (l *MultiselectList) Init(self MultiselectListI, parent page.ControlI, id string)
- func (l *MultiselectList) IsIdSelected(id string) bool
- func (l *MultiselectList) MarshalState(m maps.Setter)
- func (l *MultiselectList) SelectedIds() []string
- func (l *MultiselectList) SelectedItems() []ListItemI
- func (l *MultiselectList) SelectedLabels() []string
- func (l *MultiselectList) SelectedValues() []interface{}
- func (l *MultiselectList) SetSelectedIds(ids []string)
- func (l *MultiselectList) SetSelectedIdsNoRefresh(ids []string)
- func (l *MultiselectList) SetSize(size int) MultiselectListI
- func (l *MultiselectList) SetValue(v interface{})
- func (l *MultiselectList) Size() int
- func (l *MultiselectList) UnmarshalState(m maps.Loader)
- func (l *MultiselectList) UpdateFormValues(ctx *page.Context)
- func (l *MultiselectList) Validate(ctx context.Context) bool
- func (l *MultiselectList) Value() interface{}
- type MultiselectListI
- type OrderedList
- func (l *OrderedList) DrawInnerHtml(ctx context.Context, buf *bytes.Buffer) (err error)
- func (l *OrderedList) Init(self page.ControlI, parent page.ControlI, id string)
- func (l *OrderedList) NumberType() string
- func (l *OrderedList) SetNumberType(t string) *OrderedList
- func (l *OrderedList) SetStart(start int) *OrderedList
- type PaginatedControl
- func (c *PaginatedControl) AddDataPager(d DataPagerI)
- func (c *PaginatedControl) CalcPageCount() int
- func (c *PaginatedControl) PageNum() int
- func (c *PaginatedControl) PageSize() int
- func (c *PaginatedControl) SetPageNum(n int)
- func (c *PaginatedControl) SetPageSize(size int)
- func (c *PaginatedControl) SetTotalItems(count uint)
- func (c *PaginatedControl) TotalItems() int
- type PaginatedControlI
- type PaginatedTable
- type Panel
- type PanelI
- type PrimaryKeyer
- type Proxy
- func (p *Proxy) ActionAttributes(actionValue string) *html.Attributes
- func (p *Proxy) ButtonHtml(label string, eventActionValue string, attributes *html.Attributes, ...) string
- func (p *Proxy) Draw(ctx context.Context, buf *bytes.Buffer) (err error)
- func (p *Proxy) Init(parent page.ControlI)
- func (p *Proxy) LinkHtml(label string, actionValue string, attributes *html.Attributes) string
- func (p *Proxy) OnSubmit(actions ...action.ActionI) page.EventI
- func (p *Proxy) TagHtml(label string, actionValue string, attributes *html.Attributes, tag string, ...) string
- func (p *Proxy) WrapEvent(eventName string, selector string, eventJs string) string
- type ProxyI
- type RadioButton
- type RadioButtonI
- type RadioList
- func (l *RadioList) DrawingAttributes() *html.Attributes
- func (l *RadioList) Init(self page.ControlI, parent page.ControlI, id string)
- func (l *RadioList) RenderItem(tag string, item ListItemI) (h string)
- func (l *RadioList) SelectedLabel() string
- func (l *RadioList) SelectedValue() string
- func (l *RadioList) SetSelectedID(id string)
- func (l *RadioList) SetSelectedValue(v interface{})
- func (l *RadioList) SetValue(v interface{})
- func (l *RadioList) UpdateFormValues(ctx *page.Context)
- func (l *RadioList) Value() interface{}
- type RadioListI
- type SelectList
- func (l *SelectList) DrawInnerHtml(ctx context.Context, buf *bytes.Buffer) (err error)
- func (l *SelectList) DrawingAttributes() *html.Attributes
- func (l *SelectList) Init(self page.ControlI, parent page.ControlI, id string)
- func (l *SelectList) IntValue() int
- func (l *SelectList) MarshalState(m maps.Setter)
- func (l *SelectList) SelectedItem() ListItemI
- func (l *SelectList) SelectedLabel() string
- func (l *SelectList) SetData(data interface{})
- func (l *SelectList) SetSelectedID(id string)
- func (l *SelectList) SetValue(v interface{})
- func (l *SelectList) StringValue() string
- func (l *SelectList) UnmarshalState(m maps.Loader)
- func (l *SelectList) UpdateFormValues(ctx *page.Context)
- func (l *SelectList) Validate(ctx context.Context) bool
- func (l *SelectList) Value() interface{}
- type SelectTable
- func (t *SelectTable) DrawingAttributes() *html.Attributes
- func (t *SelectTable) GetRowAttributes(row int, data interface{}) (a *html.Attributes)
- func (t *SelectTable) Init(self page.ControlI, parent page.ControlI, id string)
- func (t *SelectTable) MarshalState(m maps.Setter)
- func (t *SelectTable) PutCustomScript(ctx context.Context, response *page.Response)
- func (t *SelectTable) SelectedID() string
- func (t *SelectTable) SetSelectedID(id string)
- func (t *SelectTable) UnmarshalState(m maps.Loader)
- func (t *SelectTable) UpdateFormValues(ctx *page.Context)
- type SelectTableI
- type SortDirection
- type Span
- type SpanI
- type Table
- func (t *Table) AddColumn(column ColumnI) ColumnI
- func (t *Table) AddColumnAt(column ColumnI, loc int)
- func (t *Table) ClearColumns()
- func (t *Table) DrawCaption(ctx context.Context, buf *bytes.Buffer) (err error)
- func (t *Table) DrawInnerHtml(ctx context.Context, buf *bytes.Buffer) (err error)
- func (t *Table) DrawTag(ctx context.Context) string
- func (t *Table) DrawingAttributes() *html.Attributes
- func (t *Table) GetColumn(loc int) ColumnI
- func (t *Table) GetColumnByID(id string) ColumnI
- func (t *Table) GetColumnByTitle(title string) ColumnI
- func (t *Table) GetFooterRowAttributes(row int) *html.Attributes
- func (t *Table) GetHeaderRowAttributes(row int) *html.Attributes
- func (t *Table) GetRowAttributes(row int, data interface{}) *html.Attributes
- func (t *Table) HeaderCellDrawingInfo(ctx context.Context, col ColumnI, rowNum int, colNum int) (cellHtml string, cellAttributes *html.Attributes)
- func (t *Table) HideColumns()
- func (t *Table) Init(self page.ControlI, parent page.ControlI, id string)
- func (t *Table) PrivateAction(ctx context.Context, p page.ActionParams)
- func (t *Table) RemoveColumn(loc int)
- func (t *Table) RemoveColumnByID(id string)
- func (t *Table) RemoveColumnByTitle(title string)
- func (t *Table) RowStyler() html.Attributer
- func (t *Table) SetCaption(caption interface{})
- func (t *Table) SetFooterRowCount(count int) TableI
- func (t *Table) SetFooterRowStyler(a html.Attributer)
- func (t *Table) SetHeaderRowCount(count int) TableI
- func (t *Table) SetHeaderRowStyler(a html.Attributer)
- func (t *Table) SetRowStyler(a html.Attributer)
- func (t *Table) SetSortHistoryLimit(n int)
- func (t *Table) ShowColumns()
- func (t *Table) SortColumns() (ret []ColumnI)
- func (t *Table) Sortable() TableI
- func (t *Table) UpdateFormValues(ctx *page.Context)
- type TableI
- type Textbox
- func (t *Textbox) Deserialize(d page.Decoder, p *page.Page) (err error)
- func (t *Textbox) DrawInnerHtml(ctx context.Context, buf *bytes.Buffer) (err error)
- func (t *Textbox) DrawingAttributes() *html.Attributes
- func (t *Textbox) Init(self TextboxI, parent page.ControlI, id string)
- func (t *Textbox) MarshalState(m maps.Setter)
- func (t *Textbox) MaxLength() int
- func (t *Textbox) MinLength() int
- func (t *Textbox) Placeholder() string
- func (t *Textbox) ResetValidators()
- func (t *Textbox) Sanitize(s string) string
- func (t *Textbox) Serialize(e page.Encoder) (err error)
- func (t *Textbox) SetColumnCount(columns int)
- func (t *Textbox) SetMaxLength(len int) *MaxLengthValidator
- func (t *Textbox) SetMinLength(len int) *MinLengthValidator
- func (t *Textbox) SetPlaceholder(s string) TextboxI
- func (t *Textbox) SetReadOnly(r bool)
- func (t *Textbox) SetRowCount(rows int)
- func (t *Textbox) SetText(s string) page.ControlI
- func (t *Textbox) SetType(typ string) TextboxI
- func (t *Textbox) SetValue(v interface{}) page.ControlI
- func (t *Textbox) Text() string
- func (t *Textbox) UnmarshalState(m maps.Loader)
- func (t *Textbox) UpdateFormValues(ctx *page.Context)
- func (t *Textbox) Validate(ctx context.Context) bool
- func (t *Textbox) ValidateWith(v Validater)
- func (t *Textbox) Value() interface{}
- func (t *Textbox) ΩisSerializer(i page.ControlI) bool
- type TextboxI
- type UnorderedList
- func (l *UnorderedList) DrawInnerHtml(ctx context.Context, buf *bytes.Buffer) (err error)
- func (l *UnorderedList) DrawTag(ctx context.Context) string
- func (l *UnorderedList) DrawingAttributes() *html.Attributes
- func (l *UnorderedList) GetItemsHtml(items []ListItemI) string
- func (l *UnorderedList) Init(self page.ControlI, parent page.ControlI, id string)
- func (l *UnorderedList) SetBulletStyle(s string)
- func (l *UnorderedList) SetSubTag(s string)
- type UnorderedListI
- type Validater
Constants ¶
const ( ButtonClick = iota + 3000 DialogClose )
event codes
const ( DialogStateDefault = iota DialogStateError DialogStateWarning DialogStateInfo DialogStateSuccess )
const ( OrderedListNumberTypeNumber = "1" // default OrderedListNumberTypeUpperLetter = "A" OrderedListNumberTypeLowerLetter = "a" OrderedListNumberTypeUpperRoman = "I" OrderedListNumberTypeLowerRoman = "i" )
const ( UnorderedListStyleDisc = "disc" // default UnorderedListStyleCircle = "circle" UnorderedListStyleSquare = "square" UnorderedListStyleNone = "none" )
const ( ColumnAction = iota + 2000 SortClick )
const ( NotSortable = SortDirection(0) SortAscending = SortDirection(1) SortDescending = SortDirection(-1) NotSorted = SortDirection(-100) )
const ( TextboxTypeDefault = "text" TextboxTypePassword = "password" TextboxTypeSearch = "search" TextboxTypeNumber = "number" // Puts little arrows in box, will need to widen it. TextboxTypeEmail = "email" // see TextEmail. Prevents submission of RFC5322 email addresses (Gogh Fir <gf@example.com>) TextboxTypeTel = "tel" // not well supported TextboxTypeUrl = "url" )
const DialogButtonEvent = "gr-dlgbtn"
const (
PageClick = iota + 1000
)
Variables ¶
var DefaultMaxPagintorButtons = 10
DefaultMaxPagintorButtons is the default maximum number of buttons to display on the pager. You can change this in an individual control, too.
var DefaultPaginatorPageSize = 10
DefaultPaginatorPageSize is the default number of items that a paginated control will show. You can change this in an individual control, too.
var SortButtonHtmlGetter func(SortDirection) string
SortButtonHtmlGetter is the injected function for getting the html for sort buttons in the column header. The default uses FontAwesome to draw the buttons, which means the css for FontAwesome must be loaded into the web page. You can change what html is loaded by setting this function.
Functions ¶
func SetAlertFunction ¶
func SetAlertFunction(f AlertFuncType)
Types ¶
type AlertFuncType ¶
type Button ¶
Button is a standard html button. It derives from the button in the override class, allowing you to customize the behavior of all buttons in your application.
func (*Button) DrawingAttributes ¶
func (b *Button) DrawingAttributes() *html.Attributes
DrawingAttributes retrieves the tag's attributes at draw time. You should not normally need to call this, and the attributes are disposed of after drawing, so they are essentially read-only.
func (*Button) OnSubmit ¶
OnSubmit is a shortcut for adding a click event handler that is particular to buttons and button like objects. It debounces the click, so that all other events are lost until this event processes. It should generally be used for operations that will eventually redirect to a different page. If coupling this with an ajax response, you should probably also make the response priority PriorityFinal.
func (*Button) SetIsPrimary ¶
type Canvas ¶
Canvas is a Goradd control that is a basic "div" wrapper. Use it to style and listen to events on a div. It can also be used as the basis for more advanced javascript controls.
func (*Canvas) DrawingAttributes ¶
func (c *Canvas) DrawingAttributes() *html.Attributes
type CellTexter ¶
type Checkbox ¶
type Checkbox struct {
CheckboxBase
}
func (*Checkbox) DrawingAttributes ¶
func (c *Checkbox) DrawingAttributes() *html.Attributes
func (*Checkbox) UpdateFormValues ¶
UpdateFormValues is an internal call that lets us reflect the value of the checkbox on the web override
type CheckboxBase ¶
type CheckboxBase struct { page.Control LabelMode html.LabelDrawingMode // how to draw the label associating the text with the checkbox // contains filtered or unexported fields }
Checkbox is a base class for checkbox-like objects, including html checkboxes and radio buttons.
func (*CheckboxBase) Checked ¶
func (c *CheckboxBase) Checked() bool
func (*CheckboxBase) Deserialize ¶
func (*CheckboxBase) DrawTag ¶
func (c *CheckboxBase) DrawTag(ctx context.Context) (ctrl string)
Draw the checkbox tag. This can be quite tricky. Some CSS frameworks are very particular about how checkboxes get associated with labels. The Text value of the control will become the text directly associated with the checkbox, while the Label value is only shown when drawing a checkbox with a wrapper.
func (*CheckboxBase) DrawingAttributes ¶
func (c *CheckboxBase) DrawingAttributes() *html.Attributes
DrawingAttributes retrieves the tag's attributes at draw time. You should not normally need to call this, and the attributes are disposed of after drawing, so they are essentially read-only.
func (*CheckboxBase) GetDrawingInputLabelAttributes ¶
func (c *CheckboxBase) GetDrawingInputLabelAttributes() *html.Attributes
func (*CheckboxBase) Init ¶
Init initializes a checbox base class. Normally you will not call this directly. However, sub controls should call this after creation to get the enclosed control initialized.
func (*CheckboxBase) InputLabelAttributes ¶
func (c *CheckboxBase) InputLabelAttributes() *html.Attributes
Returns a pointer to the input label attributes. Feel free to set the attributes directly on the returned object. The input label attributes are the attributes for the label tag that associates the Text with the checkbox. This is specific to checkbox style controls and is not the same as the label tag that appears when using a name wrapper. After setting attributes, be sure to call Refresh on the control if you do this during an Ajax response.
func (*CheckboxBase) MarshalState ¶
func (c *CheckboxBase) MarshalState(m maps.Setter)
*
- Puts the current state of the control to be able to restore it later.
func (*CheckboxBase) SetChecked ¶
func (c *CheckboxBase) SetChecked(v bool) CheckboxI
Set the value of the checkbox. Returns itself for chaining.
func (*CheckboxBase) SetCheckedNoRefresh ¶
func (c *CheckboxBase) SetCheckedNoRefresh(v interface{})
SetCheckedNoRefresh is used internally to update values without causing a refresh loop.
func (*CheckboxBase) SetLabelDrawingMode ¶
func (c *CheckboxBase) SetLabelDrawingMode(m html.LabelDrawingMode)
func (*CheckboxBase) SetValue ¶
func (c *CheckboxBase) SetValue(v interface{}) CheckboxI
func (*CheckboxBase) TextIsLabel ¶
func (c *CheckboxBase) TextIsLabel() bool
func (*CheckboxBase) UnmarshalState ¶
func (c *CheckboxBase) UnmarshalState(m maps.Loader)
*
- Restore the state of the control.
- @param mixed $state Previously saved state as returned by GetState above.
func (*CheckboxBase) Value ¶
func (c *CheckboxBase) Value() interface{}
func (*CheckboxBase) ΩisSerializer ¶
func (c *CheckboxBase) ΩisSerializer(i page.ControlI) bool
ΩisSerializer is used by the automated control serializer to determine how far down the control chain the control has to go before just calling serialize and deserialize
type CheckboxI ¶
type CheckboxI interface { page.ControlI GetDrawingInputLabelAttributes() *html.Attributes }
type CheckboxList ¶
type CheckboxList struct { MultiselectList // contains filtered or unexported fields }
CheckboxList is a multi-select control that presents its choices as a list of checkboxes. Styling is provided by divs and spans that you can provide css for in your style sheets. The goradd.css file has default styling to handle the basics. It wraps the whole thing in a div that can be set to scroll as well, so that the final structure can be styled like a multi-table table, or a single-table scrolling list much like a standard html select list.
func NewCheckboxList ¶
func NewCheckboxList(parent page.ControlI, id string) *CheckboxList
func (*CheckboxList) ColumnCount ¶
func (l *CheckboxList) ColumnCount() int
func (*CheckboxList) Direction ¶
func (l *CheckboxList) Direction() ItemDirection
func (*CheckboxList) DrawInnerHtml ¶
func (*CheckboxList) DrawingAttributes ¶
func (l *CheckboxList) DrawingAttributes() *html.Attributes
DrawingAttributes retrieves the tag's attributes at draw time. You should not normally need to call this, and the attributes are disposed of after drawing, so they are essentially read-only.
func (*CheckboxList) RenderItem ¶
func (l *CheckboxList) RenderItem(tag string, item ListItemI) (h string)
func (*CheckboxList) SetColumnCount ¶
func (l *CheckboxList) SetColumnCount(columns int) CheckboxListI
func (*CheckboxList) SetDirection ¶
func (l *CheckboxList) SetDirection(direction ItemDirection) CheckboxListI
func (*CheckboxList) SetIsScrolling ¶
func (l *CheckboxList) SetIsScrolling(s bool) CheckboxListI
func (*CheckboxList) SetLabelDrawingMode ¶
func (l *CheckboxList) SetLabelDrawingMode(mode html.LabelDrawingMode) CheckboxListI
func (*CheckboxList) UpdateFormValues ¶
func (l *CheckboxList) UpdateFormValues(ctx *page.Context)
type CheckboxListI ¶
type CheckboxListI interface { MultiselectListI RenderItem(tag string, item ListItemI) (h string) }
type ColumnBase ¶
type ColumnBase struct { base.Base *html.Attributes // These are attributes that will appear on the cell // contains filtered or unexported fields }
func (*ColumnBase) Action ¶
func (c *ColumnBase) Action(ctx context.Context, params page.ActionParams)
Do a table action that is directed at this table Column implementations can implement this method to receive private actions that they have added using AddActions
func (*ColumnBase) AddActions ¶
func (c *ColumnBase) AddActions(ctrl page.ControlI)
func (*ColumnBase) CellAttributes ¶
func (c *ColumnBase) CellAttributes(ctx context.Context, row int, col int, data interface{}) *html.Attributes
func (*ColumnBase) CellTexter ¶
func (c *ColumnBase) CellTexter() CellTexter
func (*ColumnBase) ColTagAttributes ¶
func (c *ColumnBase) ColTagAttributes() *html.Attributes
ColTagAttributes specifies attributes that will appear in the table tag. Note that you have to turn on table tags in the table object as well for these to appear.
func (*ColumnBase) DrawColumnTag ¶
func (c *ColumnBase) DrawColumnTag(ctx context.Context, buf *bytes.Buffer)
func (*ColumnBase) DrawFooterCell ¶
func (*ColumnBase) FooterAttributes ¶
func (c *ColumnBase) FooterAttributes(row int, col int) *html.Attributes
func (*ColumnBase) FooterCellHtml ¶
func (*ColumnBase) HeaderAttributes ¶
func (c *ColumnBase) HeaderAttributes(row int, col int) *html.Attributes
func (*ColumnBase) HeaderCellHtml ¶
HeaderCellHtml returns the text of the indicated header cell. The default will call into the headerTexter if it is provided, or just return the Label value. This function can also be overridden by embedding the ColumnBase object into another object.
func (*ColumnBase) ID ¶
func (c *ColumnBase) ID() string
func (*ColumnBase) Init ¶
func (c *ColumnBase) Init(self ColumnI)
func (*ColumnBase) IsHidden ¶
func (c *ColumnBase) IsHidden() bool
func (*ColumnBase) IsSortable ¶
func (c *ColumnBase) IsSortable() bool
func (*ColumnBase) ParentTable ¶
func (c *ColumnBase) ParentTable() TableI
func (*ColumnBase) RenderSortButton ¶
func (c *ColumnBase) RenderSortButton(labelHtml string) string
func (*ColumnBase) SetCellStyler ¶
func (c *ColumnBase) SetCellStyler(s html.Attributer)
func (*ColumnBase) SetCellTexter ¶
func (c *ColumnBase) SetCellTexter(s CellTexter)
func (*ColumnBase) SetFooterTexter ¶
func (c *ColumnBase) SetFooterTexter(s CellTexter)
func (*ColumnBase) SetHeaderTexter ¶
func (c *ColumnBase) SetHeaderTexter(s CellTexter)
func (*ColumnBase) SetHidden ¶
func (c *ColumnBase) SetHidden(h bool)
func (*ColumnBase) SetID ¶
func (c *ColumnBase) SetID(id string) ColumnI
SetId sets the id of the table. If you are going to provide your own id, do this as the first thing after you create a table, or the new id might not propogate through the system correctly. Note that the id in html will have the table id prepended to it. This is required so that actions can be routed to a column.
func (*ColumnBase) SetIsHtml ¶
func (c *ColumnBase) SetIsHtml(columnIsHtml bool)
func (*ColumnBase) SetRenderAsHeader ¶
func (c *ColumnBase) SetRenderAsHeader(r bool)
func (*ColumnBase) SetSortDirection ¶
func (c *ColumnBase) SetSortDirection(d SortDirection)
SetSortDirection is used internally to set the sort direction indicator
func (*ColumnBase) SetSpan ¶
func (c *ColumnBase) SetSpan(span int) ColumnI
func (*ColumnBase) SetTitle ¶
func (c *ColumnBase) SetTitle(title string) ColumnI
func (*ColumnBase) SortDirection ¶
func (c *ColumnBase) SortDirection() SortDirection
func (*ColumnBase) Sortable ¶
func (c *ColumnBase) Sortable() ColumnI
Sortable indicates that the column should be drawn with sort indicators.
func (*ColumnBase) Span ¶
func (c *ColumnBase) Span() int
func (*ColumnBase) Title ¶
func (c *ColumnBase) Title() string
func (*ColumnBase) UpdateFormValues ¶
func (c *ColumnBase) UpdateFormValues(ctx *page.Context)
UpdateFormValues is called by the system whenever values are sent by client controls. This default version does nothing. Columns that need to record information (checkbox columns for example), should implement this.
type ColumnI ¶
type ColumnI interface { ID() string SetID(string) ColumnI ParentTable() TableI Title() string SetTitle(string) ColumnI Span() int SetSpan(int) ColumnI IsHidden() bool SetHidden(bool) DrawColumnTag(ctx context.Context, buf *bytes.Buffer) DrawCell(ctx context.Context, row int, col int, data interface{}, buf *bytes.Buffer) CellText(ctx context.Context, row int, col int, data interface{}) string HeaderCellHtml(ctx context.Context, row int, col int) string HeaderAttributes(row int, col int) *html.Attributes ColTagAttributes() *html.Attributes UpdateFormValues(ctx *page.Context) AddActions(ctrl page.ControlI) Action(ctx context.Context, params page.ActionParams) SetHeaderTexter(s CellTexter) SetCellTexter(s CellTexter) SetCellStyler(s html.Attributer) IsSortable() bool SortDirection() SortDirection SetSortDirection(SortDirection) Sortable() ColumnI SetIsHtml(columnIsHtml bool) // contains filtered or unexported methods }
type DataPager ¶
type DataPager struct { page.Control ObjectName string ObjectPluralName string LabelForNext string LabelForPrevious string Proxy *Proxy // contains filtered or unexported fields }
DataPager is a toolbar designed to aid scrolling through a large set of data. It is implemented using Aria design best practices. It is designed to be paired with a Table or DataRepeater to aid in navigating through the data. It is similar to a Paginator, but a paginator is for navigating through a whole series of pages and not just for data on one override.
func NewDataPager ¶
func NewDataPager(parent page.ControlI, id string, paginatedControl PaginatedControlI) *DataPager
func (*DataPager) Action ¶
func (d *DataPager) Action(ctx context.Context, params page.ActionParams)
func (*DataPager) Deserialize ¶
func (*DataPager) DrawInnerHtml ¶
func (*DataPager) DrawingAttributes ¶
func (d *DataPager) DrawingAttributes() *html.Attributes
func (*DataPager) MarshalState ¶
MarshalState is an internal function to save the state of the control
func (*DataPager) NextButtonsHtml ¶
func (*DataPager) PageButtonsHtml ¶
func (*DataPager) PaginatedControl ¶
func (d *DataPager) PaginatedControl() PaginatedControlI
func (*DataPager) PreviousButtonsHtml ¶
func (*DataPager) SetMaxPageButtons ¶
SetMaxPageButtons sets the maximum number of buttons that will be displayed in the paginator.
func (*DataPager) SetObjectNames ¶
func (*DataPager) SliceOffsets ¶
SliceOffsets returns the start and end values to use to specify a portion of a slice corresponding to the data the pager refers to
func (*DataPager) SqlLimits ¶
SqlLimits returns the limits you would use in a sql database limit clause
func (*DataPager) UnmarshalState ¶
UnmarshalState is an internal function to restore the state of the control
type DataPagerI ¶
type DataPagerI interface { page.ControlI PreviousButtonsHtml() string NextButtonsHtml() string PageButtonsHtml(i int) string }
DataPagerI is the data pager interface that allows this object to call into subclasses.
type DateTextbox ¶
type DateTextbox struct { Textbox // contains filtered or unexported fields }
func NewDateTextbox ¶
func NewDateTextbox(parent page.ControlI, id string) *DateTextbox
func (*DateTextbox) Date ¶
func (d *DateTextbox) Date() datetime.DateTime
func (*DateTextbox) Init ¶
func (d *DateTextbox) Init(self TextboxI, parent page.ControlI, id string)
func (*DateTextbox) SetDate ¶
func (d *DateTextbox) SetDate(dt datetime.DateTime)
func (*DateTextbox) SetFormat ¶
func (d *DateTextbox) SetFormat(format DateTextboxFormat)
SetMinValue creates a validator that makes sure the value of the text box is at least the given value. Specify your own error message, or leave the error message blank and a standard error message will be presented if the value is not valid.
func (*DateTextbox) SetValue ¶
func (d *DateTextbox) SetValue(val interface{}) *DateTextbox
func (*DateTextbox) Value ¶
func (d *DateTextbox) Value() interface{}
type DateTextboxFormat ¶
type DateTextboxFormat int
const ( DateTextboxUS DateTextboxFormat = iota // default to US format M/D/Y DateTextboxEuro // D/M/Y )
Go does not yet have internal support for international dates so we will need to do this ourselves
type DateTimeSpan ¶
type DateTimeSpan struct { Span // contains filtered or unexported fields }
DateTimeSpan is a span that displays a datetime value as static text. This is a typical default control to use for a timestamp in the database.
func NewDateTimeSpan ¶
func NewDateTimeSpan(parent page.ControlI, id string) *DateTimeSpan
func (*DateTimeSpan) DrawInnerHtml ¶
func (*DateTimeSpan) SetDateTime ¶
func (s *DateTimeSpan) SetDateTime(d datetime.DateTime)
func (*DateTimeSpan) SetFormat ¶
func (s *DateTimeSpan) SetFormat(format string) *DateTimeSpan
func (*DateTimeSpan) SetValue ¶
func (s *DateTimeSpan) SetValue(v interface{})
func (*DateTimeSpan) Value ¶
func (s *DateTimeSpan) Value() datetime.DateTime
type DateValidator ¶
type DateValidator struct { Message string // contains filtered or unexported fields }
type Dialog ¶
type Dialog struct { Panel // contains filtered or unexported fields }
Our own implementation of a dialog. This works cooperatively with javascript in qcubed.js to create a minimal implementation of the dialog interface.
func (*Dialog) AddCloseButton ¶
AddCloseButton adds a button to the list of buttons with the given label, but this button will trigger the DialogCloseEvent instead of the DialogButtonEvent. The button will also close the dialog (by hiding it).
func (*Dialog) DrawTemplate ¶
func (*Dialog) DrawingAttributes ¶
func (d *Dialog) DrawingAttributes() *html.Attributes
func (*Dialog) HasCloseBox ¶
func (*Dialog) RemoveAllButtons ¶
func (d *Dialog) RemoveAllButtons()
func (*Dialog) RemoveButton ¶
func (*Dialog) SetButtonStyles ¶
SetButtonStyle sets css styles on a button that is already in the dialog
func (*Dialog) SetButtonVisible ¶
func (*Dialog) SetDialogState ¶
type DialogButtonOptions ¶
type DialogButtonOptions struct { // Set Validates to true to indicate that this button will validate the dialog Validates bool // Set IsPrimary to true to make this a submit button so the user can press enter to activate it IsPrimary bool // ConfirmationMessage will appear with a yes/no box making sure the user wants the action. This is usually used // when the action could be destructive, like a Delete button. ConfirmationMessage string // PushLeft pushes this button to the left side of the dialog. Buttons are typically aligned right. This is helpful to separate particular // buttons from the main grouping of buttons. PushLeft bool // IsClose will set the button up to automatically close the dialog. Detect closes with the DialogCloseEvent if needed. // The button will not send a DialogButton event. IsClose bool // Options are additional options specific to the dialog implementation you are using. Options map[string]interface{} }
DialogButtonOptions are optional additional items you can add to a dialog button.
type DialogI ¶
DialogI defines the publicly coconsumable api that the QCubed framework uses to interact with a dialog.
More and more CSS and javascript frameworks are coming out with their own forms of dialog, which is usually a combination of html tag(s), css and javascript widget. QCubed has many ways of potentially interacting with * dialogs, but to be able to inject a dialog into the framework, we need a consistent interface for all to use. * * This particular interface has been implemented in both JQuery UI dialogs and Bootstrap dialogs. As more needs arise, * we can modify the interface to accomodate as many frammeworks as possible. * * Dialogs should descend from the Panel control. Dialogs should be able to be a member of a form or control object * and appear with an Open call, but they should also be able to be instantiated on the fly. The framework has hooks for * both, and if you are creating a dialog implementation, see the current JQuery UI and Bootstrap implementations for more * direction. * * Feel free to implement more than just the function listed. These are the minimal set to allow your dialog to be used * by the default QCubed framework.
type EmailTextbox ¶
type EmailTextbox struct { Textbox // contains filtered or unexported fields }
EmailTextbox is a Text control that validates for email addresses. EmailTextbox can accept multiple addresses separated by commas, and can accept any address in RFC5322 format (Barry Gibbs <bg@example.com>) making it useful for people copying addresses out of an email client and pasting into the field.
func NewEmailTextbox ¶
func NewEmailTextbox(parent page.ControlI, id string) *EmailTextbox
NewEmailTextbox creates a new textbox that validates its input as an email address. multi will allow the textbox to accept multiple email addresses separated by a comma.
func (*EmailTextbox) Addresses ¶
func (t *EmailTextbox) Addresses() []string
Addresses returns a slice of the individual addresses entered, stripped of any extra text entered.
func (*EmailTextbox) Init ¶
func (t *EmailTextbox) Init(self TextboxI, parent page.ControlI, id string)
func (*EmailTextbox) SetMaxCount ¶
func (t *EmailTextbox) SetMaxCount(max int)
func (*EmailTextbox) UpdateFormValues ¶
func (t *EmailTextbox) UpdateFormValues(ctx *page.Context)
type Fieldset ¶
type Fieldset struct {
Panel
}
Fieldset is a Panel that is drawn with a fieldset tag. The panel's label is used as the legend tag. Fieldset's cannot have wrappers.
func (*Fieldset) DrawingAttributes ¶
func (c *Fieldset) DrawingAttributes() *html.Attributes
type FloatTextbox ¶
type FloatTextbox struct {
Textbox
}
FloatTextbox is a text control that ensures a valid floating point number is entered in the field.
func NewFloatTextbox ¶
func NewFloatTextbox(parent page.ControlI, id string) *FloatTextbox
func (*FloatTextbox) Float32 ¶
func (i *FloatTextbox) Float32() float32
func (*FloatTextbox) Float64 ¶
func (i *FloatTextbox) Float64() float64
func (*FloatTextbox) Init ¶
func (i *FloatTextbox) Init(self TextboxI, parent page.ControlI, id string)
func (*FloatTextbox) SetFloat32 ¶
func (i *FloatTextbox) SetFloat32(v float32) *FloatTextbox
func (*FloatTextbox) SetFloat64 ¶
func (i *FloatTextbox) SetFloat64(v float64) *FloatTextbox
func (*FloatTextbox) SetMaxValue ¶
func (i *FloatTextbox) SetMaxValue(maxValue float64, invalidMessage string)
func (*FloatTextbox) SetMinValue ¶
func (i *FloatTextbox) SetMinValue(minValue float64, invalidMessage string)
func (*FloatTextbox) Value ¶
func (i *FloatTextbox) Value() interface{}
type FloatValidator ¶
type FloatValidator struct {
Message string
}
type FormBase ¶
The FormBase is the control that all Form objects should include, and is the master container for all other goradd controls.
type Image ¶
Image is an img tag. You can display either a URL, or direct image information by setting the Src or the Data values.
func (*Image) DrawingAttributes ¶
func (i *Image) DrawingAttributes() *html.Attributes
func (*Image) Init ¶
Initializes a textbox. Normally you will not call this directly. However, sub controls should call this after creation to get the enclosed control initialized. Self is the newly created class. Like so: t := &MyTextBox{} t.Textbox.Init(t, parent, id) A parent control is isRequired. Leave id blank to have the system assign an id to the control.
func (*Image) SetMimeType ¶
Set the MIME type for the data, (jpeg, gif, png, etc.)
type ImageCapture ¶
type ImageCapture struct { Panel Canvas *Canvas CaptureButton *Button SwitchCameraButton *Button ErrText *Panel // contains filtered or unexported fields }
ImageCapture is a panel that has both an image and button to help you capture images from the user. It is a kind of composite control that exports and image and button object that you can further manipulate after creation. It also has javascript to manage the actual image capture process. It does not currently permit uploading of image files. It only captures images from devices and browsers that support image capture.
func NewImageCapture ¶
func NewImageCapture(parent page.ControlI, id string) *ImageCapture
func (*ImageCapture) Data ¶
func (i *ImageCapture) Data() []byte
func (*ImageCapture) DrawingAttributes ¶
func (i *ImageCapture) DrawingAttributes() *html.Attributes
func (*ImageCapture) Init ¶
func (i *ImageCapture) Init(self ImageCaptureI, parent page.ControlI, id string)
Initializes a textbox. Normally you will not call this directly. However, sub controls should call this after creation to get the enclosed control initialized. Self is the newly created class. Like so: t := &MyTextBox{} t.Textbox.Init(t, parent, id) A parent control is isRequired. Leave id blank to have the system assign an id to the control.
func (*ImageCapture) PutCustomScript ¶
func (i *ImageCapture) PutCustomScript(ctx context.Context, response *page.Response)
func (*ImageCapture) SetData ¶
func (i *ImageCapture) SetData(data []byte)
SetData sets the binary picture data. The data must be in the mime type format.
func (*ImageCapture) SetMaskShape ¶
func (i *ImageCapture) SetMaskShape(shape ImageCaptureShape)
SetMaskShape sets the masking shape for the image
func (*ImageCapture) SetMimeType ¶
func (i *ImageCapture) SetMimeType(typ string)
func (*ImageCapture) SetPixelSize ¶
func (i *ImageCapture) SetPixelSize(width int, height int)
SetPixelSize sets the pixel size of the image that will be returned. Control the visible size of the canvas through setting css sizes.
func (*ImageCapture) SetQuality ¶
func (i *ImageCapture) SetQuality(quality float32)
SetQuality specifies a number between 0 and 1 used as the quality value for capturing jpegs or webp images.
func (*ImageCapture) SetZoom ¶
func (i *ImageCapture) SetZoom(zoom int)
SetZoom zooms the camera by the given percent, i.e. 50 is 50% closer and 100 would be a 2x zoom.
func (*ImageCapture) TurnOff ¶
func (i *ImageCapture) TurnOff()
func (*ImageCapture) UpdateFormValues ¶
func (i *ImageCapture) UpdateFormValues(ctx *page.Context)
type ImageCaptureI ¶
type ImageCaptureShape ¶
type ImageCaptureShape string
const ( ImageCaptureShapeRect ImageCaptureShape = "rect" ImageCaptureShapeCircle ImageCaptureShape = "circle" )
type IntValidator ¶
type IntValidator struct {
Message string
}
type IntegerTextbox ¶
type IntegerTextbox struct { Textbox // contains filtered or unexported fields }
func NewIntegerTextbox ¶
func NewIntegerTextbox(parent page.ControlI, id string) *IntegerTextbox
func (*IntegerTextbox) Init ¶
func (i *IntegerTextbox) Init(self TextboxI, parent page.ControlI, id string)
func (*IntegerTextbox) Int ¶
func (i *IntegerTextbox) Int() int
func (*IntegerTextbox) Int64 ¶
func (i *IntegerTextbox) Int64() int64
func (*IntegerTextbox) SetInt ¶
func (i *IntegerTextbox) SetInt(v int) *IntegerTextbox
func (*IntegerTextbox) SetMaxValue ¶
func (i *IntegerTextbox) SetMaxValue(maxValue int, invalidMessage string)
SetMaxValue creates a validator that makes sure the value of the text box is at most the given value. Specify your own error message, or leave the error message blank and a standard error message will be presented if the value is not valid.
func (*IntegerTextbox) SetMinValue ¶
func (i *IntegerTextbox) SetMinValue(minValue int, invalidMessage string)
SetMinValue creates a validator that makes sure the value of the text box is at least the given value. Specify your own error message, or leave the error message blank and a standard error message will be presented if the value is not valid.
func (*IntegerTextbox) SetValue ¶
func (i *IntegerTextbox) SetValue(v interface{}) *IntegerTextbox
func (*IntegerTextbox) Value ¶
func (i *IntegerTextbox) Value() interface{}
type ItemDirection ¶
type ItemDirection int
const ( HorizontalItemDirection ItemDirection = 0 VerticalItemDirection = 1 )
type ItemIDer ¶
type ItemIDer interface { ID() interface{} String() string }
ItemIDer is an interface to a listable object that matches orm objects
type ItemList ¶
type ItemList struct {
// contains filtered or unexported fields
}
ItemList manages a list of ListItemI list items. ItemList is designed to be embedded in another structure, and will turn that object into a manager of list items. ItemList will manage the id's of the items in its list, you do not have control of that, and it needs to manage those ids in order to efficiently manage the selection process.
func NewItemList ¶
NewItemList creates a new item list. "owner" is the object that has the PatientList embedded in it, and must be an IDer.
func (*ItemList) AddItem ¶
AddItem adds the given item to the end of the list. The value is optional, but should only be one or zero values.
func (*ItemList) AddItemAt ¶
AddItemAt adds the item at the given index. If the index is negative, it counts from the end. If the index is -1 or bigger than the number of items, it adds it to the end. If the index is zero, or is negative and smaller than the negative value of the number of items, it adds to the beginning. This can be an expensive operation in a long hierarchical list, so use sparingly.
func (*ItemList) AddListItemAt ¶
AddItemAt adds the item at the given index. If the index is negative, it counts from the end. If the index is -1 or bigger than the number of items, it adds it to the end. If the index is zero, or is negative and smaller than the negative value of the number of items, it adds to the beginning. This can be an expensive operation in a long hierarchical list, so use sparingly.
func (*ItemList) AddListItems ¶
func (l *ItemList) AddListItems(items ...interface{})
AddListItems adds one or more objects to the end of the list. items should be a list of ListItemI, ItemLister, ItemIDer, Labeler or Stringer types. This function can accept one or more lists of items, or single items
func (*ItemList) GetItem ¶
GetItem recursively searches for and returns the item corresponding to the given id. Since we are managing the id numbers, we can efficiently find the item. Note that if you add items to the list, the ids may change.
func (*ItemList) GetItemByValue ¶
GetItemByValue recursively searches the list to find the item with the given value. It starts with the current list, and if not found, will search in sublists.
func (*ItemList) Len ¶
Len returns the length of the item list at the current level. In other words, it does not count items in sublists.
type ItemListI ¶
type ItemListI interface { AddItem(label string, value ...interface{}) ListItemI AddItemAt(index int, label string, value ...interface{}) AddListItemAt(index int, item ListItemI) AddListItems(items ...interface{}) GetItemAt(index int) ListItemI ListItems() []ListItemI Clear() RemoveAt(index int) Len() int GetItem(id string) (foundItem ListItemI) GetItemByValue(value interface{}) (id string, foundItem ListItemI) // contains filtered or unexported methods }
type ItemLister ¶
type ItemLister interface { Value() interface{} Label() string }
type ListItem ¶
type ListItem struct { ItemList // contains filtered or unexported fields }
A ListItem is an object that is a member of a list. HTML has a few different kinds of lists, and this can be a member of a select list (<select>), or an ordered or unordered list (<ul> or <ol>). It is up to the manager of the list to render the item, but this serves as a place to store options about the item. Not all options are pertinent to all lists.
A list item generally has a value, and a label. Often, lists will have ids too, that will appear in the html output, but the id values are managed by the list manager and generally should not be set by you. In situations where the user selects a list item, you would use the id to retrieve the ListItem selected.
func NewItemFromItemIDer ¶
NewItemFromItemIDer creates a new item from any object that has an ID and String method. Note that the ID() of the ItemIDer will become the value of the select item, and the String() will become the label
func NewItemFromItemLister ¶
func NewItemFromItemLister(i ItemLister) *ListItem
NewItemFromItemLister creates a new item from any object that has a Value and Label method.
func NewItemFromLabeler ¶
NewItemFromLabeler creates a new item from any object that has just a Label method.
func NewItemFromStringer ¶
NewItemFromStringer creates a new item from any object that has just a String method.
func NewListItem ¶
NewListItem creates a new item for a list. Specify an empty value for an item that represents no selection.
func (*ListItem) AnchorAttributes ¶
func (i *ListItem) AnchorAttributes() *html.Attributes
func (*ListItem) Attributes ¶
func (i *ListItem) Attributes() *html.Attributes
Attributes returns a pointer to the attributes of the item for customization. You can directly set the attributes on the returned object.
func (*ListItem) HasChildItems ¶
func (*ListItem) RenderLabel ¶
func (*ListItem) SetDisabled ¶
func (*ListItem) SetID ¶
SetID should not be called by your code typically. It is exported for implementations of item lists. The IDs of an item list are completely managed by the list, you cannot have custom ids.
func (*ListItem) SetIsDivider ¶
func (*ListItem) SetShouldEscapeLabel ¶
func (*ListItem) StringValue ¶
type ListItemI ¶
type ListItemI interface { ItemListI Value() interface{} ID() string SetID(string) Label() string SetLabel(string) SetDisabled(bool) Disabled() bool SetIsDivider(bool) IsDivider() bool IntValue() int StringValue() string HasChildItems() bool Attributes() *html.Attributes Anchor() string SetAnchor(string) AnchorAttributes() *html.Attributes RenderLabel() string }
type MaxFloatValidator ¶
type MaxIntValidator ¶
type MaxLengthValidator ¶
type MinFloatValidator ¶
type MinIntValidator ¶
type MinLengthValidator ¶
type MultiselectList ¶
MultiselectList is a generic list box which allows multiple selections. It is here for completeness, but is not used very often since it doesn't present an intuitive interface and is very browser dependent on what is presented. A Checkboxlist is better.
func NewMultiselectList ¶
func NewMultiselectList(parent page.ControlI, id string) *MultiselectList
func (*MultiselectList) DrawInnerHtml ¶
func (*MultiselectList) DrawingAttributes ¶
func (l *MultiselectList) DrawingAttributes() *html.Attributes
DrawingAttributes retrieves the tag's attributes at draw time. You should not normally need to call this, and the attributes are disposed of after drawing, so they are essentially read-only.
func (*MultiselectList) Init ¶
func (l *MultiselectList) Init(self MultiselectListI, parent page.ControlI, id string)
func (*MultiselectList) IsIdSelected ¶
func (l *MultiselectList) IsIdSelected(id string) bool
func (*MultiselectList) MarshalState ¶
func (l *MultiselectList) MarshalState(m maps.Setter)
MarshalState is an internal function to save the state of the control
func (*MultiselectList) SelectedIds ¶
func (l *MultiselectList) SelectedIds() []string
SelectedIds returns a list of ids sorted by id number that correspond to the selection
func (*MultiselectList) SelectedItems ¶
func (l *MultiselectList) SelectedItems() []ListItemI
func (*MultiselectList) SelectedLabels ¶
func (l *MultiselectList) SelectedLabels() []string
func (*MultiselectList) SelectedValues ¶
func (l *MultiselectList) SelectedValues() []interface{}
func (*MultiselectList) SetSelectedIds ¶
func (l *MultiselectList) SetSelectedIds(ids []string)
SetSelectedIds sets the current selection to the given ids. You must ensure that the items with the ids exist, it will not attempt to make sure the items exist.
func (*MultiselectList) SetSelectedIdsNoRefresh ¶
func (l *MultiselectList) SetSelectedIdsNoRefresh(ids []string)
func (*MultiselectList) SetSize ¶
func (l *MultiselectList) SetSize(size int) MultiselectListI
func (*MultiselectList) SetValue ¶
func (l *MultiselectList) SetValue(v interface{})
SetValue implements the Valuer interface for general purpose value getting and setting
func (*MultiselectList) Size ¶
func (l *MultiselectList) Size() int
func (*MultiselectList) UnmarshalState ¶
func (l *MultiselectList) UnmarshalState(m maps.Loader)
UnmarshalState is an internal function to restore the state of the control
func (*MultiselectList) UpdateFormValues ¶
func (l *MultiselectList) UpdateFormValues(ctx *page.Context)
UpdateFormValues is an internal function that lets us reflect the value of the selection on the web override
func (*MultiselectList) Value ¶
func (l *MultiselectList) Value() interface{}
Value implements the Valuer interface for general purpose value getting and setting
type MultiselectListI ¶
type OrderedList ¶
type OrderedList struct {
UnorderedList
}
UnorderedList is a dynamically generated html unordered list (ul). Such lists are often used as the basis for javascript and css widgets. If you use a data provider to set the data, you should call AddItems to the list in your GetData function. After drawing, the items will be removed.
func NewOrderedList ¶
func NewOrderedList(parent page.ControlI, id string) *OrderedList
func (*OrderedList) DrawInnerHtml ¶
func (*OrderedList) NumberType ¶
func (l *OrderedList) NumberType() string
func (*OrderedList) SetNumberType ¶
func (l *OrderedList) SetNumberType(t string) *OrderedList
SetNumberType sets the top level number style for the list. Choose from the OrderedListNumberType* constants. To set a number type for a sublevel, set the "type" attribute on the list item that is the parent of the sub list.
func (*OrderedList) SetStart ¶
func (l *OrderedList) SetStart(start int) *OrderedList
SetStart sets the starting number for the numbers in the top level list. To set the start of a sub-list, set the "start" attribute on the list item that is the parent of the sub-list.
type PaginatedControl ¶
type PaginatedControl struct {
// contains filtered or unexported fields
}
PaginatedControl is a mixin that makes a control controllable by a data pager
func (*PaginatedControl) AddDataPager ¶
func (c *PaginatedControl) AddDataPager(d DataPagerI)
func (*PaginatedControl) CalcPageCount ¶
func (c *PaginatedControl) CalcPageCount() int
func (*PaginatedControl) PageNum ¶
func (c *PaginatedControl) PageNum() int
func (*PaginatedControl) PageSize ¶
func (c *PaginatedControl) PageSize() int
func (*PaginatedControl) SetPageNum ¶
func (c *PaginatedControl) SetPageNum(n int)
func (*PaginatedControl) SetPageSize ¶
func (c *PaginatedControl) SetPageSize(size int)
SetPageSize sets the maximum number of items that will be displayed at one time. If more than this number of items is being displayed, the pager will allow paging to other items.
func (*PaginatedControl) SetTotalItems ¶
func (c *PaginatedControl) SetTotalItems(count uint)
func (*PaginatedControl) TotalItems ¶
func (c *PaginatedControl) TotalItems() int
type PaginatedControlI ¶
type PaginatedControlI interface { data.DataManagerI SetTotalItems(uint) TotalItems() int SetPageSize(size int) PageSize() int PageNum() int SetPageNum(n int) AddDataPager(DataPagerI) CalcPageCount() int // contains filtered or unexported methods }
PaginatedControlI is the interface that paginated controls must implement
type PaginatedTable ¶
type PaginatedTable struct { Table PaginatedControl }
func NewPaginatedTable ¶
func NewPaginatedTable(parent page.ControlI, id string) *PaginatedTable
type Panel ¶
Panel is a Goradd control that is a basic "div" wrapper. Use it to style and listen to events on a div. It can also be used as the basis for more advanced javascript controls.
func (*Panel) DrawingAttributes ¶
func (c *Panel) DrawingAttributes() *html.Attributes
type PrimaryKeyer ¶
type PrimaryKeyer interface {
PrimaryKey() string
}
PrimaryKeyer is an interface that is often implemented by model objects.
type Proxy ¶
func (*Proxy) ActionAttributes ¶
func (p *Proxy) ActionAttributes(actionValue string) *html.Attributes
Attributes returns attributes that can be included in any tag to attach a proxy to the tag.
func (*Proxy) ButtonHtml ¶
func (p *Proxy) ButtonHtml(label string, eventActionValue string, attributes *html.Attributes, rawHtml bool, ) string
ButtonHtml outputs the proxy as a button tag. eventActionValue becomes the event's value parameter
func (*Proxy) Draw ¶
Draw is used by the form engine to draw the control. As a proxy, there is no html to draw, but this is where the scripts attached to the proxy get sent to the response. This should get drawn by the auto-drawing routine, since proxies are not rendered in templates.
func (*Proxy) LinkHtml ¶
LinkHtml renders the proxy as a link. Generally, only do this if you are actually linking to a page. If not, use a button.
func (*Proxy) OnSubmit ¶
OnSubmit is a shortcut for adding a click event handler that is particular to buttons. It debounces the click, to prevent potential accidental multiple form submissions. All events fired after this event fires will be lost. It is intended to be used when the action will result in navigating to a new page.
type ProxyI ¶
type ProxyI interface { page.ControlI LinkHtml(label string, actionValue string, attributes *html.Attributes, ) string TagHtml(label string, actionValue string, attributes *html.Attributes, tag string, rawHtml bool, ) string ButtonHtml(label string, eventActionValue string, attributes *html.Attributes, rawHtml bool, ) string OnSubmit(actions ...action.ActionI) page.EventI }
type RadioButton ¶
type RadioButton struct { CheckboxBase // contains filtered or unexported fields }
RadioButton is a standard html radio button. You can optionally specify a group name for the radiobutton to belong to and the browser will make sure only one item in the group is selected.
func NewRadioButton ¶
func NewRadioButton(parent page.ControlI, id string) *RadioButton
func (*RadioButton) DrawingAttributes ¶
func (c *RadioButton) DrawingAttributes() *html.Attributes
func (*RadioButton) Group ¶
func (c *RadioButton) Group() string
func (*RadioButton) SetChecked ¶
func (c *RadioButton) SetChecked(v bool) RadioButtonI
func (*RadioButton) SetGroup ¶
func (c *RadioButton) SetGroup(g string) RadioButtonI
func (*RadioButton) UpdateFormValues ¶
func (c *RadioButton) UpdateFormValues(ctx *page.Context)
type RadioButtonI ¶
type RadioButtonI interface { CheckboxI }
type RadioList ¶
type RadioList struct {
CheckboxList
}
RadioList is a multi-select control that presents its choices as a list of checkboxes. Styling is provided by divs and spans that you can provide css for in your style sheets. The goradd.css file has default styling to handle the basics. It wraps the whole thing in a div that can be set to scroll as well, so that the final structure can be styled like a multi-table table, or a single-table scrolling list much like a standard html select list.
func (*RadioList) DrawingAttributes ¶
func (l *RadioList) DrawingAttributes() *html.Attributes
DrawingAttributes retrieves the tag's attributes at draw time. You should not normally need to call this, and the attributes are disposed of after drawing, so they are essentially read-only.
func (*RadioList) RenderItem ¶
func (*RadioList) SelectedLabel ¶
func (*RadioList) SelectedValue ¶
func (*RadioList) SetSelectedID ¶
func (*RadioList) SetSelectedValue ¶
func (l *RadioList) SetSelectedValue(v interface{})
func (*RadioList) UpdateFormValues ¶
type RadioListI ¶
type RadioListI interface { CheckboxListI }
type SelectList ¶
type SelectList struct { page.Control ItemList data.DataManager // contains filtered or unexported fields }
SelectList is typically a dropdown list with a single selection. Items are selected by id number, and the SelectList completely controls the ids in the list. Create the list by calling AddItem or AddItems to add ListItemI objects. Or, use the embedded DataManager to load items. Set the size attribute if you want to display it as a scrolling list rather than a dropdown list.
func NewSelectList ¶
func NewSelectList(parent page.ControlI, id string) *SelectList
func (*SelectList) DrawInnerHtml ¶
func (*SelectList) DrawingAttributes ¶
func (l *SelectList) DrawingAttributes() *html.Attributes
DrawingAttributes retrieves the tag's attributes at draw time. You should not normally need to call this, and the attributes are disposed of after drawing, so they are essentially read-only.
func (*SelectList) IntValue ¶
func (l *SelectList) IntValue() int
func (*SelectList) MarshalState ¶
func (l *SelectList) MarshalState(m maps.Setter)
MarshalState is an internal function to save the state of the control
func (*SelectList) SelectedItem ¶
func (l *SelectList) SelectedItem() ListItemI
SelectedItem will return the currently selected item. If no item has been selected, it will return the first item in the list, since that is what will be showing in the selection list, and will update its internal pointer to make the first item the current selection.
func (*SelectList) SelectedLabel ¶
func (l *SelectList) SelectedLabel() string
func (*SelectList) SetData ¶
func (l *SelectList) SetData(data interface{})
SetData overrides the default data setter to add objects to the item list. The result is kept in memory currently.
func (*SelectList) SetSelectedID ¶
func (l *SelectList) SetSelectedID(id string)
SetSelectedId sets the current selection to the given id. You must ensure that the item with the id exists, it will not attempt to make sure the item exists.
func (*SelectList) SetValue ¶
func (l *SelectList) SetValue(v interface{})
SetValue implements the Valuer interface for general purpose value getting and setting
func (*SelectList) StringValue ¶
func (l *SelectList) StringValue() string
func (*SelectList) UnmarshalState ¶
func (l *SelectList) UnmarshalState(m maps.Loader)
UnmarshalState is an internal function to restore the state of the control
func (*SelectList) UpdateFormValues ¶
func (l *SelectList) UpdateFormValues(ctx *page.Context)
UpdateFormValues is an internal function that lets us reflect the value of the selection on the web override
func (*SelectList) Value ¶
func (l *SelectList) Value() interface{}
Value implements the Valuer interface for general purpose value getting and setting
type SelectTable ¶
type SelectTable struct { Table // contains filtered or unexported fields }
SelectTable is a table that is row selectable. To detect a row selection, trigger on event.RowSelected
func NewSelectTable ¶
func NewSelectTable(parent page.ControlI, id string) *SelectTable
func (*SelectTable) DrawingAttributes ¶
func (t *SelectTable) DrawingAttributes() *html.Attributes
func (*SelectTable) GetRowAttributes ¶
func (t *SelectTable) GetRowAttributes(row int, data interface{}) (a *html.Attributes)
func (*SelectTable) MarshalState ¶
func (t *SelectTable) MarshalState(m maps.Setter)
func (*SelectTable) PutCustomScript ¶
func (t *SelectTable) PutCustomScript(ctx context.Context, response *page.Response)
func (*SelectTable) SelectedID ¶
func (t *SelectTable) SelectedID() string
func (*SelectTable) SetSelectedID ¶
func (t *SelectTable) SetSelectedID(id string)
func (*SelectTable) UnmarshalState ¶
func (t *SelectTable) UnmarshalState(m maps.Loader)
func (*SelectTable) UpdateFormValues ¶
func (t *SelectTable) UpdateFormValues(ctx *page.Context)
type SelectTableI ¶
type SelectTableI interface { TableI }
type SortDirection ¶
type SortDirection int
type Span ¶
type Span struct {
Panel
}
Span is a Goradd control that is a basic "span" wrapper. Use it to style and listen to events on a span. It can also be used as the basis for more advanced javascript controls.
func (*Span) DrawingAttributes ¶
func (c *Span) DrawingAttributes() *html.Attributes
type Table ¶
type Table struct { page.Control data.DataManager // contains filtered or unexported fields }
func (*Table) AddColumnAt ¶
func (*Table) ClearColumns ¶
func (t *Table) ClearColumns()
func (*Table) DrawCaption ¶
func (*Table) DrawInnerHtml ¶
func (*Table) DrawingAttributes ¶
func (t *Table) DrawingAttributes() *html.Attributes
func (*Table) GetColumnByID ¶
func (*Table) GetColumnByTitle ¶
func (*Table) GetFooterRowAttributes ¶
func (t *Table) GetFooterRowAttributes(row int) *html.Attributes
func (*Table) GetHeaderRowAttributes ¶
func (t *Table) GetHeaderRowAttributes(row int) *html.Attributes
func (*Table) GetRowAttributes ¶
func (t *Table) GetRowAttributes(row int, data interface{}) *html.Attributes
func (*Table) HeaderCellDrawingInfo ¶
func (*Table) HideColumns ¶
func (t *Table) HideColumns()
func (*Table) PrivateAction ¶
func (t *Table) PrivateAction(ctx context.Context, p page.ActionParams)
func (*Table) RemoveColumn ¶
func (*Table) RemoveColumnByID ¶
func (*Table) RemoveColumnByTitle ¶
func (*Table) RowStyler ¶
func (t *Table) RowStyler() html.Attributer
func (*Table) SetCaption ¶
func (t *Table) SetCaption(caption interface{})
func (*Table) SetFooterRowCount ¶
func (*Table) SetFooterRowStyler ¶
func (t *Table) SetFooterRowStyler(a html.Attributer)
func (*Table) SetHeaderRowCount ¶
func (*Table) SetHeaderRowStyler ¶
func (t *Table) SetHeaderRowStyler(a html.Attributer)
func (*Table) SetRowStyler ¶
func (t *Table) SetRowStyler(a html.Attributer)
func (*Table) SetSortHistoryLimit ¶
SetSortHistoryLimit sets the number of columns that the table will remember for the sort history. It defaults to 1, meaning it will remember only the current column. Setting it more than 1 will let the system report back on secondary sort columns that the user chose. For example, if the user clicks to sort a first name column, and then a last name column, it will let you know to sort by last name, and then first name.
func (*Table) ShowColumns ¶
func (t *Table) ShowColumns()
func (*Table) SortColumns ¶
SortColumns returns a slice of columns in sort order
func (*Table) Sortable ¶
Call Sortable to make a table sortable. It will attach sortable events and show the header if its not shown.
func (*Table) UpdateFormValues ¶
UpdateFormValues is called by the system whenever values are sent by client controls. We forward that to the columns.
type TableI ¶
type TableI interface { page.ControlI SetCaption(interface{}) DrawCaption(context.Context, *bytes.Buffer) error GetHeaderRowAttributes(row int) *html.Attributes GetRowAttributes(row int, data interface{}) *html.Attributes HeaderCellDrawingInfo(ctx context.Context, col ColumnI, rowNum int, colNum int) (cellHtml string, cellAttributes *html.Attributes) }
type Textbox ¶
func (*Textbox) Deserialize ¶
func (*Textbox) DrawInnerHtml ¶
DrawInnerHtml is an internal function that renders the inner html of a tag. In this case, it is rendering the inner text of a textarea
func (*Textbox) DrawingAttributes ¶
func (t *Textbox) DrawingAttributes() *html.Attributes
DrawingAttributes retrieves the tag's attributes at draw time. You should not normally need to call this, and the attributes are disposed of after drawing, so they are essentially read-only.
func (*Textbox) Init ¶
Initializes a textbox. Normally you will not call this directly. However, sub controls should call this after creation to get the enclosed control initialized. Self is the newly created class. Like so: t := &MyTextBox{} t.Textbox.Init(t, parent, id) A parent control is isRequired. Leave id blank to have the system assign an id to the control.
func (*Textbox) MarshalState ¶
MarshalState is an internal function to save the state of the control
func (*Textbox) Placeholder ¶
func (*Textbox) ResetValidators ¶
func (t *Textbox) ResetValidators()
func (*Textbox) Sanitize ¶
Sanitize takes user input and strips it of potential malicious XSS scripts. The default uses a global sanitizer creating a bootup. Override Sanitize in a subclass if you want a per-textbox sanitizer.
func (*Textbox) SetColumnCount ¶
SetColumnCount sets the visible width of the text control. Each table is an approximate with of a character, and is browser dependent, so its not a very good way of setting the width. The css width property is more accurate. Also, this is only the visible width, not the maximum number of characters.
func (*Textbox) SetMaxLength ¶
func (t *Textbox) SetMaxLength(len int) *MaxLengthValidator
func (*Textbox) SetMinLength ¶
func (t *Textbox) SetMinLength(len int) *MinLengthValidator
func (*Textbox) SetPlaceholder ¶
func (*Textbox) SetReadOnly ¶
func (*Textbox) SetRowCount ¶
SetRowCount sets the number of rowCount the Textbox will have. A value of 0 produces an input tag, and a value of 1 or greater produces a textarea tag.
func (*Textbox) SetType ¶
SetType sets the type of textbox this is. Pass it a TEXTBOX_TYPE... constant normally, thought you can pass any string and it will become the input type
func (*Textbox) UnmarshalState ¶
UnmarshalState is an internal function to restore the state of the control
func (*Textbox) UpdateFormValues ¶
UpdateFormValues is an internal function that lets us reflect the value of the textbox on the web override
func (*Textbox) Validate ¶
Validate will first check for the IsRequired attribute, and if set, will make sure a value is in the text field. It will then check the validators in the order assigned. The first invalid value found will return false.
func (*Textbox) ValidateWith ¶
ValidateWith adds a TextboxValidator to the validator list
type UnorderedList ¶
type UnorderedList struct { page.Control ItemList data.DataManager // contains filtered or unexported fields }
UnorderedList is a dynamically generated html unordered list (ul). Such lists are often used as the basis for javascript and css widgets. If you use a data provider to set the data, you should call AddItems to the list in your GetData function. After drawing, the items will be removed.
func NewUnorderedList ¶
func NewUnorderedList(parent page.ControlI, id string) *UnorderedList
func (*UnorderedList) DrawInnerHtml ¶
func (*UnorderedList) DrawingAttributes ¶
func (l *UnorderedList) DrawingAttributes() *html.Attributes
DrawingAttributes retrieves the tag's attributes at draw time. You should not normally need to call this, and the attributes are disposed of after drawing, so they are essentially read-only.
func (*UnorderedList) GetItemsHtml ¶
func (l *UnorderedList) GetItemsHtml(items []ListItemI) string
func (*UnorderedList) SetBulletStyle ¶
func (l *UnorderedList) SetBulletStyle(s string)
SetBulletType sets the bullet type. Choose from the UnorderedListStyle* constants.
func (*UnorderedList) SetSubTag ¶
func (l *UnorderedList) SetSubTag(s string)
type UnorderedListI ¶
type Validater ¶
type Validater interface { // Validate evaluates the input, and returns an empty string if the input is valid, and an error string to display // to the user if the input does not pass the validator. Validate(page.ControlI, string) string }
A Validater can be added to a textbox to validate its input on the server side. A textbox can have more than one validater. A number of built-in validators are provided.
Source Files ¶
- button.go
- canvas.go
- checkbox.go
- checkbox_base.go
- data_pager.go
- datetime_span.go
- dialog.go
- dialog.tpl.go
- fieldset.go
- form_base.go
- image.go
- image_capture.go
- item_list.go
- list_checkbox.go
- list_item.go
- list_multiselect.go
- list_ordered.go
- list_radio.go
- list_select.go
- list_unordered.go
- panel.go
- proxy.go
- radioButton.go
- span.go
- table.go
- table_column_base.go
- table_paginated.go
- table_select.go
- textbox.go
- textbox_date.go
- textbox_email.go
- textbox_float.go
- textbox_integer.go