-
Notifications
You must be signed in to change notification settings - Fork 0
/
textarea.go
56 lines (44 loc) · 1.13 KB
/
textarea.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package handlers
import (
"net/http"
mgc "github.com/mh-cbon/mdl-go-components"
"github.com/mh-cbon/mdl-go-components/components"
)
func Textarea(w http.ResponseWriter, r *http.Request) {
data := &viewData{
Title: "Textarea",
Components: make([]mgc.ViewComponentRenderer, 0),
}
var t1 *components.Textarea
var line *components.Slice
// -
line = components.NewSlice()
t1 = components.NewTextarea()
t1.SetName("textarea")
t1.SetLabel("textarea field")
t1.SetValue("text here")
line.AddComponent(t1)
t1 = components.NewTextarea()
t1.SetName("textarea")
t1.SetLabel("textarea field")
t1.SetValue("text here")
t1.SetPlaceHolderOnly(true)
line.AddComponent(t1)
data.Components = append(data.Components, line)
// -
line = components.NewSlice()
t1 = components.NewWysiwyg()
t1.SetName("textarea")
t1.SetLabel("textarea field")
t1.SetValue("text here")
line.AddComponent(t1)
t1 = components.NewWysiwyg()
t1.SetName("textarea")
t1.SetLabel("textarea field")
t1.SetValue("text here")
t1.SetPlaceHolderOnly(true)
line.AddComponent(t1)
data.Components = append(data.Components, line)
// -
renderComponents(w, data)
}