{"id":1610,"date":"2016-01-18T14:38:17","date_gmt":"2016-01-18T13:38:17","guid":{"rendered":"http:\/\/www.capri-soft.de\/blog\/?p=1610"},"modified":"2018-12-03T14:15:45","modified_gmt":"2018-12-03T13:15:45","slug":"ibm-doors-dxl-listview-callback-functions-event-listeners-on-checkboxes-selections-deselections-and-click","status":"publish","type":"post","link":"https:\/\/www.capri-soft.de\/blog\/?p=1610","title":{"rendered":"IBM Doors DXL: ListView : Callback functions, event listeners on checkboxes, selections, deselections and click"},"content":{"rendered":"<h1>Problem<\/h1>\n<p>There are lots of event to react on listView events, but they are not clearly defined in the language reference or the DXL Manual. <\/p>\n<h1>Approach<\/h1>\n<p>This will show the most common events working with listView DBE elements.<\/p>\n<h1>Solution<\/h1>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nvoid doSelect(DBE dbe, int idx)\r\n{\r\n\/\/ Auswahl mit Einfachklick\r\n} \r\n\r\nvoid doDeselect(DBE dbe, int idx)\r\n{\r\n\/\/ Element verliert selektion (evtl. durch anderes)\r\n} \r\n\r\nvoid doActivate(DBE dbe, int idx)\r\n{\r\n\/\/ Doppelklick \/ double click\r\n} \r\n\r\nvoid checkBoxReact(DBE lv, int i)\r\n{\r\n    string s = get(lv, i)\r\n    bool b = getCheck(lv, i)\r\n    if ( b ) \r\n    {\r\n\t   int j=0;\r\n\t   for(j=0;j&lt;noElems(lv);j++)\r\n\t   {\r\n\t\t   if(i!=j)\r\n\t\t   {\r\n\t\t\t   setCheck(lv,j,false);\r\n\t\t   }\r\n\t   }\r\n       \/\/infoBox(s &quot; was selected&quot;)\r\n    }\r\n    else\r\n    {\r\n       \/\/infoBox(s &quot; was deselected&quot;)\r\n    }\r\n}\r\n<\/pre>\n<p>And this is how the ListView has been declared:<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nDB mainDialog=create(&quot;Select Baseline to compare&quot;);\r\n\t\r\nDBE listViewBaselines = listView(mainDialog, listViewOptionCheckboxes,360,10,baselineEntries);\r\n\r\n\/\/ The first callback fires when an option is selected (a single click); \r\n\/\/ the second fires when an option is deselected (a side effect of a single click on another item); \r\n\/\/ the third fires when an item is activated (a double click).\r\nset(listViewBaselines,doSelect,doDeselect,doActivate);\r\nset(listViewBaselines, checkBoxReact);\r\n\t\r\nDBE publishButton=apply(mainDialog, &quot;Compare&quot;, compareButtonCallBack);\r\n\t\r\nrealize mainDialog;\r\n\t\r\ninsertColumn(listViewBaselines, 0, &quot;Baseline&quot;, 80, iconNone);\r\ninsertColumn(listViewBaselines, 1, &quot;Description&quot;, 140, iconNone);\r\ninsertColumn(listViewBaselines, 2, &quot;Increment&quot;, 140, iconNone);\r\n\r\nshow mainDialog;\r\n<\/pre>\n<iframe src=\"http:\/\/www.facebook.com\/plugins\/like.php?href=https%3A%2F%2Fwww.capri-soft.de%2Fblog%2F%3Fp%3D1610&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light\" scrolling=\"no\" frameborder=\"0\" allowTransparency=\"true\" style=\"border:none; overflow:hidden; width:450px;margin-top:5px;\"><\/iframe>","protected":false},"excerpt":{"rendered":"<p>Problem There are lots of event to react on listView events, but they are not clearly defined in the language reference or the DXL Manual. Approach This will show the most common events working with listView DBE elements. Solution void doSelect(DBE dbe, int idx) { \/\/ Auswahl mit Einfachklick } void doDeselect(DBE dbe, int idx) &hellip; <a href=\"https:\/\/www.capri-soft.de\/blog\/?p=1610\" class=\"more-link\"><span class=\"screen-reader-text\">IBM Doors DXL: ListView : Callback functions, event listeners on checkboxes, selections, deselections and click<\/span> weiterlesen <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"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,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[22,19],"tags":[],"class_list":["post-1610","post","type-post","status-publish","format-standard","hentry","category-dxl","category-ibm-doors"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4yGeN-pY","jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1610","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1610"}],"version-history":[{"count":7,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1610\/revisions"}],"predecessor-version":[{"id":2793,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1610\/revisions\/2793"}],"wp:attachment":[{"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1610"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.capri-soft.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}