{"id":25249,"date":"2018-07-03T09:39:07","date_gmt":"2018-07-03T07:39:07","guid":{"rendered":"http:\/\/help.qualiware.it\/qw-help\/?p=25249"},"modified":"2018-07-03T09:39:40","modified_gmt":"2018-07-03T07:39:40","slug":"collegamento-di-una-lista-di-ricerca-ad-un-pulsante-aggiunto-alla-maschera","status":"publish","type":"post","link":"https:\/\/help.qualiware.it\/qw-help\/collegamento-di-una-lista-di-ricerca-ad-un-pulsante-aggiunto-alla-maschera\/","title":{"rendered":"Collegamento di una lista di ricerca ad un pulsante aggiunto alla maschera"},"content":{"rendered":"<p>&nbsp;<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">' il seguente frammento di codice \u00e8 un esempio di collegamento di una lista di ricerca ad un pulsante aggiunto alla maschera\r\n' Da notare l'utilizzo di una veriabile di sessione per memorizzare la query di ricerca, che deve persistere fra i vari postback\r\ndim QWSess as QWSession=this.page.GetSession()\r\nDim form As gemanoco2 = this.page\r\nDim c as QWWebControls.QWWebPushbutton = CType(this.page, QWWebControls.QWWebPage).FindControl2(\"CUSTOM_2\")\r\ndim q as QWTable\r\n\r\n\r\n' Ridefinisce l'handler del Click per lanciare la query in ListaArchivio\r\nAddHandler c.Click,\r\nSub(sender As Object, arg As String)\r\n   dim campi as assocarray\r\n   dim anno as string\r\n   campi= new assocarray()\r\n   q = new qwtable\r\n   dim err,sql as string\r\n\r\n   sql=\"select MATRICOLA,cast(MACCHINA as varchar(255)) as MACCHINA,cast(VERSIONE as varchar(255)) as VERSIONE,COMMESSA from mepMATRICOLE\" \r\n     q.Database = QWSess.DB\r\n     q.SQL = sql\r\n     q.RequestLive = False\r\n     q.active = True\r\n     q.Rowset.first()\r\n   ' Mette la datatable in una variabile di sessione per passarlo alla procedura seguente\r\n   this.page.session(\"q\") = q\r\n   \r\n   ListaArchivio(this,\"Matricole\",this.page.session(\"q\"),New DBArray(New DBArray(this.page.session(\"q\").Rowset.Fields(\"MATRICOLA\"), 50,\"Matricola\"), _\r\n                  New DBArray(this.page.session(\"q\").Rowset.Fields(\"MACCHINA\"), 50,\"Macchina\"), _\r\n         New DBArray(this.page.session(\"q\").Rowset.Fields(\"VERSIONE\"), 50,\"Versione\"), _\r\n         New DBArray(this.page.session(\"q\").Rowset.Fields(\"COMMESSA\"), 50,\"Commessa\") _\r\n         ), 558, 292, 20, True)   \r\n End Sub\r\n\r\n\r\naddhandler ctype(this,QWWebControls.QWWebPushButton).DialogClose, sub (sender as object, arg as string)\r\n\u2018 Recupera il valore selezionato e lo assegna al campo CUSTOM1 \r\n  CType(form.FindControl(\"CUSTOM_1\"), qwWebControls.QWWebEntryfield).value = this.page.session(\"q\").Rowset.Fields(\"MATRICOLA\").value \r\n    this.page.session(\"q\").active = False\r\n   this.page.Session.Remove(\"q\")\r\nend sub\r\n\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; &#8216; il seguente frammento di codice \u00e8 un esempio di collegamento di una lista di ricerca ad un pulsante aggiunto alla maschera &#8216; Da notare l&#8217;utilizzo di una veriabile di sessione per memorizzare la query di ricerca, che deve persistere fra i vari postback dim QWSess as QWSession=this.page.GetSession() Dim form As gemanoco2 = this.page&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"ngg_post_thumbnail":0,"footnotes":""},"categories":[65],"tags":[78],"acf":[],"_links":{"self":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts\/25249"}],"collection":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/comments?post=25249"}],"version-history":[{"count":0,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts\/25249\/revisions"}],"wp:attachment":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/media?parent=25249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/categories?post=25249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/tags?post=25249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}