How to use GetID method of js Package

Best K6 code snippet using js.GetID

typeContent.go

Source:typeContent.go Github

copy

Full Screen

1package telerik2import (3 //"fmt"4 "fmt"5 "bytes"6 "sort"7 "reflect"8 )9type Content []interface{}10func(el Content) ToHtmlSupport() []byte {11 var buffer bytes.Buffer12 keys := make([]int, 0)13 for k := range el {14 keys = append(keys, k)15 }16 sort.Ints(keys)17 for _, k := range keys {18 switch outConverted := el[k].(type) {19 case KendoUiMultiSelect:20 buffer.Write( outConverted.ToHtml() )21 if !reflect.DeepEqual( outConverted.Dialog, KendoUiDialog{} ) {22 buffer.Write( outConverted.Dialog.ToHtml() )23 }24 }25 }26 return buffer.Bytes()27}28func(el Content) ToHtml() []byte {29 var buffer bytes.Buffer30 keys := make([]int, 0)31 for k := range el {32 keys = append(keys, k)33 }34 sort.Ints(keys)35 for _, k := range keys {36 switch outConverted := el[k].(type) {37 case string:38 buffer.WriteString( outConverted )39 case *AceEditor:40 buffer.Write( outConverted.ToHtml() )41 case *KendoUiWindow:42 buffer.Write( outConverted.ToHtml() )43 case *KendoUiGrid:44 buffer.Write( outConverted.ToHtml() )45 switch convertedToLoop := outConverted.Columns.(type) {46 case []KendoGridColumns:47 for _, column := range convertedToLoop {48 switch convertedColumn := column.Command.(type) {49 case []KendoGridColumnsCommand:50 for _, command := range convertedColumn {51 if command.Name == COLUMNS_COMMAND_VIEW {52 if command.ViewTemplate != nil {53 switch command.ViewTemplate.(type) {54 case *HtmlElementScript:55 buffer.Write( command.ViewTemplate.(*HtmlElementScript).ToHtml() )56 }57 }58 if command.ViewWindow != nil {59 buffer.Write( command.ViewWindow.ToHtml() )60 }61 }62 }63 }64 }65 }66 case *HtmlInputSubmit:67 buffer.Write( outConverted.ToHtml() )68 case *HtmlElementDiv:69 buffer.Write( outConverted.ToHtml() )70 case *HtmlInputHidden:71 buffer.Write( outConverted.ToHtml() )72 case *HtmlInputGeneric:73 buffer.Write( outConverted.ToHtml() )74 case *HtmlInputNumber:75 buffer.Write( outConverted.ToHtml() )76 case *HtmlElementSpan:77 buffer.Write( outConverted.ToHtml() )78 case *HtmlElementFormLabel:79 buffer.Write( outConverted.ToHtml() )80 case *HtmlInputText:81 buffer.Write( outConverted.ToHtml() )82 case *HtmlElementFormLegend:83 buffer.Write( outConverted.ToHtml() )84 case *HtmlElementFormFieldSet:85 buffer.Write( outConverted.ToHtml() )86 case *HtmlElementForm:87 buffer.Write( outConverted.ToHtml() )88 case *HtmlElementFormSelect:89 buffer.Write( outConverted.ToHtml() )90 case *HtmlElementFormTextArea:91 buffer.Write( outConverted.ToHtml() )92 case *HtmlElementFormMeter:93 buffer.Write( outConverted.ToHtml() )94 case *HtmlElementFormButton:95 buffer.Write( outConverted.ToHtml() )96 case *HtmlElementFormDataList:97 buffer.Write( outConverted.ToHtml() )98 case *KendoUiAutoComplete:99 buffer.Write( outConverted.ToHtml() )100 case *KendoUiMobileSwitch:101 buffer.Write( outConverted.ToHtml() )102 case *KendoUiNumericTextBox:103 buffer.Write( outConverted.ToHtml() )104 case *KendoUiComboBox:105 buffer.Write( outConverted.ToHtml() )106 case *KendoUiDialog:107 buffer.Write( outConverted.ToHtml() )108 case *HtmlElementScript:109 buffer.Write( outConverted.ToHtml() )110 case *KendoUiDropDownList:111 buffer.Write( outConverted.ToHtml() )112 case *KendoUiButton:113 buffer.Write( outConverted.ToHtml() )114 case *KendoUiMultiSelect:115 buffer.Write( outConverted.ToHtml() )116 if !reflect.DeepEqual( outConverted.Dialog, KendoUiDialog{} ) {117 buffer.Write( outConverted.Dialog.ToHtml() )118 }119 case *HtmlScriptType:120 buffer.WriteString( outConverted.String() )121 case *HtmlElementLi:122 buffer.Write( outConverted.ToHtml() )123 case *HtmlElementUl:124 buffer.Write( outConverted.ToHtml() )125 case KendoDataSource:126 //do noting127 case *HtmlInputCheckBox:128 buffer.Write( outConverted.ToHtml() )129 /*case HtmlElementFormOutput:130 buffer.Write( outConverted.ToHtml() )131 case HtmlElementFormProgress:132 buffer.Write( outConverted.ToHtml() )*/133 default:134 fmt.Printf("\n\n\nToHtml() - typeContent.go: error: type %T not found in typeContent\n\n\n", outConverted)135 }136 }137 return buffer.Bytes()138}139func(el *Content) ToJavaScript() []byte {140 var buffer bytes.Buffer141 //buffer.WriteString( "\n" )142 keys := make([]int, 0)143 for k := range *el {144 keys = append(keys, k)145 }146 sort.Ints(keys)147 for _, k := range keys {148 switch outConverted := (*el)[k].(type) {149 case string:150 buffer.WriteString( outConverted )151 //buffer.WriteString( "\n" )152 case *KendoUiGrid:153 switch convertedToLoop := outConverted.Columns.(type) {154 case []KendoGridColumns:155 for _, column := range convertedToLoop {156 switch convertedColumn := column.Command.(type) {157 case []KendoGridColumnsCommand:158 for _, command := range convertedColumn {159 if command.Name == COLUMNS_COMMAND_VIEW {160 if command.ViewTemplate != nil {161 switch command.ViewTemplate.(type) {162 case *HtmlElementScript:163 buffer.Write( command.ViewTemplate.(*HtmlElementScript).ToJavaScript() )164 }165 }166 if command.ViewWindow != nil {167 buffer.Write( command.ViewWindow.ToJavaScript() )168 }169 }170 }171 }172 }173 }174 buffer.Write( outConverted.ToJavaScript() )175 case *KendoUiWindow:176 buffer.Write( outConverted.ToJavaScript() )177 case *AceEditor:178 buffer.Write( outConverted.ToJavaScript() )179 case *KendoUiDialog:180 buffer.Write( outConverted.ToJavaScript() )181 //buffer.WriteString( "\n" )182 case *KendoUiDateTimePicker:183 buffer.Write( outConverted.ToJavaScript() )184 //buffer.WriteString( "\n" )185 case *KendoUiDatePicker:186 buffer.Write( outConverted.ToJavaScript() )187 //buffer.WriteString( "\n" )188 case *KendoUiDateInput:189 buffer.Write( outConverted.ToJavaScript() )190 //buffer.WriteString( "\n" )191 case *KendoUiContextMenu:192 buffer.Write( outConverted.ToJavaScript() )193 //buffer.WriteString( "\n" )194 case *KendoUiConfirm:195 buffer.Write( outConverted.ToJavaScript() )196 //buffer.WriteString( "\n" )197 case *KendoUiComboBox:198 buffer.Write( outConverted.ToJavaScript() )199 //buffer.WriteString( "\n" )200 case *KendoUiColorPicker:201 buffer.Write( outConverted.ToJavaScript() )202 //buffer.WriteString( "\n" )203 case *KendoUiColorPalette:204 buffer.Write( outConverted.ToJavaScript() )205 //buffer.WriteString( "\n" )206 case *KendoUiCalendar:207 buffer.Write( outConverted.ToJavaScript() )208 //buffer.WriteString( "\n" )209 case *KendoUiButton:210 buffer.Write( outConverted.ToJavaScript() )211 //buffer.WriteString( "\n" )212 case *KendoUiMultiSelect:213 buffer.Write( outConverted.ToJavaScript() )214 if !reflect.DeepEqual( outConverted.Dialog, KendoUiDialog{} ) {215 buffer.Write( outConverted.Dialog.ToJavaScript() )216 }217 //buffer.WriteString( "\n" )218 case *KendoUiAutoComplete:219 buffer.Write( outConverted.ToJavaScript() )220 case *KendoUiMobileSwitch:221 buffer.Write( outConverted.ToJavaScript() )222 //buffer.WriteString( "\n" )223 case *KendoUiDraggable:224 buffer.Write( outConverted.ToJavaScript() )225 //buffer.WriteString( "\n" )226 case *KendoUiDropDownList:227 buffer.Write( outConverted.ToJavaScript() )228 //buffer.WriteString( "\n" )229 case *KendoUiDropTarget:230 buffer.Write( outConverted.ToJavaScript() )231 //buffer.WriteString( "\n" )232 case *KendoUiDropTargetArea:233 buffer.Write( outConverted.ToJavaScript() )234 //buffer.WriteString( "\n" )235 case *HtmlElementDiv:236 buffer.Write( outConverted.ToJavaScript() )237 // //buffer.WriteString( "\n" )238 case *HtmlElementFormLabel:239 buffer.Write( outConverted.ToJavaScript() )240 //buffer.WriteString( "\n" )241 case *KendoUiNumericTextBox:242 buffer.Write( outConverted.ToJavaScript() )243 //buffer.WriteString( "\n" )244 case *HtmlElementFormSelect:245 buffer.Write( outConverted.ToJavaScript() )246 //buffer.WriteString( "\n" )247 case *HtmlElementScript:248 buffer.Write( outConverted.ToJavaScript() )249 //buffer.WriteString( "\n" )250 case *HtmlElementFormButton:251 buffer.Write( outConverted.ToJavaScript() )252 //buffer.WriteString( "\n" )253 case *HtmlElementSpan:254 buffer.Write( outConverted.ToJavaScript() )255 //buffer.WriteString( "\n" )256 case *KendoDataSource:257 buffer.Write( outConverted.ToJavaScript() )258 //buffer.WriteString( "\n" )259 //case KendoSchema:260 //buffer.Write( outConverted.ToJavaScript() )261 //buffer.WriteString( "\n" )262 case *HtmlElementFormTextArea:263 case *HtmlInputCheckBox:264 case *HtmlInputColor:265 case *HtmlInputDate:266 case *HtmlInputDateTimeLocal:267 case *HtmlInputEmail:268 buffer.Write( outConverted.ToJavaScript() )269 case *HtmlInputSubmit:270 buffer.Write( outConverted.ToJavaScript() )271 case *HtmlInputFile:272 case *HtmlInputGeneric:273 buffer.Write( outConverted.ToJavaScript() )274 case *HtmlInputHidden:275 case *HtmlInputImage:276 case *HtmlInputMonth:277 case *HtmlInputNumber:278 case *HtmlInputPassword:279 buffer.Write( outConverted.ToJavaScript() )280 case *HtmlInputRadio:281 case *HtmlInputRange:282 case *HtmlInputSearch:283 buffer.Write( outConverted.ToJavaScript() )284 case *HtmlInputTel:285 buffer.Write( outConverted.ToJavaScript() )286 case *HtmlInputText:287 buffer.Write( outConverted.ToJavaScript() )288 case *HtmlInputTime:289 case *HtmlInputUrl:290 buffer.Write( outConverted.ToJavaScript() )291 case *HtmlElementForm:292 buffer.Write( outConverted.ToJavaScript() )293 case *HtmlInputWeek:294 default:295 fmt.Printf("\n\n\nToJavaScript() - typeContent.go: error: type %T not found in typeContent\n\n\n", outConverted)296 }297 }298 var formElements = el.FilterFormElements()299 for _, v := range formElements {300 switch v.(type) {301 case *KendoUiWindow:302 if reflect.DeepEqual( *v.(*KendoUiWindow), KendoUiWindow{} ) {303 continue304 }305 buffer.Write( []byte( " " ) )306 buffer.Write( []byte( (*v.(*KendoUiWindow)).Html.Global.GetId() ) )307 buffer.Write( []byte( "Widget = $('#" ) )308 buffer.Write( []byte( (*v.(*KendoUiWindow)).Html.Global.GetId() ) )309 buffer.Write( []byte( "').data('kendoWindow');\n" ) )310 //$("#dialog").data("kendoWindow")311 case *KendoUiGrid:312 if reflect.DeepEqual( *v.(*KendoUiGrid), KendoUiGrid{} ) {313 continue314 }315 buffer.Write( []byte( " " ) )316 buffer.Write( []byte( (*v.(*KendoUiGrid)).Html.Global.GetId() ) )317 buffer.Write( []byte( "Widget = $('#" ) )318 buffer.Write( []byte( (*v.(*KendoUiGrid)).Html.Global.GetId() ) )319 buffer.Write( []byte( "').data('kendoGrid');\n" ) )320 //$("#dialog").data("kendoWindow")321 case **KendoUiMultiSelect:322 if !reflect.DeepEqual( (*(*v.(**KendoUiMultiSelect))).DataSource, KendoDataSource{} ) {323 switch (*(*v.(**KendoUiMultiSelect))).DataSource.(type) {324 case KendoDataSource:325 // Widget326 buffer.Write( []byte( " " ) )327 buffer.Write( []byte( (*(*v.(**KendoUiMultiSelect))).Html.GetId() ) )328 buffer.Write( []byte( "Widget = $('#" ) )329 buffer.Write( []byte( (*(*v.(**KendoUiMultiSelect))).Html.GetId() ) )330 buffer.Write( []byte( "').getKendoMultiSelect();\n" ) )331 // DataSource332 buffer.Write( []byte( " " ) )333 buffer.Write( []byte( (*(*v.(**KendoUiMultiSelect))).Html.GetId() ) )334 buffer.Write( []byte( "DataSource = " ) )335 buffer.Write( []byte( (*(*v.(**KendoUiMultiSelect))).Html.GetId() ) )336 buffer.Write( []byte( "Widget.dataSource;\n" ) )337 }338 }339 default: continue340 }341 }342 return buffer.Bytes()343}344func(el *Content)FilterFormElements() []interface{} {345 var contentProcessedList = make( []interface{}, 0 )346 var contentUnprocessedList = make( []interface{}, 0 )347 var contentFoundList = make( []interface{}, 0 )348 el.processContent( &contentProcessedList, &contentUnprocessedList, &contentFoundList, *el)349 for {350 if len( contentUnprocessedList ) == 0 {351 break352 }353 popElement := contentUnprocessedList[0]354 contentUnprocessedList = contentUnprocessedList[1:]355 el.processContent(&contentProcessedList, &contentUnprocessedList, &contentFoundList, popElement.(Content))356 }357 /*for _, v := range contentFoundList{358 fmt.Printf( "%T\n", v )359 }*/360 return contentFoundList361}362func(el *Content)processContent( contentProcessedList, contentUnprocessedList, contentFoundList *[]interface{}, content Content ) {363 *contentProcessedList =append( *contentProcessedList, content )364 for _, contentElement := range content {365 el.addToUnprocessedList(contentUnprocessedList, contentFoundList, contentElement)366 }367}368func(el *Content)addToUnprocessedList( contentUnprocessedList, contentFoundList *[]interface{}, content interface{} ) {369 switch converted := content.(type) {370 case string:371 case *Content:372 case *KendoUiGrid:373 *contentFoundList =append( *contentFoundList, converted )374 switch convertedToLoop := converted.Columns.(type) {375 case []KendoGridColumns:376 for _, column := range convertedToLoop {377 switch convertedColumn := column.Command.(type) {378 case []KendoGridColumnsCommand:379 for _, command := range convertedColumn {380 if command.Name == COLUMNS_COMMAND_VIEW {381 if command.ViewTemplate != nil {382 *contentFoundList =append( *contentFoundList, command.ViewTemplate )383 }384 if command.ViewWindow != nil {385 *contentFoundList =append( *contentFoundList, command.ViewWindow )386 }387 }388 }389 }390 }391 }392 case *KendoUiWindow:393 *contentFoundList =append( *contentFoundList, converted )394 if converted.Content == nil {395 return396 }397 *contentUnprocessedList =append( *contentUnprocessedList, converted.Content )398 case *HtmlElementSpan:399 if converted.Content == nil {400 return401 }402 *contentUnprocessedList =append( *contentUnprocessedList, converted.Content )403 case *HtmlElementDiv:404 if converted.Content == nil {405 return406 }407 *contentUnprocessedList =append( *contentUnprocessedList, converted.Content )408 case *HtmlElementForm:409 if converted.Content == nil {410 return411 }412 *contentUnprocessedList =append( *contentUnprocessedList, converted.Content )413 // Elementos de formulário que necessitam de javascript - início414 case *HtmlElementScript:415 *contentFoundList =append( *contentFoundList, converted )416 case *KendoUiNumericTextBox:417 *contentFoundList =append( *contentFoundList, converted )418 case **KendoUiComboBox:419 *contentFoundList =append( *contentFoundList, &converted )420 case *KendoUiComboBox:421 *contentFoundList =append( *contentFoundList, &converted )422 case *KendoUiAutoComplete:423 *contentFoundList =append( *contentFoundList, &converted )424 case *KendoUiButton:425 *contentFoundList =append( *contentFoundList, &converted )426 case *KendoUiCalendar:427 *contentFoundList =append( *contentFoundList, &converted )428 case *KendoUiColorPalette:429 *contentFoundList =append( *contentFoundList, &converted )430 case *KendoUiColorPicker:431 *contentFoundList =append( *contentFoundList, &converted )432 case *KendoUiDateInput:433 *contentFoundList =append( *contentFoundList, &converted )434 case *KendoUiDatePicker:435 *contentFoundList =append( *contentFoundList, converted )436 case *KendoUiDateTimePicker:437 *contentFoundList =append( *contentFoundList, converted )438 case KendoUiDateTimePicker:439 *contentFoundList =append( *contentFoundList, &converted )440 case *KendoUiDropDownList:441 *contentFoundList =append( *contentFoundList, &converted )442 case *KendoUiMultiSelect:443 *contentFoundList =append( *contentFoundList, &converted )444 if reflect.DeepEqual( converted.Dialog, KendoUiDialog{} ) == false {445 switch convertedInternal := converted.Dialog.Content.(type) {446 case Content:447 for _, subContent := range convertedInternal.FilterFormElements() {448 el.addToUnprocessedList( contentUnprocessedList, contentFoundList, subContent )449 //*contentFoundList =append( *contentFoundList, &subContent )450 }451 }452 }453 case *KendoUiMobileSwitch:454 *contentFoundList =append( *contentFoundList, converted )455 case *HtmlElementFormSelect:456 *contentFoundList =append( *contentFoundList, &converted )457 case *HtmlElementFormTextArea:458 *contentFoundList =append( *contentFoundList, &converted )459 case *HtmlInputCheckBox:460 *contentFoundList =append( *contentFoundList, &converted )461 case *HtmlInputColor:462 *contentFoundList =append( *contentFoundList, &converted )463 case *HtmlInputDate:464 *contentFoundList =append( *contentFoundList, &converted )465 case *HtmlInputDateTimeLocal:466 *contentFoundList =append( *contentFoundList, &converted )467 case *HtmlInputEmail:468 *contentFoundList =append( *contentFoundList, &converted )469 case *HtmlInputFile:470 *contentFoundList =append( *contentFoundList, &converted )471 case *HtmlInputGeneric:472 *contentFoundList =append( *contentFoundList, &converted )473 case *HtmlInputHidden:474 *contentFoundList =append( *contentFoundList, &converted )475 case **HtmlInputHidden: //fixme: isto está certo?476 *contentFoundList =append( *contentFoundList, &converted )477 case *HtmlInputImage:478 *contentFoundList =append( *contentFoundList, &converted )479 case *HtmlInputMonth:480 *contentFoundList =append( *contentFoundList, &converted )481 case *HtmlInputNumber:482 *contentFoundList =append( *contentFoundList, converted )483 case *HtmlInputPassword:484 *contentFoundList =append( *contentFoundList, &converted )485 case *HtmlInputRadio:486 *contentFoundList =append( *contentFoundList, &converted )487 case *HtmlInputRange:488 *contentFoundList =append( *contentFoundList, &converted )489 case *HtmlInputSearch:490 *contentFoundList =append( *contentFoundList, &converted )491 case *HtmlInputTel:492 *contentFoundList =append( *contentFoundList, &converted )493 case *HtmlInputText:494 *contentFoundList =append( *contentFoundList, &converted )495 case *HtmlInputTime:496 *contentFoundList =append( *contentFoundList, &converted )497 case *HtmlInputUrl:498 *contentFoundList =append( *contentFoundList, &converted )499 case *HtmlElementFormButton:500 *contentFoundList =append( *contentFoundList, &converted )501 case *HtmlInputWeek:502 *contentFoundList =append( *contentFoundList, &converted )503 case *HtmlInputSubmit:504 *contentFoundList =append( *contentFoundList, &converted )505 case *KendoDataSource:506 *contentFoundList =append( *contentFoundList, &converted )507 case *AceEditor:508 *contentFoundList =append( *contentFoundList, &converted )509 // Elementos de formulário que necessitam de javascript - fim510 case *HtmlElementFormLabel:511 default:512 fmt.Printf( "HtmlElementForm.addToUnprocessedList().type: %T\n", converted )513 }514}515func (el *Content)GetNamesAndIds() []map[string][]byte {516 var pass = false517 var name, id []byte518 var ret = make( []map[string][]byte, 0 )519 var formElements = el.FilterFormElements()520 for _, v := range formElements {521 pass = false522 switch converted := v.(type) {523 case **HtmlInputText:524 pass = true525 name = []byte( (*(*v.(**HtmlInputText))).Name )526 id = (*(*v.(**HtmlInputText))).GetId()527 case **HtmlInputHidden:528 pass = true529 name = []byte( (*(*v.(**HtmlInputHidden))).Name )530 id = (*(*v.(**HtmlInputHidden))).GetId()531 case **KendoUiComboBox:532 pass = true533 name = []byte( (*(*v.(**KendoUiComboBox))).Html.Name )534 id = (*(*v.(**KendoUiComboBox))).GetId()535 case **KendoUiAutoComplete:536 pass = true537 name = []byte( (*(*v.(**KendoUiAutoComplete))).Html.Name )538 id = (*(*v.(**KendoUiAutoComplete))).GetId()539 case **KendoUiButton:540 //pass = true541 //name = []byte( (*(*v.(**KendoUiButton))).Html.Name )542 //id = (*(*v.(**KendoUiButton))).GetId()543 case **KendoUiCalendar:544 pass = true545 name = []byte( (*(*v.(**KendoUiCalendar))).Html.Name )546 id = (*(*v.(**KendoUiCalendar))).GetId()547 case **KendoUiColorPalette:548 pass = true549 name = []byte( (*(*v.(**KendoUiColorPalette))).Html.Name )550 id = (*(*v.(**KendoUiColorPalette))).GetId()551 case **KendoUiColorPicker:552 pass = true553 name = []byte( (*(*v.(**KendoUiColorPicker))).Html.Name )554 id = (*(*v.(**KendoUiColorPicker))).GetId()555 case **KendoUiNumericTextBox:556 pass = true557 name = []byte( (*(*v.(**KendoUiNumericTextBox))).Html.Name )558 id = (*(*v.(**KendoUiNumericTextBox))).GetId()559 case **KendoUiDateInput:560 pass = true561 name = []byte( (*(*v.(**KendoUiDateInput))).Html.Name )562 id = (*(*v.(**KendoUiDateInput))).GetId()563 case **KendoUiDatePicker:564 pass = true565 name = []byte( (*(*v.(**KendoUiDatePicker))).Html.Name )566 id = (*(*v.(**KendoUiDatePicker))).GetId()567 case **KendoUiDateTimePicker:568 pass = true569 name = []byte( (*(*v.(**KendoUiDateTimePicker))).Html.Name )570 id = (*(*v.(**KendoUiDateTimePicker))).GetId()571 case **KendoUiDropDownList:572 pass = true573 name = []byte( (*(*v.(**KendoUiDropDownList))).Html.Name )574 id = (*(*v.(**KendoUiDropDownList))).GetId()575 case **KendoUiMultiSelect:576 pass = true577 name = []byte( (*(*v.(**KendoUiMultiSelect))).Html.Name )578 id = (*(*v.(**KendoUiMultiSelect))).GetId()579 case **HtmlElementFormSelect:580 pass = true581 name = []byte( (*(*v.(**HtmlElementFormSelect))).Name )582 id = (*(*v.(**HtmlElementFormSelect))).GetId()583 case **HtmlElementFormTextArea:584 pass = true585 name = []byte( (*(*v.(**HtmlElementFormTextArea))).Name )586 id = (*(*v.(**HtmlElementFormTextArea))).GetId()587 case **HtmlInputCheckBox:588 pass = true589 name = []byte( (*(*v.(**HtmlInputCheckBox))).Name )590 id = (*(*v.(**HtmlInputCheckBox))).GetId()591 case **HtmlInputColor:592 pass = true593 name = []byte( (*(*v.(**HtmlInputColor))).Name )594 id = (*(*v.(**HtmlInputColor))).GetId()595 case **HtmlInputDate:596 pass = true597 name = []byte( (*(*v.(**HtmlInputDate))).Name )598 id = (*(*v.(**HtmlInputDate))).GetId()599 case **HtmlInputDateTimeLocal:600 pass = true601 name = []byte( (*(*v.(**HtmlInputDateTimeLocal))).Name )602 id = (*(*v.(**HtmlInputDateTimeLocal))).GetId()603 case **HtmlInputEmail:604 pass = true605 name = []byte( (*(*v.(**HtmlInputEmail))).Name )606 id = (*(*v.(**HtmlInputEmail))).GetId()607 case **HtmlInputFile:608 pass = true609 name = []byte( (*(*v.(**HtmlInputFile))).Name )610 id = (*(*v.(**HtmlInputFile))).GetId()611 case **HtmlInputGeneric:612 pass = true613 name = []byte( (*(*v.(**HtmlInputGeneric))).Name )614 id = (*(*v.(**HtmlInputGeneric))).GetId()615 case **HtmlInputImage:616 pass = true617 name = []byte( (*(*v.(**HtmlInputImage))).Name )618 id = (*(*v.(**HtmlInputImage))).GetId()619 case **HtmlInputMonth:620 pass = true621 name = []byte( (*(*v.(**HtmlInputMonth))).Name )622 id = (*(*v.(**HtmlInputMonth))).GetId()623 case **HtmlInputNumber:624 pass = true625 name = []byte( (*(*v.(**HtmlInputNumber))).Name )626 id = (*(*v.(**HtmlInputNumber))).GetId()627 case **HtmlInputPassword:628 pass = true629 name = []byte( (*(*v.(**HtmlInputPassword))).Name )630 id = (*(*v.(**HtmlInputPassword))).GetId()631 case **HtmlInputRadio:632 pass = true633 name = []byte( (*(*v.(**HtmlInputRadio))).Name )634 id = (*(*v.(**HtmlInputRadio))).GetId()635 case **HtmlInputRange:636 pass = true637 name = []byte( (*(*v.(**HtmlInputRange))).Name )638 id = (*(*v.(**HtmlInputRange))).GetId()639 case **HtmlInputSearch:640 pass = true641 name = []byte( (*(*v.(**HtmlInputSearch))).Name )642 id = (*(*v.(**HtmlInputSearch))).GetId()643 case **HtmlInputTel:644 pass = true645 name = []byte( (*(*v.(**HtmlInputTel))).Name )646 id = (*(*v.(**HtmlInputTel))).GetId()647 case **HtmlInputTime:648 pass = true649 name = []byte( (*(*v.(**HtmlInputTime))).Name )650 id = (*(*v.(**HtmlInputTime))).GetId()651 case **HtmlInputUrl:652 pass = true653 name = []byte( (*(*v.(**HtmlInputUrl))).Name )654 id = (*(*v.(**HtmlInputUrl))).GetId()655 case **HtmlInputWeek:656 pass = true657 name = []byte( (*(*v.(**HtmlInputWeek))).Name )658 id = (*(*v.(**HtmlInputWeek))).GetId()659 case **HtmlInputSubmit:660 pass = true661 name = []byte( (*(*v.(**HtmlInputSubmit))).Name )662 id = (*(*v.(**HtmlInputSubmit))).GetId()663 case **KendoUiMobileSwitch:664 pass = true665 name = []byte( (*(*v.(**KendoUiMobileSwitch))).Html.Name )666 id = (*(*v.(**KendoUiMobileSwitch))).GetId()667 case *HtmlInputText:668 pass = true669 name = []byte( converted.Name )670 id = converted.GetId()671 case *HtmlInputHidden:672 pass = true673 name = []byte( converted.Name )674 id = converted.GetId()675 case *KendoUiComboBox:676 pass = true677 name = []byte( converted.Html.Name )678 id = converted.GetId()679 case *KendoUiAutoComplete:680 pass = true681 name = []byte( converted.Html.Name )682 id = converted.GetId()683 case *KendoUiButton:684 //pass = true685 //name = []byte( converted.Html.Name )686 //id = converted.GetId()687 case *KendoUiCalendar:688 pass = true689 name = []byte( converted.Html.Name )690 id = converted.GetId()691 case *KendoUiColorPalette:692 pass = true693 name = []byte( converted.Html.Name )694 id = converted.GetId()695 case *KendoUiColorPicker:696 pass = true697 name = []byte( converted.Html.Name )698 id = converted.GetId()699 case *KendoUiNumericTextBox:700 pass = true701 name = []byte( converted.Html.Name )702 id = converted.GetId()703 case *KendoUiDateInput:704 pass = true705 name = []byte( converted.Html.Name )706 id = converted.GetId()707 case *KendoUiDatePicker:708 pass = true709 name = []byte( converted.Html.Name )710 id = converted.GetId()711 case *KendoUiDateTimePicker:712 pass = true713 name = []byte( converted.Html.Name )714 id = converted.GetId()715 case *KendoUiDropDownList:716 pass = true717 name = []byte( converted.Html.Name )718 id = converted.GetId()719 case *KendoUiMultiSelect:720 pass = true721 name = []byte( converted.Html.Name )722 id = converted.GetId()723 case *HtmlElementFormSelect:724 pass = true725 name = []byte( converted.Name )726 id = converted.GetId()727 case *HtmlElementFormTextArea:728 pass = true729 name = []byte( converted.Name )730 id = converted.GetId()731 case *HtmlInputCheckBox:732 pass = true733 name = []byte( converted.Name )734 id = converted.GetId()735 case *HtmlInputColor:736 pass = true737 name = []byte( converted.Name )738 id = converted.GetId()739 case *HtmlInputDate:740 pass = true741 name = []byte( converted.Name )742 id = converted.GetId()743 case *HtmlInputDateTimeLocal:744 pass = true745 name = []byte( converted.Name )746 id = converted.GetId()747 case *HtmlInputEmail:748 pass = true749 name = []byte( converted.Name )750 id = converted.GetId()751 case *HtmlInputFile:752 pass = true753 name = []byte( converted.Name )754 id = converted.GetId()755 case *HtmlInputGeneric:756 pass = true757 name = []byte( converted.Name )758 id = converted.GetId()759 case *HtmlInputImage:760 pass = true761 name = []byte( converted.Name )762 id = converted.GetId()763 case *HtmlInputMonth:764 pass = true765 name = []byte( converted.Name )766 id = converted.GetId()767 case *HtmlInputNumber:768 pass = true769 name = []byte( converted.Name )770 id = converted.GetId()771 case *HtmlInputPassword:772 pass = true773 name = []byte( converted.Name )774 id = converted.GetId()775 case *HtmlInputRadio:776 pass = true777 name = []byte( converted.Name )778 id = converted.GetId()779 case *HtmlInputRange:780 pass = true781 name = []byte( converted.Name )782 id = converted.GetId()783 case *HtmlInputSearch:784 pass = true785 name = []byte( converted.Name )786 id = converted.GetId()787 case *HtmlInputTel:788 pass = true789 name = []byte( converted.Name )790 id = converted.GetId()791 case *HtmlInputTime:792 pass = true793 name = []byte( converted.Name )794 id = converted.GetId()795 case *HtmlInputUrl:796 pass = true797 name = []byte( converted.Name )798 id = converted.GetId()799 case *HtmlInputWeek:800 pass = true801 name = []byte( converted.Name )802 id = converted.GetId()803 case *HtmlInputSubmit:804 pass = true805 name = []byte( converted.Name )806 id = converted.GetId()807 case *KendoUiMobileSwitch:808 pass = true809 name = []byte( converted.Html.Name )810 id = converted.GetId()811 case *Content:812 case *KendoDataSource:813 default:814 fmt.Printf("\n\n\nGetNamesAndIds.id.type.%T.not.found.\n\n\n", converted)815 }816 if pass == true {817 var element = make( map[string][]byte )818 element["name"] = name819 element["id"] = id820 ret = append( ret, element )821 }822 }823 return ret824}825func (el *Content)MakeJsObject() []byte {826 var pass = false827 var buffer bytes.Buffer828 var key, jsCode []byte829 var formElements = el.FilterFormElements()830 // fixme: mfalta um getName() ou algo parecido831 // fixme: KendoUiCalendar e KendoUiColorPalette devem ter name como obrigatórios832 for _, v := range formElements {833 switch v.(type) {834 case *KendoUiGrid:835 if reflect.DeepEqual( *v.(*KendoUiGrid), KendoUiGrid{} ) {836 continue837 }838 buffer.Write( []byte( " var " ) )839 buffer.Write( []byte( (*v.(*KendoUiGrid)).Html.Global.GetId() ) )840 buffer.Write( []byte( "Widget;\n" ) )841 case *KendoUiWindow:842 if reflect.DeepEqual( *v.(*KendoUiWindow), KendoUiWindow{} ) {843 continue844 }845 buffer.Write( []byte( " var " ) )846 buffer.Write( []byte( (*v.(*KendoUiWindow)).Html.Global.GetId() ) )847 buffer.Write( []byte( "Widget;\n" ) )848 case **KendoUiMultiSelect:849 if !reflect.DeepEqual( (*(*v.(**KendoUiMultiSelect))).DataSource, KendoDataSource{} ) {850 switch (*(*v.(**KendoUiMultiSelect))).DataSource.(type) {851 case KendoDataSource:852 // Widget853 buffer.Write( []byte( " var " ) )854 buffer.Write( []byte( (*(*v.(**KendoUiMultiSelect))).Html.GetId() ) )855 buffer.Write( []byte( "Widget;\n" ) )856 // DataSource857 buffer.Write( []byte( " var " ) )858 buffer.Write( []byte( (*(*v.(**KendoUiMultiSelect))).Html.GetId() ) )859 buffer.Write( []byte( "DataSource;\n" ) )860 }861 }862 default:863 continue864 }865 }866 for _, v := range formElements {867 switch converted := v.(type) {868 case **KendoUiMultiSelect:869 var pass = false870 var contentToFind []map[string][]byte871 if !reflect.DeepEqual( (*(*v.(**KendoUiMultiSelect))).Dialog, KendoUiDialog{} ) {872 var mainElementDataSourceDataKeyId = []byte( (*(*v.(**KendoUiMultiSelect))).DataValueField )873 for _, action := range (*(*v.(**KendoUiMultiSelect))).Dialog.Actions {874 if action.ButtonType == BUTTON_TYPE_ADD_AND_CLOSE || action.ButtonType == BUTTON_TYPE_ADD {875 buffer.Write([]byte( " function " ))876 buffer.Write([]byte( (*(*v.(**KendoUiMultiSelect))).GetId() ))877 if action.ButtonType == BUTTON_TYPE_ADD_AND_CLOSE {878 buffer.Write([]byte( "AddAndCloseButton() {\n" ))879 } else if action.ButtonType == BUTTON_TYPE_ADD {880 buffer.Write([]byte( "AddButton() {\n" ))881 }882 var elementId []byte883 var dataSourceName []byte884 switch convertedContent := (*(*v.(**KendoUiMultiSelect))).Dialog.Content.(type) {885 case Content:886 for _, element := range convertedContent {887 pass = false888 switch convertedElement := element.(type) {889 case *HtmlElementForm:890 pass = true891 elementId = []byte( convertedElement.Global.Id )892 dataSourceName = (*converted).Html.GetId()893 contentToFind = convertedElement.Content.GetNamesAndIds()894 case *HtmlElementDiv:895 elementId = []byte( convertedElement.Global.Id )896 dataSourceName = (*converted).Html.GetId()897 contentToFind = convertedElement.Content.GetNamesAndIds()898 pass = true899 case *HtmlElementSpan:900 elementId = []byte( convertedElement.Global.Id )901 dataSourceName = (*converted).Html.GetId()902 contentToFind = convertedElement.Content.GetNamesAndIds()903 pass = true904 }905 if pass == true {906 buffer.Write([]byte( " if( $('#" ))907 buffer.Write(elementId)908 buffer.Write([]byte( "').kendoValidator().data('kendoValidator').validate() == false ){\n" ))909 buffer.Write([]byte( " " ))910 buffer.Write([]byte( "return false;\n" ))911 buffer.Write([]byte( " " ))912 buffer.Write([]byte( "}\n" ))913 buffer.Write([]byte( " " ))914 buffer.Write( dataSourceName )915 buffer.Write([]byte( "DataSource.add({\n" ))916 for _, element := range contentToFind {917 buffer.Write([]byte( " '" ))918 buffer.Write( element["name"] )919 buffer.Write([]byte( "': getValueById('id:" ))920 buffer.Write( element["id"] )921 buffer.Write([]byte( "'),\n" ))922 }923 buffer.Write([]byte( " });\n" ))924 buffer.Write([]byte( " " ))925 buffer.Write( dataSourceName )926 buffer.Write([]byte( "DataSource.one('requestEnd', function (args) {\n" ))927 buffer.Write([]byte( " " ))928 buffer.Write([]byte( "if (args.type !== 'create') {\n" ))929 buffer.Write([]byte( " " ))930 buffer.Write([]byte( "return;\n" ))931 buffer.Write([]byte( " " ))932 buffer.Write([]byte( "}\n" ))933 buffer.Write([]byte( " " ))934 buffer.Write([]byte( "var newValue = args.response.Objects[ 0 ]." ))935 buffer.Write( mainElementDataSourceDataKeyId )936 buffer.Write([]byte( "\n" ))937 buffer.Write([]byte( " " ))938 buffer.Write( dataSourceName )939 buffer.Write([]byte( "DataSource.one('sync', function () {\n" ))940 buffer.Write([]byte( " " ))941 buffer.Write( dataSourceName )942 buffer.Write([]byte( "Widget.value(" ))943 buffer.Write( dataSourceName )944 buffer.Write([]byte( "Widget.value().concat([newValue]));\n" ))945 buffer.Write([]byte( " " ))946 buffer.Write([]byte( "});\n" ))947 buffer.Write([]byte( " " ))948 buffer.Write([]byte( "});\n" ))949 buffer.Write([]byte( " " ))950 buffer.Write( dataSourceName )951 buffer.Write([]byte( "DataSource.sync();\n" ))952 if action.ButtonType == BUTTON_TYPE_ADD_AND_CLOSE {953 buffer.Write([]byte( " " ))954 buffer.Write(dataSourceName)955 buffer.Write([]byte( "Widget.close();\n" ))956 } else if action.ButtonType == BUTTON_TYPE_ADD {957 buffer.Write([]byte( " " ))958 buffer.Write([]byte( "return false;\n" ))959 }960 }961 }962 }963 buffer.Write([]byte( " }\n" ))964 }965 }966 }967 default: continue968 }969 }970 // fixme: isto está constante971 buffer.Write( []byte( " function addNewItemToKendoDataSource( id ){\n" ) )972 buffer.Write( []byte( " switch( id ){\n" ) )973 for _, v := range formElements {974 switch converted := v.(type) {975 case *KendoUiMultiSelect:976 if reflect.DeepEqual( converted.Dialog, KendoUiDialog{} ) {977 continue978 }979 key = []byte( converted.Html.GetId() )980 jsCode = []byte( `$('#` + string( converted.Dialog.GetId() ) + `').data('kendoDialog').open()` )981 buffer.Write( []byte( " case 'id:" ) )982 buffer.Write( key )983 buffer.Write( []byte( "': " ) )984 buffer.Write( jsCode )985 buffer.Write( []byte( ";\n" ) )986 switch convertedFromInterface := converted.Dialog.Content.(type) {987 case Content:988 buffer.Write( []byte( " " ) )989 buffer.Write( convertedFromInterface.ToJavaScript() )990 buffer.Write( []byte( " break;\n" ) )991 }992 //buffer.Write( []byte( ";\n" ) )993 case **KendoUiMultiSelect:994 if reflect.DeepEqual( (*(*v.(**KendoUiMultiSelect))).Dialog, KendoUiDialog{} ) {995 continue996 }997 key = []byte( (*(*v.(**KendoUiMultiSelect))).Html.GetId() )998 jsCode = []byte( `$('#` + string( (*(*v.(**KendoUiMultiSelect))).Dialog.GetId() ) + `').data('kendoDialog').open()` )999 buffer.Write( []byte( " case 'id:" ) )1000 buffer.Write( key )1001 buffer.Write( []byte( "': " ) )1002 buffer.Write( jsCode )1003 buffer.Write( []byte( ";\n" ) )1004 switch convertedFromInterface := (*(*v.(**KendoUiMultiSelect))).Dialog.Content.(type) {1005 case Content:1006 buffer.Write( []byte( " " ) )1007 buffer.Write( convertedFromInterface.ToJavaScript() )1008 buffer.Write( []byte( " break;\n" ) )1009 }1010 //buffer.Write( []byte( ";\n" ) )1011 default: continue1012 }1013 }1014 buffer.Write( []byte( " }\n" ) )1015 buffer.Write( []byte( " }\n" ) )1016 buffer.Write( []byte( " function getValueById( id ){\n" ) )1017 buffer.Write( []byte( " switch( id ){\n" ) )1018 for _, v := range formElements {1019 pass = false1020 switch converted := v.(type) {1021 case ***AceEditor:1022 pass = true1023 key = []byte( (*(*(*v.(***AceEditor)))).Html.Name )1024 jsCode = []byte( `ace.edit("` + string( (*(*(*v.(***AceEditor)))).GetId() ) + `").getValue()` )1025 case ***HtmlElementScript:1026 pass = true1027 key = []byte( (*(*(*v.(***HtmlElementScript)))).GetId() )1028 jsCode = []byte( `kendo.template($("#` + string( (*(*(*v.(***HtmlElementScript)))).GetId() ) + `").html())` )1029 case ***KendoUiComboBox:1030 pass = true1031 key = []byte( (*(*(*v.(***KendoUiComboBox)))).Html.Name )1032 jsCode = []byte( `$('#` + string( (*(*(*v.(***KendoUiComboBox)))).GetId() ) + `').data('kendoComboBox').value()` )1033 case ***HtmlInputText:1034 pass = true1035 key = []byte( (*(*(*v.(***HtmlInputText)))).Name )1036 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputText)))).GetId() ) + `').val()` )1037 case ***HtmlInputHidden:1038 pass = true1039 key = []byte( (*(*(*v.(***HtmlInputHidden)))).Name )1040 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputHidden)))).GetId() ) + `').val()` )1041 case ***KendoUiDropDownList:1042 pass = true1043 key = []byte( (*(*(*v.(***KendoUiDropDownList)))).Html.Name )1044 jsCode = []byte( `$('#` + string( (*(*(*v.(***KendoUiDropDownList)))).GetId() ) + `').data('kendoDropDownList').value()` )1045 case ***KendoUiMultiSelect: // fixme: colocar o conteúdo da janela aqui também1046 pass = true1047 key = []byte( (*(*(*v.(***KendoUiMultiSelect)))).Html.Name )1048 jsCode = []byte( `$('#` + string( (*(*(*v.(***KendoUiMultiSelect)))).GetId() ) + `').data('kendoMultiSelect').value()` )1049 case ***KendoUiAutoComplete:1050 pass = true1051 key = []byte( (*(*(*v.(***KendoUiAutoComplete)))).Html.Name )1052 jsCode = []byte( `$('#` + string( (*(*(*v.(***KendoUiAutoComplete)))).GetId() ) + `').data('kendoAutoComplete').value()` )1053 case ***KendoUiButton:1054 //pass = true1055 //key = []byte( (*(*(*v.(***KendoUiButton)))).Html.Name )1056 //jsCode = []byte( `$('#` + string( (*(*(*v.(***KendoUiButton)))).GetId() ) + `').data('kendoButton').value()` )1057 case ***KendoUiCalendar:1058 pass = true1059 key = []byte( (*(*(*v.(***KendoUiCalendar)))).Html.Name )1060 jsCode = []byte( `$('#` + string( (*(*(*v.(***KendoUiCalendar)))).GetId() ) + `').data('kendoCalendar').value()` )1061 case ***KendoUiColorPalette:1062 pass = true1063 key = []byte( (*(*(*v.(***KendoUiColorPalette)))).Html.Name )1064 jsCode = []byte( `$('#` + string( (*(*(*v.(***KendoUiColorPalette)))).GetId() ) + `').data('kendoColorPalette').value()` )1065 case ***KendoUiColorPicker:1066 pass = true1067 key = []byte( (*(*(*v.(***KendoUiColorPicker)))).Html.Name )1068 jsCode = []byte( `$('#` + string( (*(*(*v.(***KendoUiColorPicker)))).GetId() ) + `').data('kendoColorPicker').value()` )1069 case ***KendoUiNumericTextBox:1070 pass = true1071 key = []byte( (*(*(*v.(***KendoUiNumericTextBox)))).Html.Name )1072 jsCode = []byte( `$('#` + string( (*(*(*v.(***KendoUiNumericTextBox)))).GetId() ) + `').data('kendoNumericTextBox').value()` )1073 case ***KendoUiDateInput:1074 pass = true1075 key = []byte( (*(*(*v.(***KendoUiDateInput)))).Html.Name )1076 jsCode = []byte( `$('#` + string( (*(*(*v.(***KendoUiDateInput)))).GetId() ) + `').data('kendoDateInput').value()` )1077 case ***KendoUiDatePicker:1078 pass = true1079 key = []byte( (*(*(*v.(***KendoUiDatePicker)))).Html.Name )1080 jsCode = []byte( `$('#` + string( (*(*(*v.(***KendoUiDatePicker)))).GetId() ) + `').data('kendoDatePicker').value()` )1081 case ***KendoUiDateTimePicker:1082 pass = true1083 key = []byte( (*(*(*v.(***KendoUiDateTimePicker)))).Html.Name )1084 jsCode = []byte( `$('#` + string( (*(*(*v.(***KendoUiDateTimePicker)))).GetId() ) + `').data('kendoDateTimePicker').value()` )1085 case ***HtmlElementFormSelect:1086 pass = true1087 key = []byte( (*(*(*v.(***HtmlElementFormSelect)))).Name )1088 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlElementFormSelect)))).GetId() ) + `').val()` )1089 case ***HtmlElementFormTextArea:1090 pass = true1091 key = []byte( (*(*(*v.(***HtmlElementFormTextArea)))).Name )1092 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlElementFormTextArea)))).GetId() ) + `').val()` )1093 case ***HtmlInputCheckBox:1094 pass = true1095 key = []byte( (*(*(*v.(***HtmlInputCheckBox)))).Name )1096 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputCheckBox)))).GetId() ) + `').val()` )1097 case ***HtmlInputColor:1098 pass = true1099 key = []byte( (*(*(*v.(***HtmlInputColor)))).Name )1100 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputColor)))).GetId() ) + `').val()` )1101 case ***HtmlInputDate:1102 pass = true1103 key = []byte( (*(*(*v.(***HtmlInputDate)))).Name )1104 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputDate)))).GetId() ) + `').val()` )1105 case ***HtmlInputDateTimeLocal:1106 pass = true1107 key = []byte( (*(*(*v.(***HtmlInputDateTimeLocal)))).Name )1108 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputDateTimeLocal)))).GetId() ) + `').val()` )1109 case ***HtmlInputEmail:1110 pass = true1111 key = []byte( (*(*(*v.(***HtmlInputEmail)))).Name )1112 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputEmail)))).GetId() ) + `').val()` )1113 case ***HtmlInputFile:1114 pass = true1115 key = []byte( (*(*(*v.(***HtmlInputFile)))).Name )1116 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputFile)))).GetId() ) + `').val()` )1117 case ***HtmlInputGeneric:1118 pass = true1119 key = []byte( (*(*(*v.(***HtmlInputGeneric)))).Name )1120 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputGeneric)))).GetId() ) + `').val()` )1121 case ***HtmlInputImage:1122 pass = true1123 key = []byte( (*(*(*v.(***HtmlInputImage)))).Name )1124 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputImage)))).GetId() ) + `').val()` )1125 case ***HtmlInputMonth:1126 pass = true1127 key = []byte( (*(*(*v.(***HtmlInputMonth)))).Name )1128 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputMonth)))).GetId() ) + `').val()` )1129 case ***HtmlInputNumber:1130 pass = true1131 key = []byte( (*(*(*v.(***HtmlInputNumber)))).Name )1132 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputNumber)))).GetId() ) + `').val()` )1133 case ***HtmlInputPassword:1134 pass = true1135 key = []byte( (*(*(*v.(***HtmlInputPassword)))).Name )1136 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputPassword)))).GetId() ) + `').val()` )1137 case ***HtmlInputRadio:1138 pass = true1139 key = []byte( (*(*(*v.(***HtmlInputRadio)))).Name )1140 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputRadio)))).GetId() ) + `').val()` )1141 case ***HtmlInputRange:1142 pass = true1143 key = []byte( (*(*(*v.(***HtmlInputRange)))).Name )1144 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputRange)))).GetId() ) + `').val()` )1145 case ***HtmlInputSearch:1146 pass = true1147 key = []byte( (*(*(*v.(***HtmlInputSearch)))).Name )1148 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputSearch)))).GetId() ) + `').val()` )1149 case ***HtmlInputTel:1150 pass = true1151 key = []byte( (*(*(*v.(***HtmlInputTel)))).Name )1152 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputTel)))).GetId() ) + `').val()` )1153 case ***HtmlInputTime:1154 pass = true1155 key = []byte( (*(*(*v.(***HtmlInputTime)))).Name )1156 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputTime)))).GetId() ) + `').val()` )1157 case ***HtmlInputUrl:1158 pass = true1159 key = []byte( (*(*(*v.(***HtmlInputUrl)))).Name )1160 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputUrl)))).GetId() ) + `').val()` )1161 case ***HtmlInputWeek:1162 pass = true1163 key = []byte( (*(*(*v.(***HtmlInputWeek)))).Name )1164 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputWeek)))).GetId() ) + `').val()` )1165 case ***HtmlInputSubmit:1166 pass = true1167 key = []byte( (*(*(*v.(***HtmlInputSubmit)))).Name )1168 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputSubmit)))).GetId() ) + `').val()` )1169 case ***KendoUiMobileSwitch:1170 pass = true1171 key = []byte( (*(*(*v.(***KendoUiMobileSwitch)))).Html.Name )1172 jsCode = []byte( `$('#` + string( (*(*(*v.(***KendoUiMobileSwitch)))).GetId() ) + `').val()` )1173 case **AceEditor:1174 pass = true1175 key = []byte( (*(*v.(**AceEditor))).Html.Name )1176 jsCode = []byte( `ace.edit("` + string( (*(*v.(**AceEditor))).GetId() ) + `").getValue()` )1177 case **HtmlElementScript:1178 pass = true1179 key = []byte( (*(*v.(**HtmlElementScript))).GetId() )1180 jsCode = []byte( `kendo.template($("#` + string( (*(*v.(**HtmlElementScript))).GetId() ) + `").html())` )1181 case **KendoUiComboBox:1182 pass = true1183 key = []byte( (*(*v.(**KendoUiComboBox))).Html.Name )1184 jsCode = []byte( `$('#` + string( (*(*v.(**KendoUiComboBox))).GetId() ) + `').data('kendoComboBox').value()` )1185 case **HtmlInputText:1186 pass = true1187 key = []byte( (*(*v.(**HtmlInputText))).Name )1188 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputText))).GetId() ) + `').val()` )1189 case **HtmlInputHidden:1190 pass = true1191 key = []byte( (*(*v.(**HtmlInputHidden))).Name )1192 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputHidden))).GetId() ) + `').val()` )1193 case **KendoUiDropDownList:1194 pass = true1195 key = []byte( (*(*v.(**KendoUiDropDownList))).Html.Name )1196 jsCode = []byte( `$('#` + string( (*(*v.(**KendoUiDropDownList))).GetId() ) + `').data('kendoDropDownList').value()` )1197 case **KendoUiMultiSelect: // fixme: colocar o conteúdo da janela aqui também1198 pass = true1199 key = []byte( (*(*v.(**KendoUiMultiSelect))).Html.Name )1200 jsCode = []byte( `$('#` + string( (*(*v.(**KendoUiMultiSelect))).GetId() ) + `').data('kendoMultiSelect').value()` )1201 case **KendoUiAutoComplete:1202 pass = true1203 key = []byte( (*(*v.(**KendoUiAutoComplete))).Html.Name )1204 jsCode = []byte( `$('#` + string( (*(*v.(**KendoUiAutoComplete))).GetId() ) + `').data('kendoAutoComplete').value()` )1205 case **KendoUiButton:1206 //pass = true1207 //key = []byte( (*(*v.(**KendoUiButton))).Html.Name )1208 //jsCode = []byte( `$('#` + string( (*(*v.(**KendoUiButton))).GetId() ) + `').data('kendoButton').value()` )1209 case **KendoUiCalendar:1210 pass = true1211 key = []byte( (*(*v.(**KendoUiCalendar))).Html.Name )1212 jsCode = []byte( `$('#` + string( (*(*v.(**KendoUiCalendar))).GetId() ) + `').data('kendoCalendar').value()` )1213 case **KendoUiColorPalette:1214 pass = true1215 key = []byte( (*(*v.(**KendoUiColorPalette))).Html.Name )1216 jsCode = []byte( `$('#` + string( (*(*v.(**KendoUiColorPalette))).GetId() ) + `').data('kendoColorPalette').value()` )1217 case **KendoUiColorPicker:1218 pass = true1219 key = []byte( (*(*v.(**KendoUiColorPicker))).Html.Name )1220 jsCode = []byte( `$('#` + string( (*(*v.(**KendoUiColorPicker))).GetId() ) + `').data('kendoColorPicker').value()` )1221 case **KendoUiNumericTextBox:1222 pass = true1223 key = []byte( (*(*v.(**KendoUiNumericTextBox))).Html.Name )1224 jsCode = []byte( `$('#` + string( (*(*v.(**KendoUiNumericTextBox))).GetId() ) + `').data('kendoNumericTextBox').value()` )1225 case **KendoUiDateInput:1226 pass = true1227 key = []byte( (*(*v.(**KendoUiDateInput))).Html.Name )1228 jsCode = []byte( `$('#` + string( (*(*v.(**KendoUiDateInput))).GetId() ) + `').data('kendoDateInput').value()` )1229 case **KendoUiDatePicker:1230 pass = true1231 key = []byte( (*(*v.(**KendoUiDatePicker))).Html.Name )1232 jsCode = []byte( `$('#` + string( (*(*v.(**KendoUiDatePicker))).GetId() ) + `').data('kendoDatePicker').value()` )1233 case **KendoUiDateTimePicker:1234 pass = true1235 key = []byte( (*(*v.(**KendoUiDateTimePicker))).Html.Name )1236 jsCode = []byte( `$('#` + string( (*(*v.(**KendoUiDateTimePicker))).GetId() ) + `').data('kendoDateTimePicker').value()` )1237 case **HtmlElementFormSelect:1238 pass = true1239 key = []byte( (*(*v.(**HtmlElementFormSelect))).Name )1240 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlElementFormSelect))).GetId() ) + `').val()` )1241 case **HtmlElementFormTextArea:1242 pass = true1243 key = []byte( (*(*v.(**HtmlElementFormTextArea))).Name )1244 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlElementFormTextArea))).GetId() ) + `').val()` )1245 case **HtmlInputCheckBox:1246 pass = true1247 key = []byte( (*(*v.(**HtmlInputCheckBox))).Name )1248 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputCheckBox))).GetId() ) + `').val()` )1249 case **HtmlInputColor:1250 pass = true1251 key = []byte( (*(*v.(**HtmlInputColor))).Name )1252 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputColor))).GetId() ) + `').val()` )1253 case **HtmlInputDate:1254 pass = true1255 key = []byte( (*(*v.(**HtmlInputDate))).Name )1256 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputDate))).GetId() ) + `').val()` )1257 case **HtmlInputDateTimeLocal:1258 pass = true1259 key = []byte( (*(*v.(**HtmlInputDateTimeLocal))).Name )1260 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputDateTimeLocal))).GetId() ) + `').val()` )1261 case **HtmlInputEmail:1262 pass = true1263 key = []byte( (*(*v.(**HtmlInputEmail))).Name )1264 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputEmail))).GetId() ) + `').val()` )1265 case **HtmlInputFile:1266 pass = true1267 key = []byte( (*(*v.(**HtmlInputFile))).Name )1268 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputFile))).GetId() ) + `').val()` )1269 case **HtmlInputGeneric:1270 pass = true1271 key = []byte( (*(*v.(***HtmlInputGeneric))).Name )1272 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputGeneric))).GetId() ) + `').val()` )1273 case **HtmlInputImage:1274 pass = true1275 key = []byte( (*(*v.(**HtmlInputImage))).Name )1276 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputImage))).GetId() ) + `').val()` )1277 case **HtmlInputMonth:1278 pass = true1279 key = []byte( (*(*v.(**HtmlInputMonth))).Name )1280 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputMonth))).GetId() ) + `').val()` )1281 case **HtmlInputNumber:1282 pass = true1283 key = []byte( (*(*v.(**HtmlInputNumber))).Name )1284 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputNumber))).GetId() ) + `').val()` )1285 case **HtmlInputPassword:1286 pass = true1287 key = []byte( (*(*v.(**HtmlInputPassword))).Name )1288 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputPassword))).GetId() ) + `').val()` )1289 case **HtmlInputRadio:1290 pass = true1291 key = []byte( (*(*v.(**HtmlInputRadio))).Name )1292 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputRadio))).GetId() ) + `').val()` )1293 case **HtmlInputRange:1294 pass = true1295 key = []byte( (*(*v.(**HtmlInputRange))).Name )1296 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputRange))).GetId() ) + `').val()` )1297 case **HtmlInputSearch:1298 pass = true1299 key = []byte( (*(*v.(**HtmlInputSearch))).Name )1300 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputSearch))).GetId() ) + `').val()` )1301 case **HtmlInputTel:1302 pass = true1303 key = []byte( (*(*v.(**HtmlInputTel))).Name )1304 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputTel))).GetId() ) + `').val()` )1305 case **HtmlInputTime:1306 pass = true1307 key = []byte( (*(*v.(**HtmlInputTime))).Name )1308 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputTime))).GetId() ) + `').val()` )1309 case **HtmlInputUrl:1310 pass = true1311 key = []byte( (*(*v.(**HtmlInputUrl))).Name )1312 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputUrl))).GetId() ) + `').val()` )1313 case **HtmlInputWeek:1314 pass = true1315 key = []byte( (*(*v.(**HtmlInputWeek))).Name )1316 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputWeek))).GetId() ) + `').val()` )1317 case **HtmlInputSubmit:1318 pass = true1319 key = []byte( (*(*v.(**HtmlInputSubmit))).Name )1320 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputSubmit))).GetId() ) + `').val()` )1321 case **KendoUiMobileSwitch:1322 pass = true1323 key = []byte( (*(*v.(**KendoUiMobileSwitch))).Html.Name )1324 jsCode = []byte( `$('#` + string( (*(*v.(**KendoUiMobileSwitch))).GetId() ) + `').val()` )1325 case *AceEditor:1326 pass = true1327 key = []byte( converted.Html.Name )1328 jsCode = []byte( `ace.edit("` + string( converted.GetId() ) + `").getValue()` )1329 case *HtmlElementScript:1330 pass = true1331 key = []byte( converted.GetId() )1332 jsCode = []byte( `kendo.template($("#` + string( converted.GetId() ) + `").html())` )1333 case *KendoUiComboBox:1334 pass = true1335 key = []byte( converted.Html.Name )1336 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').data('kendoComboBox').value()` )1337 case *HtmlInputText:1338 pass = true1339 key = []byte( converted.Name )1340 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val()` )1341 case *HtmlInputHidden:1342 pass = true1343 key = []byte( converted.Name )1344 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val()` )1345 case *KendoUiDropDownList:1346 pass = true1347 key = []byte( converted.Html.Name )1348 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').data('kendoDropDownList').value()` )1349 case *KendoUiMultiSelect: // fixme: colocar o conteúdo da janela aqui também1350 pass = true1351 key = []byte( converted.Html.Name )1352 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').data('kendoMultiSelect').value()` )1353 case *KendoUiAutoComplete:1354 pass = true1355 key = []byte( converted.Html.Name )1356 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').data('kendoAutoComplete').value()` )1357 case *KendoUiButton:1358 //pass = true1359 //key = []byte( converted.Html.Name )1360 //jsCode = []byte( `$('#` + string( converted.GetId() ) + `').data('kendoButton').value()` )1361 case *KendoUiCalendar:1362 pass = true1363 key = []byte( converted.Html.Name )1364 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').data('kendoCalendar').value()` )1365 case *KendoUiColorPalette:1366 pass = true1367 key = []byte( converted.Html.Name )1368 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').data('kendoColorPalette').value()` )1369 case *KendoUiColorPicker:1370 pass = true1371 key = []byte( converted.Html.Name )1372 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').data('kendoColorPicker').value()` )1373 case *KendoUiNumericTextBox:1374 pass = true1375 key = []byte( converted.Html.Name )1376 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').data('kendoNumericTextBox').value()` )1377 case *KendoUiDateInput:1378 pass = true1379 key = []byte( converted.Html.Name )1380 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').data('kendoDateInput').value()` )1381 case *KendoUiDatePicker:1382 pass = true1383 key = []byte( converted.Html.Name )1384 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').data('kendoDatePicker').value()` )1385 case *KendoUiDateTimePicker:1386 pass = true1387 key = []byte( converted.Html.Name )1388 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').data('kendoDateTimePicker').value()` )1389 case *HtmlElementFormSelect:1390 pass = true1391 key = []byte( converted.Name )1392 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val()` )1393 case *HtmlElementFormTextArea:1394 pass = true1395 key = []byte( converted.Name )1396 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val()` )1397 case *HtmlInputCheckBox:1398 pass = true1399 key = []byte( converted.Name )1400 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val()` )1401 case *HtmlInputColor:1402 pass = true1403 key = []byte( converted.Name )1404 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val()` )1405 case *HtmlInputDate:1406 pass = true1407 key = []byte( converted.Name )1408 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val()` )1409 case *HtmlInputDateTimeLocal:1410 pass = true1411 key = []byte( converted.Name )1412 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val()` )1413 case *HtmlInputEmail:1414 pass = true1415 key = []byte( converted.Name )1416 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val()` )1417 case *HtmlInputFile:1418 pass = true1419 key = []byte( converted.Name )1420 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val()` )1421 case *HtmlInputGeneric:1422 pass = true1423 key = []byte( converted.Name )1424 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val()` )1425 case *HtmlInputImage:1426 pass = true1427 key = []byte( converted.Name )1428 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val()` )1429 case *HtmlInputMonth:1430 pass = true1431 key = []byte( converted.Name )1432 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val()` )1433 case *HtmlInputNumber:1434 pass = true1435 key = []byte( converted.Name )1436 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val()` )1437 case *HtmlInputPassword:1438 pass = true1439 key = []byte( converted.Name )1440 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val()` )1441 case *HtmlInputRadio:1442 pass = true1443 key = []byte( converted.Name )1444 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val()` )1445 case *HtmlInputRange:1446 pass = true1447 key = []byte( converted.Name )1448 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val()` )1449 case *HtmlInputSearch:1450 pass = true1451 key = []byte( converted.Name )1452 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val()` )1453 case *HtmlInputTel:1454 pass = true1455 key = []byte( converted.Name )1456 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val()` )1457 case *HtmlInputTime:1458 pass = true1459 key = []byte( converted.Name )1460 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val()` )1461 case *HtmlInputUrl:1462 pass = true1463 key = []byte( converted.Name )1464 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val()` )1465 case *HtmlInputWeek:1466 pass = true1467 key = []byte( converted.Name )1468 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val()` )1469 case *HtmlInputSubmit:1470 pass = true1471 key = []byte( converted.Name )1472 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val()` )1473 case *KendoUiMobileSwitch:1474 pass = true1475 key = []byte( converted.Html.Name )1476 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val()` )1477 case *Content:1478 case *KendoDataSource:1479 default:1480 fmt.Printf( "\n\n\n-getValueById.id.type.%T.not.found.\n\n\n", converted )1481 }1482 if pass == true {1483 buffer.Write([]byte( " case 'id:" ))1484 buffer.Write(key)1485 buffer.Write([]byte( "': return " ))1486 buffer.Write(jsCode)1487 buffer.Write([]byte( ";\n" ))1488 }1489 }1490 buffer.Write( []byte( " }\n" ) )1491 buffer.Write( []byte( " }\n" ) )1492 buffer.Write( []byte( " function setValueById( id, value ){\n" ) )1493 buffer.Write( []byte( " switch( id ){\n" ) )1494 for _, v := range formElements {1495 pass = false1496 switch converted := v.(type) {1497 case ***AceEditor:1498 pass = true1499 key = []byte( (*(*(*v.(***AceEditor)))).Html.Name )1500 jsCode = []byte( `ace.edit("` + string( (*(*(*v.(***AceEditor)))).GetId() ) + `").setValue( value )` )1501 case ***KendoUiComboBox:1502 pass = true1503 key = []byte( (*(*(*v.(***KendoUiComboBox)))).Html.Name )1504 jsCode = []byte( `$('#` + string( (*(*(*v.(***KendoUiComboBox)))).GetId() ) + `').data('kendoComboBox').value( value )` )1505 case ***HtmlInputText:1506 pass = true1507 key = []byte( (*(*(*v.(***HtmlInputText)))).Name )1508 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputText)))).GetId() ) + `').val( value )` )1509 case ***HtmlInputHidden:1510 pass = true1511 key = []byte( (*(*(*v.(***HtmlInputHidden)))).Name )1512 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputHidden)))).GetId() ) + `').val( value )` )1513 case ***KendoUiDropDownList:1514 pass = true1515 key = []byte( (*(*(*v.(***KendoUiDropDownList)))).Html.Name )1516 jsCode = []byte( `$('#` + string( (*(*(*v.(***KendoUiDropDownList)))).GetId() ) + `').data('kendoDropDownList').value( value )` )1517 case ***KendoUiMultiSelect: // fixme: colocar o conteúdo da janela aqui também1518 pass = true1519 key = []byte( (*(*(*v.(***KendoUiMultiSelect)))).Html.Name )1520 jsCode = []byte( `$('#` + string( (*(*(*v.(***KendoUiMultiSelect)))).GetId() ) + `').data('kendoMultiSelect').value( value )` )1521 case ***KendoUiAutoComplete:1522 pass = true1523 key = []byte( (*(*(*v.(***KendoUiAutoComplete)))).Html.Name )1524 jsCode = []byte( `$('#` + string( (*(*(*v.(***KendoUiAutoComplete)))).GetId() ) + `').data('kendoAutoComplete').value( value )` )1525 case ***KendoUiButton:1526 //pass = true1527 //key = []byte( (*(*(*v.(***KendoUiButton)))).Html.Name )1528 //jsCode = []byte( `$('#` + string( (*(*(*v.(***KendoUiButton)))).GetId() ) + `').data('kendoButton').value( value )` )1529 case ***KendoUiCalendar:1530 pass = true1531 key = []byte( (*(*(*v.(***KendoUiCalendar)))).Html.Name )1532 jsCode = []byte( `$('#` + string( (*(*(*v.(***KendoUiCalendar)))).GetId() ) + `').data('kendoCalendar').value( value )` )1533 case ***KendoUiColorPalette:1534 pass = true1535 key = []byte( (*(*(*v.(***KendoUiColorPalette)))).Html.Name )1536 jsCode = []byte( `$('#` + string( (*(*(*v.(***KendoUiColorPalette)))).GetId() ) + `').data('kendoColorPalette').value( value )` )1537 case ***KendoUiColorPicker:1538 pass = true1539 key = []byte( (*(*(*v.(***KendoUiColorPicker)))).Html.Name )1540 jsCode = []byte( `$('#` + string( (*(*(*v.(***KendoUiColorPicker)))).GetId() ) + `').data('kendoColorPicker').value( value )` )1541 case ***KendoUiNumericTextBox:1542 pass = true1543 key = []byte( (*(*(*v.(***KendoUiNumericTextBox)))).Html.Name )1544 jsCode = []byte( `$('#` + string( (*(*(*v.(***KendoUiNumericTextBox)))).GetId() ) + `').data('kendoNumericTextBox').value( value )` )1545 case ***KendoUiDateInput:1546 pass = true1547 key = []byte( (*(*(*v.(***KendoUiDateInput)))).Html.Name )1548 jsCode = []byte( `$('#` + string( (*(*(*v.(***KendoUiDateInput)))).GetId() ) + `').data('kendoDateInput').value( value )` )1549 case ***KendoUiDatePicker:1550 pass = true1551 key = []byte( (*(*(*v.(***KendoUiDatePicker)))).Html.Name )1552 jsCode = []byte( `$('#` + string( (*(*(*v.(***KendoUiDatePicker)))).GetId() ) + `').data('kendoDatePicker').value( value )` )1553 case ***KendoUiDateTimePicker:1554 pass = true1555 key = []byte( (*(*(*v.(***KendoUiDateTimePicker)))).Html.Name )1556 jsCode = []byte( `$('#` + string( (*(*(*v.(***KendoUiDateTimePicker)))).GetId() ) + `').data('kendoDateTimePicker').value( value )` )1557 case ***HtmlElementFormSelect:1558 pass = true1559 key = []byte( (*(*(*v.(***HtmlElementFormSelect)))).Name )1560 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlElementFormSelect)))).GetId() ) + `').val( value )` )1561 case ***HtmlElementFormTextArea:1562 pass = true1563 key = []byte( (*(*(*v.(***HtmlElementFormTextArea)))).Name )1564 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlElementFormTextArea)))).GetId() ) + `').val( value )` )1565 case ***HtmlInputCheckBox:1566 pass = true1567 key = []byte( (*(*(*v.(***HtmlInputCheckBox)))).Name )1568 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputCheckBox)))).GetId() ) + `').val( value )` )1569 case ***HtmlInputColor:1570 pass = true1571 key = []byte( (*(*(*v.(***HtmlInputColor)))).Name )1572 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputColor)))).GetId() ) + `').val( value )` )1573 case ***HtmlInputDate:1574 pass = true1575 key = []byte( (*(*(*v.(***HtmlInputDate)))).Name )1576 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputDate)))).GetId() ) + `').val( value )` )1577 case ***HtmlInputDateTimeLocal:1578 pass = true1579 key = []byte( (*(*(*v.(***HtmlInputDateTimeLocal)))).Name )1580 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputDateTimeLocal)))).GetId() ) + `').val( value )` )1581 case ***HtmlInputEmail:1582 pass = true1583 key = []byte( (*(*(*v.(***HtmlInputEmail)))).Name )1584 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputEmail)))).GetId() ) + `').val( value )` )1585 case ***HtmlInputFile:1586 pass = true1587 key = []byte( (*(*(*v.(***HtmlInputFile)))).Name )1588 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputFile)))).GetId() ) + `').val( value )` )1589 case ***HtmlInputGeneric:1590 pass = true1591 key = []byte( (*(*(*v.(***HtmlInputGeneric)))).Name )1592 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputGeneric)))).GetId() ) + `').val( value )` )1593 case ***HtmlInputImage:1594 pass = true1595 key = []byte( (*(*(*v.(***HtmlInputImage)))).Name )1596 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputImage)))).GetId() ) + `').val( value )` )1597 case ***HtmlInputMonth:1598 pass = true1599 key = []byte( (*(*(*v.(***HtmlInputMonth)))).Name )1600 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputMonth)))).GetId() ) + `').val( value )` )1601 case ***HtmlInputNumber:1602 pass = true1603 key = []byte( (*(*(*v.(***HtmlInputNumber)))).Name )1604 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputNumber)))).GetId() ) + `').val( value )` )1605 case ***HtmlInputPassword:1606 pass = true1607 key = []byte( (*(*(*v.(***HtmlInputPassword)))).Name )1608 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputPassword)))).GetId() ) + `').val( value )` )1609 case ***HtmlInputRadio:1610 pass = true1611 key = []byte( (*(*(*v.(***HtmlInputRadio)))).Name )1612 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputRadio)))).GetId() ) + `').val( value )` )1613 case ***HtmlInputRange:1614 pass = true1615 key = []byte( (*(*(*v.(***HtmlInputRange)))).Name )1616 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputRange)))).GetId() ) + `').val( value )` )1617 case ***HtmlInputSearch:1618 pass = true1619 key = []byte( (*(*(*v.(***HtmlInputSearch)))).Name )1620 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputSearch)))).GetId() ) + `').val( value )` )1621 case ***HtmlInputTel:1622 pass = true1623 key = []byte( (*(*(*v.(***HtmlInputTel)))).Name )1624 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputTel)))).GetId() ) + `').val( value )` )1625 case ***HtmlInputTime:1626 pass = true1627 key = []byte( (*(*(*v.(***HtmlInputTime)))).Name )1628 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputTime)))).GetId() ) + `').val( value )` )1629 case ***HtmlInputUrl:1630 pass = true1631 key = []byte( (*(*(*v.(***HtmlInputUrl)))).Name )1632 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputUrl)))).GetId() ) + `').val( value )` )1633 case ***HtmlInputWeek:1634 pass = true1635 key = []byte( (*(*(*v.(***HtmlInputWeek)))).Name )1636 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputWeek)))).GetId() ) + `').val( value )` )1637 case ***HtmlInputSubmit:1638 pass = true1639 key = []byte( (*(*(*v.(***HtmlInputSubmit)))).Name )1640 jsCode = []byte( `$('#` + string( (*(*(*v.(***HtmlInputSubmit)))).GetId() ) + `').val( value )` )1641 case ***KendoUiMobileSwitch:1642 pass = true1643 key = []byte( (*(*(*v.(***KendoUiMobileSwitch)))).Html.Name )1644 jsCode = []byte( `$('#` + string( (*(*(*v.(***KendoUiMobileSwitch)))).GetId() ) + `').val( value )` )1645 case **AceEditor:1646 pass = true1647 key = []byte( (*(*v.(**AceEditor))).Html.Name )1648 jsCode = []byte( `ace.edit("` + string( (*(*v.(**AceEditor))).GetId() ) + `").setValue( value )` )1649 case **KendoUiComboBox:1650 pass = true1651 key = []byte( (*(*v.(**KendoUiComboBox))).Html.Name )1652 jsCode = []byte( `$('#` + string( (*(*v.(**KendoUiComboBox))).GetId() ) + `').data('kendoComboBox').value( value )` )1653 case **HtmlInputText:1654 pass = true1655 key = []byte( (*(*v.(**HtmlInputText))).Name )1656 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputText))).GetId() ) + `').val( value )` )1657 case **HtmlInputHidden:1658 pass = true1659 key = []byte( (*(*v.(**HtmlInputHidden))).Name )1660 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputHidden))).GetId() ) + `').val( value )` )1661 case **KendoUiDropDownList:1662 pass = true1663 key = []byte( (*(*v.(**KendoUiDropDownList))).Html.Name )1664 jsCode = []byte( `$('#` + string( (*(*v.(**KendoUiDropDownList))).GetId() ) + `').data('kendoDropDownList').value( value )` )1665 case **KendoUiMultiSelect: // fixme: colocar o conteúdo da janela aqui também1666 pass = true1667 key = []byte( (*(*v.(**KendoUiMultiSelect))).Html.Name )1668 jsCode = []byte( `$('#` + string( (*(*v.(**KendoUiMultiSelect))).GetId() ) + `').data('kendoMultiSelect').value( value )` )1669 case **KendoUiAutoComplete:1670 pass = true1671 key = []byte( (*(*v.(**KendoUiAutoComplete))).Html.Name )1672 jsCode = []byte( `$('#` + string( (*(*v.(**KendoUiAutoComplete))).GetId() ) + `').data('kendoAutoComplete').value( value )` )1673 case **KendoUiButton:1674 //pass = true1675 //key = []byte( (*(*v.(**KendoUiButton))).Html.Name )1676 //jsCode = []byte( `$('#` + string( (*(*v.(**KendoUiButton))).GetId() ) + `').data('kendoButton').value( value )` )1677 case **KendoUiCalendar:1678 pass = true1679 key = []byte( (*(*v.(**KendoUiCalendar))).Html.Name )1680 jsCode = []byte( `$('#` + string( (*(*v.(**KendoUiCalendar))).GetId() ) + `').data('kendoCalendar').value( value )` )1681 case **KendoUiColorPalette:1682 pass = true1683 key = []byte( (*(*v.(**KendoUiColorPalette))).Html.Name )1684 jsCode = []byte( `$('#` + string( (*(*v.(**KendoUiColorPalette))).GetId() ) + `').data('kendoColorPalette').value( value )` )1685 case **KendoUiColorPicker:1686 pass = true1687 key = []byte( (*(*v.(**KendoUiColorPicker))).Html.Name )1688 jsCode = []byte( `$('#` + string( (*(*v.(**KendoUiColorPicker))).GetId() ) + `').data('kendoColorPicker').value( value )` )1689 case **KendoUiNumericTextBox:1690 pass = true1691 key = []byte( (*(*v.(**KendoUiNumericTextBox))).Html.Name )1692 jsCode = []byte( `$('#` + string( (*(*v.(**KendoUiNumericTextBox))).GetId() ) + `').data('kendoNumericTextBox').value( value )` )1693 case **KendoUiDateInput:1694 pass = true1695 key = []byte( (*(*v.(**KendoUiDateInput))).Html.Name )1696 jsCode = []byte( `$('#` + string( (*(*v.(**KendoUiDateInput))).GetId() ) + `').data('kendoDateInput').value( value )` )1697 case **KendoUiDatePicker:1698 pass = true1699 key = []byte( (*(*v.(**KendoUiDatePicker))).Html.Name )1700 jsCode = []byte( `$('#` + string( (*(*v.(**KendoUiDatePicker))).GetId() ) + `').data('kendoDatePicker').value( value )` )1701 case **KendoUiDateTimePicker:1702 pass = true1703 key = []byte( (*(*v.(**KendoUiDateTimePicker))).Html.Name )1704 jsCode = []byte( `$('#` + string( (*(*v.(**KendoUiDateTimePicker))).GetId() ) + `').data('kendoDateTimePicker').value( value )` )1705 case **HtmlElementFormSelect:1706 pass = true1707 key = []byte( (*(*v.(**HtmlElementFormSelect))).Name )1708 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlElementFormSelect))).GetId() ) + `').val( value )` )1709 case **HtmlElementFormTextArea:1710 pass = true1711 key = []byte( (*(*v.(**HtmlElementFormTextArea))).Name )1712 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlElementFormTextArea))).GetId() ) + `').val( value )` )1713 case **HtmlInputCheckBox:1714 pass = true1715 key = []byte( (*(*v.(**HtmlInputCheckBox))).Name )1716 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputCheckBox))).GetId() ) + `').val( value )` )1717 case **HtmlInputColor:1718 pass = true1719 key = []byte( (*(*v.(**HtmlInputColor))).Name )1720 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputColor))).GetId() ) + `').val( value )` )1721 case **HtmlInputDate:1722 pass = true1723 key = []byte( (*(*v.(**HtmlInputDate))).Name )1724 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputDate))).GetId() ) + `').val( value )` )1725 case **HtmlInputDateTimeLocal:1726 pass = true1727 key = []byte( (*(*v.(**HtmlInputDateTimeLocal))).Name )1728 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputDateTimeLocal))).GetId() ) + `').val( value )` )1729 case **HtmlInputEmail:1730 pass = true1731 key = []byte( (*(*v.(**HtmlInputEmail))).Name )1732 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputEmail))).GetId() ) + `').val( value )` )1733 case **HtmlInputFile:1734 pass = true1735 key = []byte( (*(*v.(**HtmlInputFile))).Name )1736 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputFile))).GetId() ) + `').val( value )` )1737 case **HtmlInputGeneric:1738 pass = true1739 key = []byte( (*(*v.(***HtmlInputGeneric))).Name )1740 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputGeneric))).GetId() ) + `').val( value )` )1741 case **HtmlInputImage:1742 pass = true1743 key = []byte( (*(*v.(**HtmlInputImage))).Name )1744 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputImage))).GetId() ) + `').val( value )` )1745 case **HtmlInputMonth:1746 pass = true1747 key = []byte( (*(*v.(**HtmlInputMonth))).Name )1748 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputMonth))).GetId() ) + `').val( value )` )1749 case **HtmlInputNumber:1750 pass = true1751 key = []byte( (*(*v.(**HtmlInputNumber))).Name )1752 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputNumber))).GetId() ) + `').val( value )` )1753 case **HtmlInputPassword:1754 pass = true1755 key = []byte( (*(*v.(**HtmlInputPassword))).Name )1756 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputPassword))).GetId() ) + `').val( value )` )1757 case **HtmlInputRadio:1758 pass = true1759 key = []byte( (*(*v.(**HtmlInputRadio))).Name )1760 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputRadio))).GetId() ) + `').val( value )` )1761 case **HtmlInputRange:1762 pass = true1763 key = []byte( (*(*v.(**HtmlInputRange))).Name )1764 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputRange))).GetId() ) + `').val( value )` )1765 case **HtmlInputSearch:1766 pass = true1767 key = []byte( (*(*v.(**HtmlInputSearch))).Name )1768 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputSearch))).GetId() ) + `').val( value )` )1769 case **HtmlInputTel:1770 pass = true1771 key = []byte( (*(*v.(**HtmlInputTel))).Name )1772 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputTel))).GetId() ) + `').val( value )` )1773 case **HtmlInputTime:1774 pass = true1775 key = []byte( (*(*v.(**HtmlInputTime))).Name )1776 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputTime))).GetId() ) + `').val( value )` )1777 case **HtmlInputUrl:1778 pass = true1779 key = []byte( (*(*v.(**HtmlInputUrl))).Name )1780 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputUrl))).GetId() ) + `').val( value )` )1781 case **HtmlInputWeek:1782 pass = true1783 key = []byte( (*(*v.(**HtmlInputWeek))).Name )1784 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputWeek))).GetId() ) + `').val( value )` )1785 case **HtmlInputSubmit:1786 pass = true1787 key = []byte( (*(*v.(**HtmlInputSubmit))).Name )1788 jsCode = []byte( `$('#` + string( (*(*v.(**HtmlInputSubmit))).GetId() ) + `').val( value )` )1789 case **KendoUiMobileSwitch:1790 pass = true1791 key = []byte( (*(*v.(**KendoUiMobileSwitch))).Html.Name )1792 jsCode = []byte( `$('#` + string( (*(*v.(**KendoUiMobileSwitch))).GetId() ) + `').val( value )` )1793 case *AceEditor:1794 pass = true1795 key = []byte( converted.Html.Name )1796 jsCode = []byte( `ace.edit("` + string( converted.GetId() ) + `").setValue( value )` )1797 case *KendoUiComboBox:1798 pass = true1799 key = []byte( converted.Html.Name )1800 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').data('kendoComboBox').value( value )` )1801 case *HtmlInputText:1802 pass = true1803 key = []byte( converted.Name )1804 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val( value )` )1805 case *HtmlInputHidden:1806 pass = true1807 key = []byte( converted.Name )1808 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val( value )` )1809 case *KendoUiDropDownList:1810 pass = true1811 key = []byte( converted.Html.Name )1812 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').data('kendoDropDownList').value( value )` )1813 case *KendoUiMultiSelect: // fixme: colocar o conteúdo da janela aqui também1814 pass = true1815 key = []byte( converted.Html.Name )1816 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').data('kendoMultiSelect').value( value )` )1817 case *KendoUiAutoComplete:1818 pass = true1819 key = []byte( converted.Html.Name )1820 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').data('kendoAutoComplete').value( value )` )1821 case *KendoUiButton:1822 //pass = true1823 //key = []byte( converted.Html.Name )1824 //jsCode = []byte( `$('#` + string( converted.GetId() ) + `').data('kendoButton').value( value )` )1825 case *KendoUiCalendar:1826 pass = true1827 key = []byte( converted.Html.Name )1828 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').data('kendoCalendar').value( value )` )1829 case *KendoUiColorPalette:1830 pass = true1831 key = []byte( converted.Html.Name )1832 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').data('kendoColorPalette').value( value )` )1833 case *KendoUiColorPicker:1834 pass = true1835 key = []byte( converted.Html.Name )1836 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').data('kendoColorPicker').value( value )` )1837 case *KendoUiNumericTextBox:1838 pass = true1839 key = []byte( converted.Html.Name )1840 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').data('kendoNumericTextBox').value( value )` )1841 case *KendoUiDateInput:1842 pass = true1843 key = []byte( converted.Html.Name )1844 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').data('kendoDateInput').value( value )` )1845 case *KendoUiDatePicker:1846 pass = true1847 key = []byte( converted.Html.Name )1848 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').data('kendoDatePicker').value( value )` )1849 case *KendoUiDateTimePicker:1850 pass = true1851 key = []byte( converted.Html.Name )1852 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').data('kendoDateTimePicker').value( value )` )1853 case *HtmlElementFormSelect:1854 pass = true1855 key = []byte( converted.Name )1856 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val( value )` )1857 case *HtmlElementFormTextArea:1858 pass = true1859 key = []byte( converted.Name )1860 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val( value )` )1861 case *HtmlInputCheckBox:1862 pass = true1863 key = []byte( converted.Name )1864 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val( value )` )1865 case *HtmlInputColor:1866 pass = true1867 key = []byte( converted.Name )1868 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val( value )` )1869 case *HtmlInputDate:1870 pass = true1871 key = []byte( converted.Name )1872 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val( value )` )1873 case *HtmlInputDateTimeLocal:1874 pass = true1875 key = []byte( converted.Name )1876 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val( value )` )1877 case *HtmlInputEmail:1878 pass = true1879 key = []byte( converted.Name )1880 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val( value )` )1881 case *HtmlInputFile:1882 pass = true1883 key = []byte( converted.Name )1884 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val( value )` )1885 case *HtmlInputGeneric:1886 pass = true1887 key = []byte( converted.Name )1888 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val( value )` )1889 case *HtmlInputImage:1890 pass = true1891 key = []byte( converted.Name )1892 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val( value )` )1893 case *HtmlInputMonth:1894 pass = true1895 key = []byte( converted.Name )1896 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val( value )` )1897 case *HtmlInputNumber:1898 pass = true1899 key = []byte( converted.Name )1900 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val( value )` )1901 case *HtmlInputPassword:1902 pass = true1903 key = []byte( converted.Name )1904 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val( value )` )1905 case *HtmlInputRadio:1906 pass = true1907 key = []byte( converted.Name )1908 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val( value )` )1909 case *HtmlInputRange:1910 pass = true1911 key = []byte( converted.Name )1912 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val( value )` )1913 case *HtmlInputSearch:1914 pass = true1915 key = []byte( converted.Name )1916 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val( value )` )1917 case *HtmlInputTel:1918 pass = true1919 key = []byte( converted.Name )1920 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val( value )` )1921 case *HtmlInputTime:1922 pass = true1923 key = []byte( converted.Name )1924 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val( value )` )1925 case *HtmlInputUrl:1926 pass = true1927 key = []byte( converted.Name )1928 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val( value )` )1929 case *HtmlInputWeek:1930 pass = true1931 key = []byte( converted.Name )1932 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val( value )` )1933 case *HtmlInputSubmit:1934 pass = true1935 key = []byte( converted.Name )1936 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val( value )` )1937 case *KendoUiMobileSwitch:1938 pass = true1939 key = []byte( converted.Html.Name )1940 jsCode = []byte( `$('#` + string( converted.GetId() ) + `').val( value )` )1941 //fixme: set value - start1942 case *KendoUiGrid:1943 case *HtmlElementScript:1944 case *KendoUiWindow:1945 //fixme: set value - end1946 case *Content:1947 case *KendoDataSource:1948 default:1949 fmt.Printf( "\n\n\n-setValueById.id.type.%T.not.found.\n\n\n", converted )1950 }1951 if pass == true {1952 buffer.Write([]byte( " case 'id:" ))1953 buffer.Write(key)1954 buffer.Write([]byte( "': return " ))1955 buffer.Write(jsCode)1956 buffer.Write([]byte( ";\n" ))1957 }1958 }1959 buffer.Write( []byte( " }\n" ) )1960 buffer.Write( []byte( " }\n" ) )1961 return buffer.Bytes()1962}1963func (el *Content)MakeJsScript() []byte {1964 var buffer bytes.Buffer1965 var elementList = el.FilterFormElements()1966 for keyElementList := range elementList {1967 //switch converted := elementList[ keyElementList ].(type) {1968 //default:1969 // fmt.Printf( "%T\n\n\n\n", converted )1970 //}1971 switch elementList[ keyElementList ].(type) {1972 case *KendoUiGrid:1973 switch convertedToLoop := elementList[ keyElementList ].(*KendoUiGrid).Columns.(type) {1974 case []KendoGridColumns:1975 for _, column := range convertedToLoop {1976 switch convertedColumn := column.Command.(type) {1977 case []KendoGridColumnsCommand:1978 for _, command := range convertedColumn {1979 if command.Name == COLUMNS_COMMAND_VIEW {1980 if command.ViewTemplate != nil {1981 switch command.ViewTemplate.(type) {1982 case *HtmlElementScript:1983 buffer.Write( command.ViewTemplate.(*HtmlElementScript).ToElementScriptTag() )1984 }1985 }1986 }1987 }1988 }1989 }1990 }1991 case **KendoUiMultiSelect:1992 (*(*elementList[ keyElementList ].(**KendoUiMultiSelect))).Html.Global.Id = string( (*(*elementList[ keyElementList ].(**KendoUiMultiSelect))).GetId() )1993 if reflect.DeepEqual( (*(*elementList[ keyElementList ].(**KendoUiMultiSelect))).DataSource, KendoDataSource{} ) == false && reflect.DeepEqual( (*(*elementList[ keyElementList ].(**KendoUiMultiSelect))).Dialog, KendoUiDialog{} ) == false {1994 switch (*(*elementList[ keyElementList ].(**KendoUiMultiSelect))).NoDataTemplate.(type) {1995 case HtmlElementScript:1996 for k := range (*(*elementList[ keyElementList ].(**KendoUiMultiSelect))).NoDataTemplate.(HtmlElementScript).Content {1997 switch (*(*elementList[ keyElementList ].(**KendoUiMultiSelect))).NoDataTemplate.(HtmlElementScript).Content[ k ].(type) {1998 case *HtmlElementFormButton:1999 if (*(*elementList[ keyElementList ].(**KendoUiMultiSelect))).NoDataTemplate.(HtmlElementScript).Content[ k ].(*HtmlElementFormButton).ButtonType == BUTTON_TYPE_ADD_IN_TEMPLATE {2000 //el.NoDataTemplate.(HtmlElementScript).Content[ k ].(HtmlElementFormButton).Global.OnClick = "addNewItemToKendoDataSource('id:#: instance.element[0].id #')"2001 //reflect.ValueOf(&el.NoDataTemplate.(HtmlElementScript).Content[ k ].(*HtmlElementFormButton).Global).FieldByName("OnClick").SetString("esta vivo")2002 p := reflect.ValueOf(&(*(*elementList[ keyElementList ].(**KendoUiMultiSelect))).NoDataTemplate.(HtmlElementScript).Content[ k ].(*HtmlElementFormButton).Global.OnClick)2003 p.Elem().SetString("addNewItemToKendoDataSource('id:#: instance.element[0].id #')")2004 //fmt.Printf( "------%v\n\n\n\n\n\n\n\n", p.Elem().CanSet() )2005 //fmt.Printf( "------%v--------\n\n\n\n\n\n\n\n", (*(*elementList[ keyElementList ].(**KendoUiMultiSelect))).NoDataTemplate.(HtmlElementScript).Content[ k ].(*HtmlElementFormButton).Global.OnClick )2006 //el.NoDataTemplate.(HtmlElementScript).Content[ k ].(HtmlElementFormButton).Global.OnClick = "esta vivo"2007 }2008 }2009 }2010 }2011 }2012 switch tplConverted := (*(*elementList[ keyElementList ].(**KendoUiMultiSelect))).FooterTemplate.(type) {2013 case HtmlElementScript:2014 if tplConverted.Type == SCRIPT_TYPE_KENDO_TEMPLATE {2015 buffer.Write( tplConverted.ToElementScriptTag() )2016 }2017 }2018 switch tplConverted := (*(*elementList[ keyElementList ].(**KendoUiMultiSelect))).NoDataTemplate.(type) {2019 case HtmlElementScript:2020 if tplConverted.Type == SCRIPT_TYPE_KENDO_TEMPLATE {2021 buffer.Write( tplConverted.ToElementScriptTag() )2022 }2023 }2024 switch tplConverted := (*(*elementList[ keyElementList ].(**KendoUiMultiSelect))).HeaderTemplate.(type) {2025 case HtmlElementScript:2026 if tplConverted.Type == SCRIPT_TYPE_KENDO_TEMPLATE {2027 buffer.Write( tplConverted.ToElementScriptTag() )2028 }2029 }2030 }2031 }2032 return buffer.Bytes()2033}...

Full Screen

Full Screen

dom_bridge_wasm.go

Source:dom_bridge_wasm.go Github

copy

Full Screen

...27}28func (b *DomBridge) createElement(node Node) js.Value {29 el := node.(*Element)30 e := b.Doc.Call("createElement", el.Type)31 b.Nodes[el.GetID()] = e32 for attr, value := range el.Attributes {33 if attr == "class" {34 attr = "className"35 }36 e.Set(attr, value)37 }38 b.HandleSpecialAttributes(node, el.Attributes)39 return e40}41func (b *DomBridge) SyncState(From Node) {42 el := From.(*Element)43 e := b.Nodes[From.GetID()]44 val := e.Get("value").String()45 if el.Setter != nil {46 el.Setter(val)47 }48}49func (b *DomBridge) HandleSpecialAttribute(Target Node, action string, value string) {50 // we need to register an onclick, install a handler51 // and call something on a component. Just a attr/value and52 // node/element isn't sufficnent, so we need to pre-handle things.53 // Basically we need a func to call54 // if it has attributes it must be an element55 el := Target.(*Element)56 e := b.Nodes[Target.GetID()]57 if action == "click" {58 handler, ok := el.Handlers[value]59 if !ok {60 return61 }62 e.Set("onclick", jsHandler(handler))63 j.J("onclick set to ", value)64 }65}66func (b *DomBridge) HandleSpecialAttributes(Target Node, attrs Attributes) {67 for k, v := range attrs {68 if strings.HasPrefix(k, "g-") {69 b.HandleSpecialAttribute(Target, k[2:], v)70 }71 }72}73func (b *DomBridge) AttributeChange(Target Node, Adds, Deletes, Updates Attributes) error {74 e := b.Nodes[Target.GetID()]75 // Is it likely that a g- attribute gets dynamically added (resulting in a change)?76 b.HandleSpecialAttributes(Target, Adds)77 for attr, value := range Adds {78 // duplication with createElement79 // skip g-*80 if attr == "class" {81 attr = "className"82 }83 e.Set(attr, value)84 }85 b.HandleSpecialAttributes(Target, Updates)86 for attr, value := range Updates {87 // duplication with createElement88 // skip g-*89 if attr == "class" {90 attr = "className"91 }92 e.Set(attr, value)93 }94 for attr, _ := range Deletes {95 // but here className won't work..?96 if strings.HasPrefix(attr, "g-") {97 // XXX Also: delete node -> cleanup98 // b.ClearSpecialAttribute(e, attr, value)99 }100 e.Call("removeAttribute", attr)101 }102 return nil103}104func (b *DomBridge) Replace(old Node, new Node) error {105 // if it's a Text and only text changed, do an update106 t1, ok1 := old.(*Text)107 t2, ok2 := new.(*Text)108 if ok1 && ok2 && t1.Text != t2.Text {109 // t1.GetID() == t2.GetID() at this point110 e := b.Nodes[t1.GetID()]111 e.Set("nodeValue", t2.Text)112 return nil113 }114 // replace == delete, add115 oldE := b.Nodes[old.GetID()]116 newE := b.createElement(new)117 b.Nodes[new.GetID()] = newE118 // XXX Avoid this call by storing parent on Nodes?119 // -> p := b.Nodes[old.Parent.GetID()]120 p := oldE.Get("parentElement")121 p.Call("replaceChild", oldE, newE)122 delete(b.Nodes, old.GetID())123 return nil124}125func (b *DomBridge) getParent(parent Node) js.Value {126 p := b.Root127 if parent != nil {128 p, ok := b.Nodes[parent.GetID()]129 if !ok {130 panic("Parent " + parent.GetID() + " not found in map")131 }132 return p133 }134 return p135}136func (b *DomBridge) Add(n Node, parent Node) error {137 // parent is 100% sure an element, can't be Text138 p := b.getParent(parent)139 t, ok := n.(*Text)140 if ok {141 e := b.Doc.Call("createTextNode", t.Text)142 b.Nodes[t.GetID()] = e143 p.Call("appendChild", e)144 return nil145 }146 el := n.(*Element)147 e := b.createElement(n)148 p.Call("appendChild", e)149 for _, c := range el.Children {150 b.Add(c, el)151 }152 return nil153}154func (b *DomBridge) Delete(el Node) error {155 child := b.Nodes[el.GetID()]156 p := child.Get("parentElement")157 p.Call("removeChild", child)158 delete(b.Nodes, el.GetID())159 return nil160}161func (b *DomBridge) InsertBefore(before Node, after Node) error {162 nBefore := b.Nodes[before.GetID()]163 nAfter := b.Nodes[after.GetID()]164 p := nAfter.Get("parentElement")165 p.Call("insertBefore", nBefore, nAfter)166 return nil167}168func (b *DomBridge) GetLocation() string {169 return b.Doc.Get("location").String()170}171func (b *DomBridge) SetLocation(path string) {172 window := js.Global().Get("window")173 history := window.Get("history")174 history.Call("pushState", path, "ignored", path)175}...

Full Screen

Full Screen

editor.go

Source:editor.go Github

copy

Full Screen

1package main2import (3 "context"4 "fmt"5 "strings"6 "syscall/js"7 "time"8 "github.com/shizuokago/blog/datastore"9 "github.com/shizuokago/blog/logic"10)11var saveMD string12func main() {13 done := make(chan struct{}, 0)14 fmt.Println("wasm initialize")15 err := run()16 if err != nil {17 fmt.Printf("wasm error: %+v", err)18 }19 fmt.Println("wasm set success")20 <-done21}22func run() error {23 /*24 doc := js.Global().Get("document")25 win := js.Global().Get("window")26 doc.Call(27 "addEventListener",28 "DOMContentLoaded",29 js.FuncOf(func(this js.Value, args []js.Value) interface{} {30 fmt.Println("ContentLoaded() js")31 return nil32 }),33 )34 win.Call(35 "addEventListener",36 "resize",37 js.FuncOf(func(this js.Value, args []js.Value) interface{} {38 draw()39 resize()40 return nil41 }),42 )43 */44 draw()45 for range time.Tick(5 * time.Second) {46 draw()47 }48 return nil49}50func getID(id string) js.Value {51 return js.Global().Get(Document).Call("getElementById", id)52}53func draw() {54 md := getID(INPUT).Get("value").String()55 if md == saveMD {56 return57 }58 saveMD = md59 h := getHTML(md)60 doc := js.Global().Get("document")61 iframe := doc.Call("getElementById", "result")62 if !iframe.IsUndefined() {63 idoc := iframe.Get("contentDocument")64 idoc.Call("open")65 idoc.Call("write", h)66 idoc.Call("close")67 }68}69func getHTML(md string) string {70 path := js.Global().Get("location").Get("pathname")71 paths := strings.Split(path.String(), "/")72 id := paths[len(paths)-1]73 title := getID(TITLE).Get("value").String()74 tags := getID(TAGS).Get("value").String()75 author := getID(AUTHOR).Get("value").String()76 job := getID(JOB).Get("value").String()77 mail := getID(EMAIL).Get("value").String()78 url := getID(URL).Get("value").String()79 twitter := "@" + getID(TWITTER).Get("value").String()80 art := datastore.Article{}81 user := datastore.User{}82 art.Title = title83 art.SubTitle = title84 art.Tags = tags85 art.PublishDate = time.Now()86 art.Markdown = []byte(md)87 user.Name = author88 user.Job = job89 user.Email = mail90 user.URL = url91 user.TwitterId = twitter92 //user.Meta93 blog := datastore.Blog{}94 p, err := logic.CreateHTML(context.Background(), id, &blog, &art, &user)95 if err != nil {96 return err.Error()97 }98 return string(p.Data.Content)99}100const (101 TITLE = "Title"102 TAGS = "Tags"103 AUTHOR = "Name"104 JOB = "Job"105 EMAIL = "Email"106 URL = "URL"107 TWITTER = "TwitterId"108 ARTICLE_ID = "ID"109 BLOGNAME = "BlogName"110 Document = "document"111 SAVE = "save"112 PUBLISH = "publish"113 OUTPUT = "result"114 INPUT = "editor"115 LEFT = "left"116 RIGHT = "right"117)...

Full Screen

Full Screen

GetID

Using AI Code Generation

copy

Full Screen

1func main() {2 js.Global().Set("getID", js.FuncOf(GetID))3}4func main() {5 js.Global().Set("getID", js.FuncOf(GetID))6}7func main() {8 js.Global().Set("getID", js.FuncOf(GetID))9}10func main() {11 js.Global().Set("getID", js.FuncOf(GetID))12}13func main() {14 js.Global().Set("getID", js.FuncOf(GetID))15}16func main() {17 js.Global().Set("getID", js.FuncOf(GetID))18}19func main() {20 js.Global().Set("getID", js.FuncOf(GetID))21}22func main() {23 js.Global().Set("getID", js.FuncOf(GetID))24}25func main() {26 js.Global().Set("getID", js.FuncOf(GetID))27}28func main() {29 js.Global().Set("getID", js.FuncOf(GetID))30}31func main() {32 js.Global().Set("getID", js.FuncOf(GetID))33}34func main() {35 js.Global().Set("getID", js.FuncOf(GetID))36}37func main() {38 js.Global().Set("getID", js.FuncOf(GetID))39}40func main() {41 js.Global().Set("getID", js.FuncOf(GetID

Full Screen

Full Screen

GetID

Using AI Code Generation

copy

Full Screen

1func main() {2 js.Global().Set("getid", js.FuncOf(GetID))3}4func main() {5 js.Global().Set("getid", js.FuncOf(GetID))6}7func main() {8 js.Global().Set("getid", js.FuncOf(GetID))9}10func main() {11 js.Global().Set("getid", js.FuncOf(GetID))12}13func main() {14 js.Global().Set("getid", js.FuncOf(GetID))15}16func main() {17 js.Global().Set("getid", js.FuncOf(GetID))18}19func main() {20 js.Global().Set("getid", js.FuncOf(GetID))21}22func main() {23 js.Global().Set("getid", js.FuncOf(GetID))24}25func main() {26 js.Global().Set("getid", js.FuncOf(GetID))27}28func main() {29 js.Global().Set("getid", js.FuncOf(GetID))30}31func main() {32 js.Global().Set("getid", js.FuncOf(GetID))33}34func main() {35 js.Global().Set("getid", js.FuncOf(GetID))36}37func main() {38 js.Global().Set("getid", js.FuncOf(GetID))39}40func main() {

Full Screen

Full Screen

GetID

Using AI Code Generation

copy

Full Screen

1import (2func main() {3 js.Global.Set("GetID", func() int {4 })5 fmt.Println("Hello, playground")6 fmt.Println(js.Global.Call("GetID").Int())7}

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run K6 automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Most used method in

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful