{"id":2668,"date":"2011-02-14T16:25:47","date_gmt":"2011-02-15T00:25:47","guid":{"rendered":"http:\/\/www.sapien.com\/blog\/?p=2668"},"modified":"2011-02-14T16:35:54","modified_gmt":"2011-02-15T00:35:54","slug":"feature-peek-2011-primalforms-form-templates","status":"publish","type":"post","link":"https:\/\/dev.sapien.com\/blog\/2011\/02\/14\/feature-peek-2011-primalforms-form-templates\/","title":{"rendered":"Feature Peek 2011: PrimalForms &#8211; Form Templates"},"content":{"rendered":"<p>PrimalForms 2011 will ship with a number of predefined templates that will make things easier for you when creating a GUI for PowerShell.<\/p>\n<p><a href=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2011\/02\/Select-Form-Template.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;\" title=\"Select Form Template\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2011\/02\/Select-Form-Template_thumb.png\" border=\"0\" alt=\"Select Form Template\" width=\"244\" height=\"150\" \/><\/a><\/p>\n<p><span style=\"font-size: x-small;\">(Fig 1: When you create a new form, a list of templates will appear.)<\/span><\/p>\n<p><span style=\"font-size: x-small;\">\u00a0<\/span><\/p>\n<p>We know some of you will want to create your own reusable templates, so we implemented\u00a0 any easy way for you to convert your forms:<\/p>\n<p><a href=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2011\/02\/Create-Template-Menu-Option.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;\" title=\"Create Template Menu Option\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2011\/02\/Create-Template-Menu-Option_thumb.png\" border=\"0\" alt=\"Create Template Menu Option\" width=\"244\" height=\"150\" \/><\/a><\/p>\n<p><span style=\"font-size: x-small;\">(Fig 2: Create Form Template Menu Option)<\/span><\/p>\n<p>I want to the option to search the my exported database queries, but the default query form doesn\u2019t support the functionality. So I start by creating a Form with the \u201cGrid Template\u201d and I add a text box and button labeled \u201cSearch\u201d. I create a function to handle the search using the text from the text box. This function will be called when the \u201cSearch\u201d button is pressed.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;\" title=\"Seach Function\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2011\/02\/Seach-Function.png\" border=\"0\" alt=\"Seach Function\" width=\"387\" height=\"134\" \/><\/p>\n<p>Next I add a special token, so that I can determine where the Grid Query Function will be called and placed. In this case, I want the query function to be called when I press the \u201cQuery\u201d button.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;\" title=\"Query Function Token\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2011\/02\/Query-Function-Token.png\" border=\"0\" alt=\"Query Function Token\" width=\"349\" height=\"87\" \/><\/p>\n<p>Once I am satisfied with my form, I press the \u201cCreate Form Template\u201d button and the following dialog appears:<\/p>\n<p><a href=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2011\/02\/Create-Form-Template-Dialog.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;\" title=\"Create Form Template Dialog\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2011\/02\/Create-Form-Template-Dialog_thumb.png\" border=\"0\" alt=\"Create Form Template Dialog\" width=\"244\" height=\"135\" \/><\/a><\/p>\n<p><span style=\"font-size: x-small;\">(Fig 3:\u00a0 Create Form Template Dialog with Thumbnail of Form Template)<\/span><\/p>\n<p>A thumbnail of the form is displayed along with a few required fields. I name my template and select \u201cGrid Template\u201d as the type. I need to select the \u201cGrid Template\u201d type so that my new template is used for exporting for WMI and Database Query Forms. Otherwise if I select \u201cForm Template\u201d it will be used as a template for normal Forms. Next I provide a short description of the template which will be displayed with the template. Finally I press the \u201cSave\u201d button and I\u2019m done.<\/p>\n<p>Next time I export a Query Form, the new template will appear as an option.<\/p>\n<p><a href=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2011\/02\/Select-New-Template.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;\" title=\"Select New Template\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2011\/02\/Select-New-Template_thumb.png\" border=\"0\" alt=\"Select New Template\" width=\"244\" height=\"124\" \/><\/a><\/p>\n<p><span style=\"font-size: x-small;\">(Fig 4: New Template is displayed when Exporting a Query Form)<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>PrimalForms 2011 will ship with a number of predefined templates that will make things easier for you when creating a GUI for PowerShell. (Fig 1: When you create a new form, a list of templates will appear.) \u00a0 We know some of you will want to create your own reusable templates, so we implemented\u00a0 any [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[582,575,21,25],"tags":[564,313,28,314,81],"class_list":["post-2668","post","type-post","status-publish","format-standard","hentry","category-feature-peek","category-primalforms-2011-software-news","category-software-news","category-windows-powershell","tag-564","tag-forms","tag-powershell","tag-primalforms","tag-templates"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/2668","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/comments?post=2668"}],"version-history":[{"count":3,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/2668\/revisions"}],"predecessor-version":[{"id":2671,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/2668\/revisions\/2671"}],"wp:attachment":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/media?parent=2668"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/categories?post=2668"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/tags?post=2668"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}