Congratulations!

[Valid Atom 1.0] This is a valid Atom 1.0 feed.

Recommendations

This feed is valid, but interoperability with the widest range of feed readers could be improved by implementing the following recommendations.

Source: http://feeds.feedburner.com/dontpanic82

  1. <?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3745504982837212509</id><updated>2024-02-19T18:14:39.861+01:00</updated><category term="random tip"/><category term="xpages"/><category term="sntt"/><category term="Lotus Notes"/><category term="web"/><category term="random nonsense"/><category term="domino"/><category term="fgoto"/><category term="lotusscript"/><category term="code snippet"/><category term="JavaScript"/><category term="proof-of-concept"/><category term="templating"/><category term="java"/><category term="formula"/><category term="bugs"/><category term="Microsoft Web Browser"/><category term="XPages API Inspector"/><category term="custom control"/><category term="CSS"/><category term="Validation"/><category term="ckeditor"/><category term="event handling"/><category term="lotusphere 2009"/><category term="client"/><category term="rant"/><category term="server side event delegation"/><category term="ssjs"/><category term="JavaScript in Lotus Notes"/><category term="NotesFX"/><category term="benchmark"/><category term="debugging"/><category term="dhtml"/><category term="ideajam"/><category term="show&#39;n-tell-thursday"/><category term="64k"/><category term="agent"/><category term="bugfix"/><category term="development tools"/><category term="domino designer"/><category term="limit"/><category term="print"/><category term="question"/><category term="search"/><category term="tool"/><category term="transform"/><category term="xml"/><category term="xsl"/><category term="$$ReturnGeneralError"/><category term="Compendia AS"/><category term="DomSQL"/><category term="Domino 8.5"/><category term="FieldListener"/><category term="Show-n-Tell Thursday"/><category term="XPiNC"/><category term="accessibility"/><category term="announcement"/><category term="aptana"/><category term="avatar"/><category term="beans"/><category term="book recommendation"/><category term="cheat sheet"/><category term="checkboxes"/><category term="chrome"/><category term="dde"/><category term="design definition"/><category term="dojo"/><category term="favorite applications"/><category term="gimp"/><category term="ideas"/><category term="iframe"/><category term="integration"/><category term="jsf"/><category term="json"/><category term="layout"/><category term="limits"/><category term="lotusphere"/><category term="ls2j"/><category term="mac"/><category term="microsoft"/><category term="mootools"/><category term="office"/><category term="outlook"/><category term="pager"/><category term="partial refresh"/><category term="patch"/><category term="preview"/><category term="randomt tip"/><category term="regexp"/><category term="request"/><category term="safari"/><category term="script library"/><category term="server side javascript"/><category term="simpsons"/><category term="software"/><category term="statistics"/><category term="themes"/><category term="updates"/><title type='text'>DontPanic - a blog about Lotus Notes / Domino</title><subtitle type='html'>My useful and useless experiments with Lotus Notes / Domino</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dontpanic82.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://dontpanic82.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Tommy Valand</name><uri>http://www.blogger.com/profile/11052104644034054473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>342</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3745504982837212509.post-2690809790097008413</id><published>2015-10-07T08:43:00.002+01:00</published><updated>2015-10-07T08:43:28.317+01:00</updated><title type='text'>Useful shortcut for editing XPages source code - Ctrl+1</title><content type='html'>&lt;h1&gt;Rename tag&lt;/h1&gt;
  2. &lt;p&gt;Click inside a tag:&lt;/p&gt;
  3. &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6jx8XUs1Eyk5CKgZoKCwhE6N9a8_ZqHENgfun39JZFXVMa7czpaPzlYpAUMvVrWEBmoyyMFLCxaON1JmVldtzlOrHLoFl11xeCBAKc9tVGx3f0ZF5DosD2aAzdyplhLIsAEmjlM4t8iG_/s1600/before_rename.png&quot; imageanchor=&quot;1&quot; &gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6jx8XUs1Eyk5CKgZoKCwhE6N9a8_ZqHENgfun39JZFXVMa7czpaPzlYpAUMvVrWEBmoyyMFLCxaON1JmVldtzlOrHLoFl11xeCBAKc9tVGx3f0ZF5DosD2aAzdyplhLIsAEmjlM4t8iG_/s320/before_rename.png&quot; /&gt;&lt;/a&gt;
  4. &lt;p&gt;Press Ctrl+1:&lt;/p&gt;
  5. &lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihxNEtURMJU_4K2AT65bqxt0Af1zKqKC0ruoGO59RWuwCwwqolx_lANxT7zEMBk0VerIcOtjbupQ-puNDFiNQKuFIU4V98yK94KCR52nUOq9Ksw9fDMlR1v3nsz0t1nspsmNs3Xb3Bbh6a/s1600/ctrl_1.png&quot; /&gt;
  6. &lt;p&gt;Select rename in file, type the new tag name:&lt;/p&gt;
  7. &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEht-cux_6ik9NNsDiJPH1gWrY09jjngiHst4NN38Di5KmyMqDqub543YNIyTVXc2zGKPdm9yrEWccASGV-Hazw0Ati-ELysHy6AXgQGPCZeq-xMw3rMXbqV3nrS1PCesw4p3554SvVhYYH9/s1600/after_rename.png&quot; imageanchor=&quot;1&quot; &gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEht-cux_6ik9NNsDiJPH1gWrY09jjngiHst4NN38Di5KmyMqDqub543YNIyTVXc2zGKPdm9yrEWccASGV-Hazw0Ati-ELysHy6AXgQGPCZeq-xMw3rMXbqV3nrS1PCesw4p3554SvVhYYH9/s320/after_rename.png&quot; /&gt;&lt;/a&gt;
  8.  
  9. &lt;h1&gt;Surround with new element&lt;/h1&gt;
  10. &lt;p&gt;Click where you want to wrap with another tag (inside a tag, or at the beginning of some text). Press Ctrl+1:&lt;/p&gt;
  11. &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSPhSY1QKnCDeRBri0144gqIYgg73JDWqakRZpTkPII7_qlLg6oO-MOTPtrR2_g5tYDeZc9LYDBK5WklutJJYu2ZdzKsst2FnAPMaGwWtWB16ymwAe0FoZmK2ey0B6yAGKeRe0JFAcFQO5/s1600/ctrl_1_new_element.png&quot; imageanchor=&quot;1&quot; &gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSPhSY1QKnCDeRBri0144gqIYgg73JDWqakRZpTkPII7_qlLg6oO-MOTPtrR2_g5tYDeZc9LYDBK5WklutJJYu2ZdzKsst2FnAPMaGwWtWB16ymwAe0FoZmK2ey0B6yAGKeRe0JFAcFQO5/s320/ctrl_1_new_element.png&quot; /&gt;&lt;/a&gt;
  12. &lt;p&gt;Type the name of the new tag:&lt;/p&gt;
  13. &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsuEaWlN_mF_lC1DIFWz5sijRMAnWFcFrbVLkD9EmVWzEbWtWCUDwOhb0bQoTEkdGq1pHg50CRq0m08USYvYwojeDuESMHGDO017ibJWoIPrs9iPz6zk_yNfo-Atop8SqgeiDcCK7RvDjZ/s1600/new_element.png&quot; imageanchor=&quot;1&quot; &gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsuEaWlN_mF_lC1DIFWz5sijRMAnWFcFrbVLkD9EmVWzEbWtWCUDwOhb0bQoTEkdGq1pHg50CRq0m08USYvYwojeDuESMHGDO017ibJWoIPrs9iPz6zk_yNfo-Atop8SqgeiDcCK7RvDjZ/s320/new_element.png&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://dontpanic82.blogspot.com/feeds/2690809790097008413/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3745504982837212509&amp;postID=2690809790097008413' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/2690809790097008413'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/2690809790097008413'/><link rel='alternate' type='text/html' href='http://dontpanic82.blogspot.com/2015/10/useful-shortcut-for-editing-xpages.html' title='Useful shortcut for editing XPages source code - Ctrl+1'/><author><name>Tommy Valand</name><uri>http://www.blogger.com/profile/11052104644034054473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6jx8XUs1Eyk5CKgZoKCwhE6N9a8_ZqHENgfun39JZFXVMa7czpaPzlYpAUMvVrWEBmoyyMFLCxaON1JmVldtzlOrHLoFl11xeCBAKc9tVGx3f0ZF5DosD2aAzdyplhLIsAEmjlM4t8iG_/s72-c/before_rename.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3745504982837212509.post-516192502120835429</id><published>2014-01-28T09:30:00.000+01:00</published><updated>2014-01-28T09:30:15.528+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DomSQL"/><category scheme="http://www.blogger.com/atom/ns#" term="random tip"/><title type='text'>Dynamically pointing DomSQL to current database</title><content type='html'>I couldn&#39;t find a way to specify current database in the .jdbc file, so I dug around in the API.&lt;br /&gt;
  14. &lt;br /&gt;
  15. When creating the connection to a DomSQL database, you can do it with getConnection and the name of a .jdbc config file:
  16. &lt;br /&gt;
  17. &lt;pre&gt;&lt;code&gt;public static Connection getConnection() throws SQLException {
  18.    return JdbcUtil.getConnection( FacesContext.getCurrentInstance(), &quot;nameOf.jdbc&quot; );
  19. }&lt;/code&gt;&lt;/pre&gt;
  20. &lt;br /&gt;
  21. Or use createConnection and specify the path for the connection:
  22. &lt;br /&gt;
  23. &lt;pre&gt;&lt;code&gt;public static Connection getConnection() throws SQLException {
  24.    String dbPath = null;
  25.    try {
  26.        dbPath = ExtLibUtil.getCurrentDatabase().getFilePath().replaceAll( &quot;\\\\&quot;, &quot;/&quot; );
  27.    } catch( NotesException exception ){
  28.        // Ignore
  29.    }
  30.  
  31.    return JdbcUtil.createConnectionFromUrl( FacesContext.getCurrentInstance(), &quot;jdbc:domsql:&quot; + dbPath + &quot;/nameOf.domsql&quot; );
  32. }
  33. &lt;/code&gt;&lt;/pre&gt;
  34. &lt;br /&gt;
  35. &lt;br /&gt;
  36. If you haven&#39;t heard of DomSQL: &lt;a href=&quot;http://www.openntf.org/main.nsf/project.xsp?r=project/JDBC%20Access%20for%20IBM%20Lotus%20Domino&quot;&gt;JDBC Access for IBM Domino&lt;/a&gt;
  37. </content><link rel='replies' type='application/atom+xml' href='http://dontpanic82.blogspot.com/feeds/516192502120835429/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3745504982837212509&amp;postID=516192502120835429' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/516192502120835429'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/516192502120835429'/><link rel='alternate' type='text/html' href='http://dontpanic82.blogspot.com/2014/01/dynamically-pointing-domsql-to-current.html' title='Dynamically pointing DomSQL to current database'/><author><name>Tommy Valand</name><uri>http://www.blogger.com/profile/11052104644034054473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3745504982837212509.post-1083619319403891182</id><published>2014-01-27T11:16:00.001+01:00</published><updated>2014-01-27T11:17:07.830+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="random tip"/><title type='text'>HTML5, script tags and partial refresh inside target area</title><content type='html'>I had some issues with a script tag not loading inside a panel. The panel was set to only be visible when a view scope variable was set.&lt;br /&gt;
  38. &lt;br /&gt;
  39. It turns out that this is by design for HTML5.&lt;br /&gt;
  40. &lt;br /&gt;
  41. When script tags are inserted into a document using Ajax/innerHTML, the spec states that the script tag should not execute.&lt;br /&gt;
  42. &lt;br /&gt;
  43. &lt;a href=&quot;http://www.w3.org/TR/2008/WD-html5-20080610/dom.html#innerhtml0&quot;&gt;HTML5 spec&lt;/a&gt;&lt;br /&gt;
  44. &lt;em&gt;&quot;...script elements inserted using innerHTML do not execute when they are inserted...&quot;&lt;/em&gt;
  45. &lt;br /&gt;
  46. &lt;br /&gt;
  47. My workaround for this was to set &lt;strong&gt;full refresh&lt;/strong&gt;&amp;nbsp;for the event that refreshed the panel.</content><link rel='replies' type='application/atom+xml' href='http://dontpanic82.blogspot.com/feeds/1083619319403891182/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3745504982837212509&amp;postID=1083619319403891182' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/1083619319403891182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/1083619319403891182'/><link rel='alternate' type='text/html' href='http://dontpanic82.blogspot.com/2014/01/html5-script-tags-and-partial-refresh.html' title='HTML5, script tags and partial refresh inside target area'/><author><name>Tommy Valand</name><uri>http://www.blogger.com/profile/11052104644034054473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3745504982837212509.post-3097224791879239489</id><published>2013-10-08T09:00:00.000+01:00</published><updated>2013-10-08T09:03:11.356+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="code snippet"/><category scheme="http://www.blogger.com/atom/ns#" term="xpages"/><title type='text'>Configuring input field for DateTime picker with localized date/time format</title><content type='html'>In a new application a colleague of mine is working on, he wanted to let the user set date and time with Norwegian date and time format.&lt;br /&gt;
  48. &lt;br /&gt;
  49. One would think it should be pretty straightforward, but it took me around three hours to figure out how to do it. I accidentally discovered the way to do it while making a custom control with one field for date and one field for time. The custom control was meant to combine the two values into a date/time value. Luckily there&#39;s a simpler solution.&lt;br /&gt;
  50. &lt;br /&gt;
  51. Source for Norwegian Date/Time picker:&lt;br /&gt;
  52. &lt;pre&gt;&lt;code&gt;&amp;lt;xp:inputText id=&quot;dateTimePicker&quot; value=&quot;#{document.date_time}&quot;&amp;gt;
  53. &amp;lt;xp:this.converter&amp;gt;
  54.  &amp;lt;xp:convertDateTime pattern=&quot;dd.MM.yyyy HH:mm&quot; type=&quot;both&quot; /&amp;gt;
  55. &amp;lt;/xp:this.converter&amp;gt;
  56. &amp;lt;xp:dateTimeHelper&amp;gt;
  57.  &amp;lt;xp:this.dojoAttributes&amp;gt;
  58.   &amp;lt;xp:dojoAttribute name=&quot;constraints&quot; value=&quot;{ datePattern : &#39;dd.MM.yyyy&#39;, locale: &#39;no&#39;, timePattern: &#39;HH:mm&#39; }&quot; /&amp;gt;
  59.  &amp;lt;/xp:this.dojoAttributes&amp;gt;
  60. &amp;lt;/xp:dateTimeHelper&amp;gt;
  61. &amp;lt;/xp:inputText&amp;gt;
  62. &lt;/code&gt;&lt;/pre&gt;
  63. &lt;br /&gt;
  64. I tested/this should work on Domino 8.5.3 and Domino 9.
  65. &lt;br /&gt;
  66. &lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://dontpanic82.blogspot.com/feeds/3097224791879239489/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3745504982837212509&amp;postID=3097224791879239489' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/3097224791879239489'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/3097224791879239489'/><link rel='alternate' type='text/html' href='http://dontpanic82.blogspot.com/2013/10/configuring-input-field-for-datetime.html' title='Configuring input field for DateTime picker with localized date/time format'/><author><name>Tommy Valand</name><uri>http://www.blogger.com/profile/11052104644034054473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3745504982837212509.post-2933315095630011834</id><published>2013-09-23T09:49:00.000+01:00</published><updated>2014-03-14T08:35:28.198+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="random tip"/><category scheme="http://www.blogger.com/atom/ns#" term="xpages"/><title type='text'>Simple workaround for partial refresh issues with radio buttons</title><content type='html'>&lt;b&gt;Update, 14.03.14:&lt;/b&gt;&amp;nbsp;I had some issues with this technique when used inside a ExtLib dialog. I suspect this has something to do with the dialog having it&#39;s own form. To make it work inside the dialog, I added a parameter for the execId. If I remember correctly, execId specifies the part of the XPages tree that should be processed. It can be the same as the target of the refresh.&lt;br /&gt;
  67. &lt;br /&gt;
  68. Example of use with execId:&lt;br /&gt;
  69. &lt;pre&gt;&lt;code&gt;XSP.partialRefreshPost( &#39;#{id:targetOfRefresh}&#39;, { execId: &#39;#{id:targetThatShouldBeProcessed}&#39; } );&lt;/code&gt;&lt;/pre&gt;
  70. &lt;br /&gt;
  71. I had some issues getting partial refresh triggered by radio buttons to work as I wanted to across browsers. I found a simple workaround. Instead of specifying the partial refresh in the event handler, I set no submission for the server side part, and execute a slightly delayed XSP.partialRefreshPost from the client side event action:&lt;br /&gt;
  72. &lt;pre&gt;&lt;code&gt;&amp;lt;xp:radioGroup id=&quot;someId&quot; value=&quot;#{document.someField}&quot; defaultValue=&quot;yes&quot;&amp;gt;
  73. &amp;lt;xp:eventHandler event=&quot;onclick&quot; submit=&quot;false&quot;&amp;gt;
  74.   &amp;lt;xp:this.script&amp;gt;&amp;lt;![CDATA[setTimeout( function(){
  75. XSP.partialRefreshPost( &#39;#{id:targetOfRefresh}&#39; );
  76. }, 50 );]]&amp;gt;&amp;lt;/xp:this.script&amp;gt;
  77. &amp;lt;/xp:eventHandler&amp;gt;
  78. &amp;lt;xp:selectItem itemValue=&quot;yes&quot; itemLabel=&quot;Yes&quot; /&amp;gt;
  79. &amp;lt;xp:selectItem itemValue=&quot;no&quot; itemLabel=&quot;No&quot; /&amp;gt;
  80. &amp;lt;/xp:radioGroup&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  81. &lt;br /&gt;
  82. This seems to work nicely across the browsers I tested in, regardless of triggering the value change through the radio button or the label.</content><link rel='replies' type='application/atom+xml' href='http://dontpanic82.blogspot.com/feeds/2933315095630011834/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3745504982837212509&amp;postID=2933315095630011834' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/2933315095630011834'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/2933315095630011834'/><link rel='alternate' type='text/html' href='http://dontpanic82.blogspot.com/2013/09/simple-workaround-for-partial-refresh.html' title='Simple workaround for partial refresh issues with radio buttons'/><author><name>Tommy Valand</name><uri>http://www.blogger.com/profile/11052104644034054473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3745504982837212509.post-6762022939914352728</id><published>2013-09-19T13:09:00.003+01:00</published><updated>2013-09-19T13:15:55.990+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="xpages"/><title type='text'>Strange implementation of Document.setPreferJavaDates( true )</title><content type='html'>I wanted to try the Document.setPreferJavaDates today and see how it worked.&lt;br /&gt;
  83. &lt;br /&gt;
  84. I called &lt;b&gt;Document.setPreferJavaDates( true );&lt;/b&gt; to ensure that no (Notes)DateTime objects were created as I didn&#39;t need them/didn&#39;t want to deal with recycling.&lt;br /&gt;
  85. &lt;br /&gt;
  86. First I tried:&lt;br /&gt;
  87. &lt;b&gt;Document.getItemValueDateTimeArray( &quot;fieldname&quot; );&lt;/b&gt;&lt;br /&gt;
  88. This returned a Vector of DateTime.&lt;br /&gt;
  89. &lt;br /&gt;
  90. Then I tried:&lt;br /&gt;
  91. &lt;b&gt;Document.getItemValue( &quot;fieldname&quot; );&lt;/b&gt;&lt;br /&gt;
  92. This also returned a Vector of DateTime.&lt;br /&gt;
  93. &lt;br /&gt;
  94. The way that finally worked as expected (returned a Vector of java.util.Date) was this:&lt;br /&gt;
  95. &lt;b&gt;Document.firstItem( &quot;fieldname&quot; ).getValues();&lt;/b&gt;&lt;br /&gt;
  96. &lt;b&gt;&lt;br /&gt;&lt;/b&gt;
  97. I would imagine this is the least used method among developers wanting to get a date value from a field. This code was executed on a server running &lt;b&gt;Domino 8.5.3FP2&lt;/b&gt;</content><link rel='replies' type='application/atom+xml' href='http://dontpanic82.blogspot.com/feeds/6762022939914352728/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3745504982837212509&amp;postID=6762022939914352728' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/6762022939914352728'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/6762022939914352728'/><link rel='alternate' type='text/html' href='http://dontpanic82.blogspot.com/2013/09/strange-implementation-of.html' title='Strange implementation of Document.setPreferJavaDates( true )'/><author><name>Tommy Valand</name><uri>http://www.blogger.com/profile/11052104644034054473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3745504982837212509.post-361704939910725144</id><published>2013-07-03T13:53:00.000+01:00</published><updated>2014-03-03T09:17:00.343+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="chrome"/><category scheme="http://www.blogger.com/atom/ns#" term="code snippet"/><category scheme="http://www.blogger.com/atom/ns#" term="iframe"/><category scheme="http://www.blogger.com/atom/ns#" term="safari"/><category scheme="http://www.blogger.com/atom/ns#" term="xpages"/><title type='text'>Workaround for issues with XPage in iframe on external website</title><content type='html'>&lt;b&gt;Update, 03.03.14: We had some further issues with Chrome and form submission. Code snippet updated with workaround.&lt;/b&gt;&lt;br /&gt;
  98. &lt;br /&gt;
  99. A colleague of mine had some issues with an XPage running in an iframe on a customer&#39;s website. The customer notified us that some users with Chrome/Safari had issues with the page going blank.&lt;br /&gt;
  100. &lt;br /&gt;
  101. When doing partial refresh, the page went into a reload loop. I did a quick check, and couldn&#39;t find anything wrong&amp;nbsp;with the code. I believe it has something to do with &lt;a href=&quot;http://stackoverflow.com/questions/6125741/iframe-cross-domain-cookies-p3p-policy-and-safari-with-error-a-required-anti&quot; target=&quot;_blank&quot;&gt;cross domain cookies&lt;/a&gt; and Webkit.&lt;br /&gt;
  102. &lt;br /&gt;
  103. My workaround was to have a script block that adds the SessionID parameter that was previously added in certain circumstances on earlier versions of XPages. The script block is only loaded for Chrome/Safari, and the code only runs when the XPage is in a frameset/iframe.&lt;br /&gt;
  104. &lt;br /&gt;
  105. &lt;pre&gt;&lt;code&gt;&amp;lt;xp:scriptBlock&amp;gt;
  106. &amp;lt;xp:this.loaded&amp;gt;&amp;lt;![CDATA[${javascript:return ( context.getUserAgent().isChrome() || context.getUserAgent().isSafari() );}]]&amp;gt;&amp;lt;/xp:this.loaded&amp;gt;
  107. &amp;lt;xp:this.value&amp;gt;&amp;lt;![CDATA[(function(){
  108. // Fix for safari/chrome when page is in iframe. Cookie with SessionID seems to be discarded between requests
  109. // Workaround: Set parameter for SessionID
  110. var queryString = document.location.search;
  111. var sessionIdParameter = &#39;SessionID=&#39; + &#39;#{javascript:return facesContext.getExternalContext().getRequest().getSession().getId();}&#39;;
  112. if( self !== parent &amp;amp;&amp;amp; queryString.indexOf( &#39;SessionID&#39; ) === -1 ){
  113. if( queryString === &#39;&#39; ){
  114.  document.location.search = sessionIdParameter;  
  115. } else {
  116.  document.location.search = queryString + &#39;&amp;amp;&#39; + sessionIdParameter;
  117. }
  118. }
  119.  
  120. // Add SessionID parameter to form action if set in URL to preserve session
  121. if( queryString.indexOf( &#39;SessionID&#39; ) !== -1 ){
  122. var form = document.forms[0];
  123. if( !form ){
  124.  return;
  125. }
  126. var formAction = form.action;
  127. var parameterDelimiter = &#39;&amp;amp;&#39;;
  128. if( formAction.indexOf( &#39;?&#39; ) === -1 ){
  129.  parameterDelimiter = &#39;?&#39;;
  130. }
  131. form.action = form.action + parameterDelimiter + sessionIdParameter;  
  132. }
  133. })();]]&amp;gt;&amp;lt;/xp:this.value&amp;gt;
  134. &amp;lt;/xp:scriptBlock&amp;gt;
  135. &lt;/code&gt;&lt;/pre&gt;
  136. </content><link rel='replies' type='application/atom+xml' href='http://dontpanic82.blogspot.com/feeds/361704939910725144/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3745504982837212509&amp;postID=361704939910725144' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/361704939910725144'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/361704939910725144'/><link rel='alternate' type='text/html' href='http://dontpanic82.blogspot.com/2013/07/workaround-for-issues-with-xpage-in.html' title='Workaround for issues with XPage in iframe on external website'/><author><name>Tommy Valand</name><uri>http://www.blogger.com/profile/11052104644034054473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3745504982837212509.post-5416911083413386287</id><published>2013-06-28T00:01:00.000+01:00</published><updated>2013-06-28T11:19:15.327+01:00</updated><title type='text'>Benchmark: Fetching NoteIDs and documents from view</title><content type='html'>&lt;strong&gt;Update 28.06.13:&amp;nbsp;&lt;/strong&gt;I added a test - using the new NoteCollection.getNoteIds that was introduced in Domino 9.&lt;br /&gt;
  137. &lt;br /&gt;
  138. In relation to an experiment I&#39;m working on, I wrote a Java test agent to find the fastest way to get note id&#39;s from a view/fetching document values from documents in a view.
  139. &lt;br /&gt;
  140. &lt;br /&gt;
  141. Here are the results from the benchmark:&lt;br /&gt;
  142. &lt;div&gt;
  143. &lt;br /&gt;
  144. &lt;div&gt;
  145. &lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhj3PZezLOw70ArfWpdcg2r8727yjwqzMQlyB8YpcSET8KXEq4v0oVhetRq2V3WxN8ocTxD35wwjmxcPXy88Hr8ffrV6XDyTqxh85ZlIFtoJG1NfbApTGjrKq-BYTPLOsEnJn88_LuSZN-1/s1600/benchmark_results290613.png&quot; /&gt;&lt;/div&gt;
  146. &lt;br /&gt;
  147. &lt;br /&gt;
  148. All numbers are milliseconds. The code was run on a desktop computer (Core 2 Duo/Windows XP).&lt;br /&gt;
  149. &lt;br /&gt;
  150. The benchmark code is written so that I think caching on the server is avoided between tests. What&#39;s interesting from the results is that it seems like it&#39;s marginally faster to fetch the note ids from the view/open the document by note id if you want to read values from the document.&lt;br /&gt;
  151. &lt;br /&gt;
  152. If you want to run the benchmark in your application, here&#39;s the source code:&lt;br /&gt;
  153. &lt;a href=&quot;http://files.dontpanic82.com/NoteIdDocumentBenchmarkSource.txt&quot; target=&quot;_blank&quot;&gt;&amp;gt;&amp;gt; Download&lt;/a&gt;&lt;/div&gt;
  154. &lt;br /&gt;
  155. The code is designed for running the test agent in a browser. Change the constants TEST_VIEW_NAME to the name of a view you want to test, and TEST_FIELD_NAME to a field name that the documents in the view have.&lt;br /&gt;
  156. &lt;br /&gt;
  157. If you run the benchmark/get different results, let me know :)</content><link rel='replies' type='application/atom+xml' href='http://dontpanic82.blogspot.com/feeds/5416911083413386287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3745504982837212509&amp;postID=5416911083413386287' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/5416911083413386287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/5416911083413386287'/><link rel='alternate' type='text/html' href='http://dontpanic82.blogspot.com/2013/06/benchmark-fetching-noteids-and.html' title='Benchmark: Fetching NoteIDs and documents from view'/><author><name>Tommy Valand</name><uri>http://www.blogger.com/profile/11052104644034054473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhj3PZezLOw70ArfWpdcg2r8727yjwqzMQlyB8YpcSET8KXEq4v0oVhetRq2V3WxN8ocTxD35wwjmxcPXy88Hr8ffrV6XDyTqxh85ZlIFtoJG1NfbApTGjrKq-BYTPLOsEnJn88_LuSZN-1/s72-c/benchmark_results290613.png" height="72" width="72"/><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3745504982837212509.post-766555800875529533</id><published>2013-05-21T09:53:00.001+01:00</published><updated>2013-05-21T09:53:31.804+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="checkboxes"/><category scheme="http://www.blogger.com/atom/ns#" term="layout"/><category scheme="http://www.blogger.com/atom/ns#" term="xpages"/><title type='text'>Custom Control for custom layout of checkboxes</title><content type='html'>&lt;div class=&quot;separator&quot;&gt;
  158. In a recent project, I wanted to create an interface to toggle different settings for different user types in an app. To save real estate on the page and (hopefully) make it more intuitive, I wanted to have a column per user type, and organize the checkboxes vertically.&lt;/div&gt;
  159. &lt;br /&gt;
  160. I couldn&#39;t find any way to do this out of the box. To make it work, I made a regular checkbox group per field. Then in a repeat control, I have regular HTML checkboxes with name fetched from the real checkbox group. The checkbox group has to have the same values as the HTML checkboxes, or the values will be discarded.&lt;br /&gt;
  161. &lt;br /&gt;
  162. The checkbox component is removed from the DOM via javascript when the page loads. If the real checkbox component isn&#39;t removed, you will only be able to select, and not deselect.&lt;br /&gt;
  163. &lt;br /&gt;
  164. Screenshot from the demoapp (each checkbox &lt;strong&gt;column&lt;/strong&gt; is bound to a &lt;strong&gt;multivalue field&lt;/strong&gt;):&lt;br /&gt;
  165. &lt;br /&gt;
  166. &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  167. &lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEip96ZBPK4MkyDEVaN8snyHB-RCRy0KXXjqIfk4QIYwedhZVaYQz6T2Le05R3DtuJDQXSB5bz6vPHv_GkvEY5kOcImeN4q0hzpI6M5zHzl2qu4nVVRGhHJcrKUdfQfgwEb3o41aq36ESP4j/s1600/screenshot1.png&quot; /&gt;&lt;/div&gt;
  168. &lt;br /&gt;
  169. &lt;div class=&quot;separator&quot;&gt;
  170. The custom control has four properties:&lt;/div&gt;
  171. &lt;ul&gt;
  172. &lt;li&gt;&lt;b&gt;checkboxValues: &lt;/b&gt;Array of strings - Values for the checkboxes&lt;/li&gt;
  173. &lt;li&gt;&lt;b&gt;fieldNames: &lt;/b&gt;Array of strings - Names of the fields in the form you want to connect the checkboxes to (remember to set them to multi-value in form)&lt;/li&gt;
  174. &lt;li&gt;&lt;b&gt;headerLabels: &lt;/b&gt;Array of strings - Header labels for the checkbox columns&lt;/li&gt;
  175. &lt;li&gt;&lt;b&gt;rowLabels: &lt;/b&gt;Array of strings - Labels for the checkbox rows&lt;/li&gt;
  176. &lt;/ul&gt;
  177. &lt;p&gt;Currently, the custom control uses currentDocument to bind the fields. If the control doesn&#39;t work, you might need to use a more specific document data source.&lt;/p&gt;
  178. &lt;b&gt;Example usage&lt;/b&gt;&lt;br /&gt;
  179. &lt;pre&gt;&lt;code&gt;&amp;lt;xc:CheckboxTable checkboxValues=&quot;#{javascript:return [&#39;inbox&#39;,&#39;outbox&#39;];}&quot;
  180.   fieldNames=&quot;#{javascript:return [&#39;hidden_items_administrators&#39;,&#39;hidden_items_users&#39;,&#39;hidden_items_limited_users&#39;];}&quot;
  181.   headerLabels=&quot;#{javascript:return [labels.administrators, labels.users, labels.limitedUsers];}&quot; rowLabels=&quot;#{javascript:return [labels.inbox,labels.outbox];}&quot; /&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  182. &lt;div class=&quot;separator&quot;&gt;
  183. The demoapp has been tested/works in these browsers: IE8/9 (should work in earlier browsers, but the layout is ugly), latest versions of Chrome, Firefox and Opera.
  184. &lt;/div&gt;
  185. &lt;p&gt;
  186. &lt;strong&gt;&lt;a href=&quot;http://files.dontpanic82.com/CheckBoxTableDemo.zip&quot; target=&quot;_blank&quot;&gt;&amp;gt;&amp;gt;&amp;nbsp;Download demoapp&lt;/a&gt;&lt;/strong&gt;
  187. &lt;/p&gt;
  188. &lt;p&gt;The technique I used (real+&quot;fake&quot; checkboxes) should enable you to customize the layout of checkboxes however you want. I imagine the technique should also work for radio buttons.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://dontpanic82.blogspot.com/feeds/766555800875529533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3745504982837212509&amp;postID=766555800875529533' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/766555800875529533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/766555800875529533'/><link rel='alternate' type='text/html' href='http://dontpanic82.blogspot.com/2013/05/custom-control-for-custom-layout-of.html' title='Custom Control for custom layout of checkboxes'/><author><name>Tommy Valand</name><uri>http://www.blogger.com/profile/11052104644034054473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEip96ZBPK4MkyDEVaN8snyHB-RCRy0KXXjqIfk4QIYwedhZVaYQz6T2Le05R3DtuJDQXSB5bz6vPHv_GkvEY5kOcImeN4q0hzpI6M5zHzl2qu4nVVRGhHJcrKUdfQfgwEb3o41aq36ESP4j/s72-c/screenshot1.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3745504982837212509.post-1847300796569778690</id><published>2013-03-20T09:00:00.000+01:00</published><updated>2013-03-20T10:21:52.295+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="code snippet"/><category scheme="http://www.blogger.com/atom/ns#" term="partial refresh"/><title type='text'>Fix for partial refresh on Dojo Tab Container/Content Pane</title><content type='html'>I wrote this a while back, but I couldn&#39;t find that I&#39;d shared it.
  189.  
  190. &lt;br /&gt;
  191. &lt;br /&gt;
  192. You need to use the &lt;a href=&quot;http://dontpanic82.blogspot.no/2010/01/xpages-hijackingpublishing-partial.html&quot;&gt;partial refresh hijacker&lt;/a&gt; to use the code snippet.
  193.  
  194. &lt;br /&gt;
  195. &lt;br /&gt;
  196. This code snippet initializes Dojo Tab Containers/Dojo Content Panes in the area that&#39;s refreshed:&lt;br /&gt;
  197. &lt;pre&gt;&lt;code&gt;// Fix problem with partial refresh on Dojo Tab Container/Content pane
  198. // Source for inspiration:
  199. // http://www.openntf.org/projects/pmt.nsf/0/D228115FAA98DDEC86257A7D0050E7FF
  200. dojo.subscribe( &#39;partialrefresh-complete&#39;, this, function( method, form, refreshId ) {
  201. var tabContainersAndContentPanes = dojo.query( &#39;[id=&#39; + refreshId + &#39;] .dijitTabContainer[widgetid], &#39; +
  202.  &#39;[id=&#39; + refreshId + &#39;] .dijitContentPane[widgetid]&#39; );
  203. if( tabContainersAndContentPanes.length === 0 ) {
  204.  return;
  205. }
  206. for( var i = 0; i &amp;lt; tabContainersAndContentPanes.length; i++ ) {
  207.  var widgetId = tabContainersAndContentPanes[i].getAttribute( &#39;widgetid&#39; );
  208.  var widget = dijit.byId( widgetId );
  209.  if( widget ) {
  210.   widget.startup();
  211.   widget.resize();
  212.  }
  213. }
  214. } );&lt;/code&gt;&lt;/pre&gt;
  215. &lt;br /&gt;
  216. Add the code snippet in a dojo.addOnLoad function or something similar.
  217. &lt;br /&gt;
  218. &lt;br /&gt;
  219. If you have other widget types that fails to initialize, just modify the selector/startup commands to fix.</content><link rel='replies' type='application/atom+xml' href='http://dontpanic82.blogspot.com/feeds/1847300796569778690/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3745504982837212509&amp;postID=1847300796569778690' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/1847300796569778690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/1847300796569778690'/><link rel='alternate' type='text/html' href='http://dontpanic82.blogspot.com/2013/03/fix-for-partial-refresh-on-dojo-tab.html' title='Fix for partial refresh on Dojo Tab Container/Content Pane'/><author><name>Tommy Valand</name><uri>http://www.blogger.com/profile/11052104644034054473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3745504982837212509.post-1585314383911476365</id><published>2013-01-18T10:05:00.000+01:00</published><updated>2013-01-18T10:05:09.858+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="code snippet"/><category scheme="http://www.blogger.com/atom/ns#" term="lotusscript"/><title type='text'>Small LS class that can be used to check if fields have changed</title><content type='html'>We&#39;ve had some issues with semaphore locks on one of our import databases. The import database has routines that import/update data, then replicate it to a cluster when it&#39;s done. &lt;br /&gt;
  220. &lt;br /&gt;
  221. We&#39;re not exactly sure what triggers the locks, but the server crashed sometimes several times a day, so we decided to see if the import routines could be optimized to do as few writes as possible.&lt;br /&gt;
  222. &lt;br /&gt;
  223. Several of the routines saved documents even if there were no field changes. I wrote a simple class to test for field value changes.&lt;br /&gt;
  224. &lt;pre&gt;&lt;code&gt;&#39;// Used to test if certain fields have changed
  225. Class FieldChangeChecker
  226. Private fieldsToCheck As Variant
  227. Private fieldValues List As Variant
  228. &#39;// Run this after calculcation/etc. to see if specified fields have changed
  229. Function haveFieldsChanged( doc As NotesDocument ) As Boolean
  230.  On Error GoTo bubbleError
  231.  
  232.  If doc.isNewNote Then
  233.   haveFieldsChanged = True
  234.   Exit Function
  235.  End If
  236.  
  237.  Dim initialValue As Variant, currentValue As Variant
  238.  ForAll fieldName In Me.fieldsToCheck
  239.   initialValue = Me.fieldValues( fieldName )
  240.   currentValue = doc.getItemValue( fieldName )(0)
  241.  
  242.   If initialValue &amp;lt;&amp;gt; currentValue Then
  243.    haveFieldsChanged = True
  244.    Exit Function
  245.   End If
  246.  End ForAll
  247.  
  248.  Exit Function
  249. bubbleError:
  250.  Error Err, errorMessage()
  251. End Function
  252. &#39;// Comma separate field names. E.g. &quot;forename,surname&quot;
  253. Sub New( ByVal commaSeparatedFieldNames As String )
  254.  On Error GoTo bubbleError
  255.  
  256.  Me.fieldsToCheck = FullTrim( Split( commaSeparatedFieldNames, &quot;,&quot; ) )
  257.  
  258.  Exit Sub
  259. bubbleError:
  260.  Error Err, errorMessage()
  261. End Sub
  262. &#39;// Run this before calculation/etc.
  263. Sub readInitialValues( doc As NotesDocument )
  264.  On Error GoTo bubbleError
  265.  
  266.  ForAll fieldName In Me.fieldsToCheck
  267.   Me.fieldValues( fieldName ) = doc.getItemValue( fieldName )(0)
  268.  End ForAll
  269.  
  270.  Exit Sub
  271. bubbleError:
  272.  Error Err, errorMessage()
  273. End Sub
  274. End Class&lt;/code&gt;&lt;/pre&gt;
  275. Example of use:
  276. &lt;br /&gt;
  277. &lt;pre&gt;&lt;code&gt;..
  278. Dim fieldChangeChecker As New FieldChangeChecker( &quot;FirstName,LastName,Address,PostCode,City&quot; )
  279. Set customerDoc = customersView.getFirstDocument()
  280. While Not customerDoc Is Nothing
  281. Call fieldChangeChecker.readInitialValues( customerDoc )
  282.  
  283. &#39;// Code that looks up the newest information and sets fields
  284.  
  285. If fieldChangeChecker.haveFieldsChanged( customerDoc ) Then
  286.  Call dataDoc.Save(True, False)
  287. End If
  288.  
  289. Set customerDoc = customersView.getNextDocument( customerDoc )
  290. Wend
  291. ..&lt;/code&gt;&lt;/pre&gt;
  292.  
  293. Regarding the errorMessage-function in the class. I use error bubbling in all my LS code. If something fails somewhere in a routine, I want the routine to stop executing. At the top of the stack, I use OpenLog/LogError. This gives me a nice pseudo stack of the function calls.&lt;br/&gt;
  294.  
  295. Code for errorMessage function:&lt;pre&gt;&lt;code&gt;Function errorMessage As String
  296. &#39;// Simple function to generate more readable errors when dealing with error-bubbling
  297. Dim message As String
  298. message = Error
  299. If CStr( GetThreadInfo(10) ) = &quot;INITIALIZE&quot; Then
  300.  errorMessage =  &quot;Error &quot; &amp; Err &amp; &quot; on line &quot; &amp; Erl &amp; &quot; in function &quot; &amp; GetThreadInfo( 10 ) &amp; &quot;: &quot; + Error
  301. Else
  302.  errorMessage =  Chr(13) + Chr(9) + &quot;Error &quot; &amp; Err &amp; &quot; on line &quot; &amp; Erl &amp; &quot; in function &quot; &amp; GetThreadInfo( 10 ) &amp; &quot;: &quot; + Error$
  303. End If
  304. End Function&lt;/code&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://dontpanic82.blogspot.com/feeds/1585314383911476365/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3745504982837212509&amp;postID=1585314383911476365' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/1585314383911476365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/1585314383911476365'/><link rel='alternate' type='text/html' href='http://dontpanic82.blogspot.com/2013/01/small-ls-class-that-can-be-used-to.html' title='Small LS class that can be used to check if fields have changed'/><author><name>Tommy Valand</name><uri>http://www.blogger.com/profile/11052104644034054473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3745504982837212509.post-7722708485805678835</id><published>2012-10-12T07:36:00.000+01:00</published><updated>2012-10-12T07:37:26.668+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="code snippet"/><title type='text'>Code Snippet - Close dialog if all fields are valid</title><content type='html'>Today I was working on a dialog that had fields with validation. I only want to close the dialog if all fields are valid. I&#39;m not aware of any inbuilt XSP methods that does this.
  305.  
  306. This code snippet checks for any invalid fields in the dialog. If all fields are valid, the dialog is closed.&lt;br /&gt;
  307. &lt;pre&gt;&lt;code&gt;function closeDialogIfValid( dialogId ){
  308. var invalidCount = dojo.query( &#39;[id=&quot;&#39; + dialogId + &#39;&quot;] [aria-invalid=&quot;true&quot;]&#39; ).length;
  309. if( invalidCount === 0 ){
  310.  XSP.closeDialog( dialogId );
  311. }
  312. }&lt;/code&gt;&lt;/pre&gt;
  313. This probably only works if you&#39;re using server side validation.
  314. &lt;br /&gt;
  315. &lt;br /&gt;
  316. If there is something like this in the XSP API, please let me know.
  317. &lt;br /&gt;
  318. &lt;br /&gt;
  319. Share and enjoy!</content><link rel='replies' type='application/atom+xml' href='http://dontpanic82.blogspot.com/feeds/7722708485805678835/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3745504982837212509&amp;postID=7722708485805678835' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/7722708485805678835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/7722708485805678835'/><link rel='alternate' type='text/html' href='http://dontpanic82.blogspot.com/2012/10/code-snippet-close-dialog-if-all-fields.html' title='Code Snippet - Close dialog if all fields are valid'/><author><name>Tommy Valand</name><uri>http://www.blogger.com/profile/11052104644034054473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3745504982837212509.post-4820415641417861177</id><published>2012-09-06T11:35:00.000+01:00</published><updated>2012-09-06T11:52:41.385+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="code snippet"/><category scheme="http://www.blogger.com/atom/ns#" term="random tip"/><category scheme="http://www.blogger.com/atom/ns#" term="xpages"/><title type='text'>Snippet to clear session for user</title><content type='html'>During testing, I sometimes log in as different user to test hide/whens/etc. I used to delete the SessionID cookie in the browser to clear session scoped beans/sessionScope variables.
  320.  
  321. Today, I looked for a solution to automate this. This line will clear all objects related to a session:&lt;pre&gt;&lt;code&gt;facesContext.getExternalContext().getSession( false ).invalidate();&lt;/code&gt;&lt;/pre&gt;
  322.  
  323. If you want to clear session when logged in user changes for the current &quot;XPages&quot; session, here&#39;s the snippet I use (put the code in &lt;strong&gt;afterPageLoad&lt;/strong&gt; or &lt;strong&gt;beforePageLoad&lt;/strong&gt;):&lt;pre&gt;&lt;code&gt;// Reset session when user changes
  324. var currentUserName = sessionScope.currentUserName;
  325. var userName = session.getEffectiveUserName();
  326. if( currentUserName &amp;&amp; userName !== currentUserName ){
  327. facesContext.getExternalContext().getSession( false ).invalidate();
  328. }  
  329. sessionScope.currentUserName = userName;&lt;/code&gt;&lt;/pre&gt;
  330.  
  331. I would think this is better than deleting the cookie, as the server is immediately notified that it should flush the objects bound to the session. When I delete the cookie, I believe that the objects are kept in memory until a specified timeout.</content><link rel='replies' type='application/atom+xml' href='http://dontpanic82.blogspot.com/feeds/4820415641417861177/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3745504982837212509&amp;postID=4820415641417861177' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/4820415641417861177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/4820415641417861177'/><link rel='alternate' type='text/html' href='http://dontpanic82.blogspot.com/2012/09/snippet-to-clear-session-for-user.html' title='Snippet to clear session for user'/><author><name>Tommy Valand</name><uri>http://www.blogger.com/profile/11052104644034054473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3745504982837212509.post-6347085600875832843</id><published>2012-08-20T13:17:00.000+01:00</published><updated>2012-08-20T13:17:02.729+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="random tip"/><title type='text'>Comprehensive guide to Design Definitions</title><content type='html'>I found this guide in IBM&#39;s Application Development wiki while looking for information on Design Definitions:&lt;br /&gt;
  332. &lt;a href=&quot;http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Native_and_Custom_Control_Custom_Visualization_Best_Practices&quot;&gt;Native and Custom Control Custom Visualization Best Practices&lt;/a&gt;&lt;br /&gt;
  333. &lt;br /&gt;
  334. So far it&#39;s the most comprehensive guide to Design Definitions I&#39;ve found.</content><link rel='replies' type='application/atom+xml' href='http://dontpanic82.blogspot.com/feeds/6347085600875832843/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3745504982837212509&amp;postID=6347085600875832843' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/6347085600875832843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/6347085600875832843'/><link rel='alternate' type='text/html' href='http://dontpanic82.blogspot.com/2012/08/comprehensive-guide-to-design.html' title='Comprehensive guide to Design Definitions'/><author><name>Tommy Valand</name><uri>http://www.blogger.com/profile/11052104644034054473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3745504982837212509.post-5354995939561604558</id><published>2012-07-27T13:13:00.000+01:00</published><updated>2012-07-27T13:13:20.855+01:00</updated><title type='text'>XPages - Grouping data in comboboxes</title><content type='html'>I wanted to have some values grouped in a ComboBox. Not sure if it&#39;s possible to do with pure SSJS (without using the Java API), but found a way using beans:&lt;br /&gt;
  335. &lt;a href=&quot;http://stackoverflow.com/questions/4214365/jsf-tree-in-a-dropdown&quot;&gt;JSF Tree in a dropdown&lt;/a&gt; (see accepted answer).&lt;br /&gt;
  336. &lt;br /&gt;
  337. The resulting html is select node with options grouped in optgroup nodes.</content><link rel='replies' type='application/atom+xml' href='http://dontpanic82.blogspot.com/feeds/5354995939561604558/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3745504982837212509&amp;postID=5354995939561604558' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/5354995939561604558'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/5354995939561604558'/><link rel='alternate' type='text/html' href='http://dontpanic82.blogspot.com/2012/07/xpages-grouping-data-in-comboboxes.html' title='XPages - Grouping data in comboboxes'/><author><name>Tommy Valand</name><uri>http://www.blogger.com/profile/11052104644034054473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3745504982837212509.post-5495798709195752436</id><published>2012-06-25T08:02:00.000+01:00</published><updated>2012-06-25T08:30:13.939+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="random tip"/><category scheme="http://www.blogger.com/atom/ns#" term="xpages"/><title type='text'>Multi value fields and Beans in XPages</title><content type='html'>I had an issue with multi value fields bound to bean fields in an XPages I worked on. &lt;br /&gt;
  338. &lt;br /&gt;
  339. I got this error message on refresh:&lt;br /&gt;
  340. &lt;pre&gt;&lt;code&gt;java.lang.IllegalArgumentException: argument type mismatch&lt;/code&gt;&lt;/pre&gt;
  341. &lt;br /&gt;
  342. The issue turned out to be a somewhat inconsistent underlying API. When the field is empty, or has single value, it tries to set a string. When there are multiple values, it tries to set a list.
  343. &lt;br /&gt;
  344. &lt;br /&gt;
  345. To work around the issue, have the getter return an Object, and the setter accept an object.&lt;br /&gt;
  346. E.g.&lt;br /&gt;
  347. &lt;pre&gt;&lt;code&gt;
  348. public Object getInputMulti() {
  349. return this.inputMulti;
  350. }
  351. ...
  352. @SuppressWarnings( &quot;unchecked&quot; )
  353. public void setInputMulti( Object inputMulti ) {
  354. if( inputMulti == null ){
  355.  this.inputMulti = null;
  356. }
  357. if( inputMulti instanceof String ) {
  358.  Vector&lt;string&gt; inputNameList = new Vector&lt;string&gt;();
  359.  inputNameList.add( (String) inputMulti );
  360.  this.inputMulti = inputNameList;  
  361. }
  362. if( inputMulti instanceof List ) {
  363.  this.inputMulti = (Vector&lt;string&gt;) inputMulti;
  364. }
  365. }&lt;/string&gt;&lt;/string&gt;&lt;/string&gt;&lt;/code&gt;&lt;/pre&gt;
  366. &lt;br /&gt;
  367. You can have the translation for the setter be done in a utility method.
  368. E.g.&lt;br /&gt;
  369. &lt;pre&gt;&lt;code&gt;@SuppressWarnings(&quot;unchecked&quot;)
  370. public static Vector translateToVector( Object object ){
  371. if( object instanceof String ){
  372.  Vector list = new Vector();
  373.  list.add( object );
  374.  return list;
  375. }
  376. if( object instanceof List ){
  377.  return (Vector)object;
  378. }
  379. return null;
  380. }&lt;/code&gt;&lt;/pre&gt;
  381. &lt;br /&gt;
  382. Then, for the setter:&lt;br /&gt;
  383. &lt;pre&gt;&lt;code&gt;
  384. @SuppressWarnings( &quot;unchecked&quot; )
  385. public void setInputMulti( Object inputMulti ) {
  386.  this.inputMulti = UtilityClass.translateToVector( inputMulti );
  387. }&lt;/code&gt;&lt;/pre&gt;
  388. &lt;br /&gt;
  389. Example of multi value fields: Checkbox group, multi value fields (fields with multipleSeparator), list boxes.</content><link rel='replies' type='application/atom+xml' href='http://dontpanic82.blogspot.com/feeds/5495798709195752436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3745504982837212509&amp;postID=5495798709195752436' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/5495798709195752436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/5495798709195752436'/><link rel='alternate' type='text/html' href='http://dontpanic82.blogspot.com/2012/06/multi-value-fields-and-beans-in-xpages.html' title='Multi value fields and Beans in XPages'/><author><name>Tommy Valand</name><uri>http://www.blogger.com/profile/11052104644034054473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3745504982837212509.post-629834549934068016</id><published>2012-06-22T16:36:00.002+01:00</published><updated>2012-06-22T16:36:28.496+01:00</updated><title type='text'>Update for Enhanced Messages Control - Show &quot;system&quot; messages</title><content type='html'>&lt;p&gt;In response to &lt;a href=&quot;http://www-10.lotus.com/ldd/xpagesforum.nsf/topicThread.xsp?action=openDocument&amp;amp;documentId=3CD3F04270CA2F5585257A25004B90E4&quot;&gt;this question&lt;/a&gt; on the XPages Forums, I&#39;ve updated the source code for my &lt;a href=&quot;http://dontpanic82.blogspot.no/2011/07/custom-control-for-enhanced-validation.html&quot;&gt;Enhanced Messages Control&lt;/a&gt;, so that it also shows messages not bound to controls.&lt;/p&gt;
  390. &lt;p&gt;The &quot;system&quot; messages are show above the messages from components.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://dontpanic82.blogspot.com/feeds/629834549934068016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3745504982837212509&amp;postID=629834549934068016' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/629834549934068016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/629834549934068016'/><link rel='alternate' type='text/html' href='http://dontpanic82.blogspot.com/2012/06/update-for-enhanced-messages-control.html' title='Update for Enhanced Messages Control - Show &quot;system&quot; messages'/><author><name>Tommy Valand</name><uri>http://www.blogger.com/profile/11052104644034054473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3745504982837212509.post-2265246798842155652</id><published>2012-06-15T13:12:00.000+01:00</published><updated>2012-06-15T13:12:14.906+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="beans"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="xpages"/><title type='text'>Recommended tutorials for doing asynchronous processing in beans</title><content type='html'>&lt;a href=&quot;http://technology.amis.nl/2009/02/19/asynchronous-processing-in-java-applications-leveraging-those-multi-cores/&quot;&gt;Asynchronous processing in Java applications – leveraging those multi-cores&lt;/a&gt;&lt;br /&gt;
  391. &lt;br /&gt;
  392. &lt;a href=&quot;http://technology.amis.nl/2009/02/23/using-asynchronous-mechanisms-in-java-and-javascript-for-improving-the-user-experience/&quot;&gt;Using asynchronous mechanisms in Java and JavaScript for improving the user experience&lt;/a&gt;&lt;br /&gt;
  393. &lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://dontpanic82.blogspot.com/feeds/2265246798842155652/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3745504982837212509&amp;postID=2265246798842155652' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/2265246798842155652'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/2265246798842155652'/><link rel='alternate' type='text/html' href='http://dontpanic82.blogspot.com/2012/06/recommended-tutorials-for-doing.html' title='Recommended tutorials for doing asynchronous processing in beans'/><author><name>Tommy Valand</name><uri>http://www.blogger.com/profile/11052104644034054473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3745504982837212509.post-5936711435273049208</id><published>2012-06-08T22:30:00.000+01:00</published><updated>2012-06-08T22:30:25.538+01:00</updated><title type='text'>Update for Enhanced Messages - Now in page order</title><content type='html'>I added a small snippet of code that sorts the messages in the order that the components are in the page.&lt;br /&gt;
  394. &lt;br /&gt;
  395. I only had a simple page to test on, but in theory it should work for large pages with complex structure.&lt;br /&gt;
  396. &lt;br /&gt;
  397. &lt;a href=&quot;http://dontpanic82.blogspot.no/2011/07/custom-control-for-enhanced-validation.html&quot;&gt;Original post with source code for custom control&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://dontpanic82.blogspot.com/feeds/5936711435273049208/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3745504982837212509&amp;postID=5936711435273049208' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/5936711435273049208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/5936711435273049208'/><link rel='alternate' type='text/html' href='http://dontpanic82.blogspot.com/2012/06/update-for-enhanced-messages-now-in.html' title='Update for Enhanced Messages - Now in page order'/><author><name>Tommy Valand</name><uri>http://www.blogger.com/profile/11052104644034054473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3745504982837212509.post-4554769782244149748</id><published>2012-05-31T13:17:00.002+01:00</published><updated>2012-05-31T13:18:39.670+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="random tip"/><title type='text'>Improving performance in Domino Designer when developing XPages</title><content type='html'>&lt;p&gt;If the XPage has a view data source/the view name is a static value, it looks like Domino Designer is constantly polling the view for column info/etc.&lt;/p&gt;
  398.  
  399. &lt;p&gt;If you are done dragging and dropping columns from the view to the view panel/etc. Go into source mode and compute the viewName.&lt;/p&gt;
  400.  
  401. &lt;p&gt;&lt;strong&gt;Before&lt;/strong&gt;
  402. &lt;pre&gt;&lt;code&gt;&amp;lt;xp:dominoView var=&quot;view1&quot; viewName=&quot;MyView&quot; /&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
  403.  
  404. &lt;p&gt;&lt;strong&gt;After&lt;/strong&gt;
  405. &lt;pre&gt;&lt;code&gt;&amp;lt;xp:dominoView var=&quot;view1&quot; viewName=&quot;${javascript:return &#39;MyView&#39;}&quot; /&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
  406.  
  407. &lt;p&gt;When the view name is computed, Domino Designer can&#39;t determine what view it should check -&gt; No more lag.&lt;/p&gt;
  408.  
  409. &lt;p&gt;I haven&#39;t tested this with Document Data source, but you might get a performance boost if you compute the formName as well, as Domino Designer won&#39;t have to check the fields for drag/drop.&lt;/p&gt;
  410.  
  411. &lt;p&gt;Optimally I would wish the Designer team implemented a refresh fields/columns button for the data pane.&lt;/p&gt;
  412.  
  413. &lt;p&gt;Share and enjoy!&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://dontpanic82.blogspot.com/feeds/4554769782244149748/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3745504982837212509&amp;postID=4554769782244149748' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/4554769782244149748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/4554769782244149748'/><link rel='alternate' type='text/html' href='http://dontpanic82.blogspot.com/2012/05/improving-performance-in-domino.html' title='Improving performance in Domino Designer when developing XPages'/><author><name>Tommy Valand</name><uri>http://www.blogger.com/profile/11052104644034054473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3745504982837212509.post-8963188912566562246</id><published>2012-05-29T19:51:00.001+01:00</published><updated>2012-05-29T19:53:28.230+01:00</updated><title type='text'>Using Java reflection and Domino form to auto populate beans</title><content type='html'>&lt;p&gt;&lt;a href=&quot;http://files.dontpanic82.com/DominoDAOReflection.zip&quot;&gt;&amp;gt;&amp;gt; Download DemoApp&lt;/a&gt;&lt;/p&gt;
  414.  
  415. &lt;p&gt;Due to a lot of positive posts about using &lt;a href=&quot;http://en.wikipedia.org/wiki/JavaBeans&quot;&gt;beans&lt;/a&gt;/MVC pattern for developing XPages apps, I&#39;ve started writing more Java and less SSJS.
  416. I really like the performance improvements/stricter structure of code.&lt;/p&gt;
  417.  
  418. &lt;p&gt;In one of my recent apps, I wrote a Model class for each of the forms in the app. The class has fields for all the form fields. Whilst writing the app, I thought about using Java &lt;a href=&quot;http://en.wikipedia.org/wiki/Reflection_(computer_programming)&quot;&gt;reflection&lt;/a&gt;/Domino Form to auto populate the class instance. Java reflection lets you fetch methods from classes using their name (as a String). The Form class contains methods that lets you fetch all the declared field names in the form.&lt;/p&gt;
  419.  
  420. &lt;p&gt;A couple of advantages to using auto population of fields is less code to maintain (~less bugs), and &quot;auto discovery&quot; of typos in either field names or getters/setters. If you call a field firs_name (typo), and write getters/setters for first_name, using the methodology I use, the code would crash, and you would instantly be aware of some error. If you use some kind of logging, you could look at the stack trace to determine what failed.&lt;/p&gt;
  421.  
  422. &lt;p&gt;A couple of disadvantages. Using reflection/fetching field information adds a slight performance penalty. I don&#39;t notice any slowness, but it&#39;s something to be aware of if you&#39;re aiming for light speed/serving the entire Republic of China on one server. :)&lt;/p&gt;
  423.  
  424. &lt;p&gt;In most of my apps, I use underscores to separate &quot;words&quot; in my field names. To make this work with reflection I convert the underscore field names to ProperCase, and prepend get/set.&lt;/p&gt;
  425.  
  426. &lt;p&gt;
  427. E.g.&lt;br /&gt;
  428. Field: first_name&lt;br /&gt;
  429. ProperCased: FirstName&lt;br /&gt;
  430. Getter: getFirstName&lt;br /&gt;
  431. Setter: setFirstName&lt;br /&gt;
  432. &lt;/p&gt;
  433.  
  434. &lt;p&gt;In the attached DemoApp, I have a helper class that deals with the most common field types. It has two methods:&lt;br /&gt;
  435. &lt;b&gt;setObjectFieldsFromDocument( String form, Object object, DominoDocument doc )&lt;/b&gt;&lt;br /&gt;
  436. &lt;b&gt;setDocumentFieldsFromObject( String form, Object object, DominoDocument doc )&lt;/b&gt;.&lt;/p&gt;
  437.  
  438. &lt;p&gt;The first parameter is the name of the form that you want to use as &quot;&lt;a href=&quot;http://en.wikipedia.org/wiki/XML_schema&quot;&gt;schema&lt;/a&gt;&quot; for the population of the instance fields. The second parameter is the Java instance. The third parameter is a Document wrapped in a simple helper class.&lt;/p&gt;
  439.  
  440. &lt;p&gt;The demoapp has a XPage that uses a controller bean (PersonController) to handle interaction with the model (Person). It&#39;s bound to view scope. When the XPage is loaded, it checks for a parameter (id). If id is available, the controller uses &lt;b&gt;setObjectFieldsFromDocument&lt;/b&gt; to populate the model. When save is called, the controller uses &lt;b&gt;setDocumentFieldsFromObject&lt;/b&gt; to update the underlying Notes Document with values from the model.&lt;/p&gt;
  441.  
  442. &lt;p&gt;If this sounds interesting. Download the Demoapp, look at the Person XPage for the data binding, and use Package Explorer to take a look at underlying java code.&lt;/p&gt;
  443.  
  444. &lt;p&gt;I&#39;ll just add the source code for the Person model class, in case some of you fear that everything in Java is complex&lt;/p&gt;
  445. &lt;pre&gt;&lt;code&gt;package com.dontpanic82;
  446.  
  447. import java.io.Serializable;
  448. import java.util.Date;
  449.  
  450. public class Person implements Serializable {
  451. private static final long serialVersionUID = 1L;
  452.  
  453. public static final String FORM = &quot;Person&quot;;
  454.  
  455. private String id;
  456. private String firstName;
  457. private String lastName;
  458. private String email;
  459. private String homepage;
  460. private Double age;
  461. private Date birthdate;
  462.  
  463. public Person() {
  464. }
  465.  
  466. public Double getAge() {
  467.  return age;
  468. }
  469.  
  470. public Date getBirthdate() {
  471.  return birthdate;
  472. }
  473.  
  474. public String getEmail() {
  475.  return email;
  476. }
  477.  
  478. public String getFirstName() {
  479.  return firstName;
  480. }
  481.  
  482. public String getHomepage() {
  483.  return homepage;
  484. }
  485.  
  486. public String getId() {
  487.  return id;
  488. }
  489.  
  490. public String getLastName() {
  491.  return lastName;
  492. }
  493.  
  494. public void setAge( Double age ) {
  495.  this.age = age;
  496. }
  497.  
  498. public void setBirthdate( Date birthdate ) {
  499.  this.birthdate = birthdate;
  500. }
  501.  
  502. public void setEmail( String email ) {
  503.  this.email = email;
  504. }
  505.  
  506. public void setFirstName( String firstName ) {
  507.  this.firstName = firstName;
  508. }
  509. public void setHomepage( String homepage ) {
  510.  this.homepage = homepage;
  511. }
  512.  
  513. public void setId( String id ) {
  514.  this.id = id;
  515. }
  516.  
  517. public void setLastName( String lastName ) {
  518.  this.lastName = lastName;
  519. }
  520.  
  521. }
  522. &lt;/code&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://dontpanic82.blogspot.com/feeds/8963188912566562246/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3745504982837212509&amp;postID=8963188912566562246' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/8963188912566562246'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/8963188912566562246'/><link rel='alternate' type='text/html' href='http://dontpanic82.blogspot.com/2012/05/using-java-reflection-and-domino-form.html' title='Using Java reflection and Domino form to auto populate beans'/><author><name>Tommy Valand</name><uri>http://www.blogger.com/profile/11052104644034054473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3745504982837212509.post-6309756532923629364</id><published>2012-04-19T07:27:00.006+01:00</published><updated>2012-04-19T07:32:32.923+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="random tip"/><title type='text'>XPages Toolbox - Really nice profiling tool</title><content type='html'>If you feel that your XPage application is too slow, &lt;a href=&quot;http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocument&amp;name=XPages%20Toolbox&quot;&gt;XPages Toolbox&lt;/a&gt; can help you to find the biggest bottlenecks in your code.&lt;br /&gt;&lt;br /&gt;If you haven&#39;t tried it, I highly recommend that you give it a spin (it&#39;s free). If you like it, give it a good rating. &lt;br /&gt;&lt;br /&gt;+1 to Philippe Riand for sharing it with the community :)</content><link rel='replies' type='application/atom+xml' href='http://dontpanic82.blogspot.com/feeds/6309756532923629364/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3745504982837212509&amp;postID=6309756532923629364' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/6309756532923629364'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/6309756532923629364'/><link rel='alternate' type='text/html' href='http://dontpanic82.blogspot.com/2012/04/xpages-toolbox-really-nice-profiling.html' title='XPages Toolbox - Really nice profiling tool'/><author><name>Tommy Valand</name><uri>http://www.blogger.com/profile/11052104644034054473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3745504982837212509.post-1706044778617122311</id><published>2012-03-15T21:22:00.015+01:00</published><updated>2012-03-15T21:57:28.518+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Lotus Notes"/><category scheme="http://www.blogger.com/atom/ns#" term="random tip"/><title type='text'>Showing horizontal notes data as vertical in view</title><content type='html'>Today at work, I needed to transfer some data from a Notes application to SQL. The documents in question were horizontal. &lt;br /&gt;&lt;br /&gt;An example of what I mean:&lt;br /&gt;An order form in Notes with five order lines. For each line, there may be five fields that contains information about the order. Making it a total of 25 fields for five order lines.&lt;br /&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqMh6dDVGSVg6oGC4MHxLoZRrCagfY9SSN1vBZOOddC5Bk0H_91YWQexlRkz0Rgw56M1WmQzDsGJLJGDNYqYkC-ki0bGe3hORR2ra2k-HbGP9GzUSIjM2Uhs10liI-AbdnORNkGo5fG8th/s1600/ScreenShot001.png&quot; /&gt;&lt;br /&gt;&lt;br /&gt;Traditionally, if you want to show this data in a regular notes view, you have to have a column per field.&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6Kt2tM0JwuvnbA2-a3U-_pwVI_VjMUq67vrQnB7u1UoBFKio0DjGQoR8PaQJ48KMzGmu3bsCpsvOYlNwMdDnpc7qO_b8Fgc59JlBIYCCdHQF-bGaiZPMH2rwPkIAI5jvQlFtkanPWN-zH/s1600/ScreenShot002.png&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;width: 400px; height: 40px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6Kt2tM0JwuvnbA2-a3U-_pwVI_VjMUq67vrQnB7u1UoBFKio0DjGQoR8PaQJ48KMzGmu3bsCpsvOYlNwMdDnpc7qO_b8Fgc59JlBIYCCdHQF-bGaiZPMH2rwPkIAI5jvQlFtkanPWN-zH/s400/ScreenShot002.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5720223526845121282&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Thanks to the way the index is organized in a Notes view, you can show this data vertically using &lt;strong&gt;Show multiple values as separate entities&lt;/strong&gt;.&lt;br /&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiie0rP-oKBRcR2p1Qya8ddQjEERUWWYTxIQxPrz5JUqQmip3ZH6g8APjsnEUpcXXjC20Qd1yZsSKeUZ29YzMWQ5JpWorrlBslIBV_wbxWmOhQuWQyMfNLLUiAkknUYu6cd-v7KSkDDHVJa/s1600/ScreenShot004.png&quot; /&gt;&lt;br /&gt;&lt;br /&gt;A summary of the technique:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;In each column, create a list of the field values that you want to show&lt;/li&gt;&lt;li&gt;Each column list has to have equal amount of values&lt;/li&gt;&lt;li&gt;Each column has to have Show multiple.. property enabled&lt;/li&gt;&lt;li&gt;Only the first column can be sorted (it can be categorized), or you end up with a lot of rows.&lt;br /&gt;This is probably due to how the index is organized/matching of multiple values&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Here&#39;s the demoapp I took the screenshots from:&lt;br /&gt;&lt;a href=&quot;http://files.dontpanic82.com/SlicingDocumentsByMultipleFields.zip&quot;&gt;&gt;&gt; Download&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Take a look at the Vertical view to see the technique I used.&lt;br /&gt;&lt;br /&gt;Thanks to this technique, I can simply pull the data from a view using view entries/column values/send row by row to a stored procedure in SQL. The alternative would be to write code for each field.&lt;br /&gt;&lt;br /&gt;Share and enjoy! :)</content><link rel='replies' type='application/atom+xml' href='http://dontpanic82.blogspot.com/feeds/1706044778617122311/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3745504982837212509&amp;postID=1706044778617122311' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/1706044778617122311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/1706044778617122311'/><link rel='alternate' type='text/html' href='http://dontpanic82.blogspot.com/2012/03/showing-horizontal-notes-data-as.html' title='Showing horizontal notes data as vertical in view'/><author><name>Tommy Valand</name><uri>http://www.blogger.com/profile/11052104644034054473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqMh6dDVGSVg6oGC4MHxLoZRrCagfY9SSN1vBZOOddC5Bk0H_91YWQexlRkz0Rgw56M1WmQzDsGJLJGDNYqYkC-ki0bGe3hORR2ra2k-HbGP9GzUSIjM2Uhs10liI-AbdnORNkGo5fG8th/s72-c/ScreenShot001.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3745504982837212509.post-5789780611642685297</id><published>2012-03-08T13:01:00.005+01:00</published><updated>2012-03-08T13:27:48.068+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="patch"/><category scheme="http://www.blogger.com/atom/ns#" term="xpages"/><title type='text'>Patch for bug in XSP.partialRefreshGet/-Post in 8.5.3</title><content type='html'>Someone made a really stupid mistake in the code for XSP.partialRefreshGet/-Post in 8.5.3..&lt;br /&gt;&lt;br /&gt;I won&#39;t go into specifics of the code as I&#39;m uncertain if it&#39;s breaking some license. Let&#39;s just say that if they moved a line of code four or five lines upwards, there wouldn&#39;t be any bug.&lt;br /&gt;&lt;br /&gt;I wrote a simple patch for the bug. Put it in a CSJS library, and your code will work like it did on 8.5.2 (unless I made a stupid mistake).&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;/**&lt;br /&gt; * Fix for bug with partialRefreshGet/-Post in 8.5.3&lt;br /&gt; */&lt;br /&gt;(function(){&lt;br /&gt; var oldPartialRefreshGet = XSP.partialRefreshGet;&lt;br /&gt; XSP.partialRefreshGet = function( targetId, options ){&lt;br /&gt;  // Convert to array&lt;br /&gt;  var argsArray = Array.prototype.slice.apply( arguments );&lt;br /&gt;  &lt;br /&gt;  if( argsArray.length &gt; 1 ){ argsArray[1] = argsArray[1] || {}; }  &lt;br /&gt;  if( argsArray.length === 1 ){ argsArray.push( {} ); }&lt;br /&gt;  &lt;br /&gt;  oldPartialRefreshGet.apply( XSP, argsArray );&lt;br /&gt; };&lt;br /&gt; &lt;br /&gt; var oldPartialRefreshPost = XSP.partialRefreshPost;&lt;br /&gt; XSP.partialRefreshPost = function( targetId, options ){&lt;br /&gt;  // Convert to array&lt;br /&gt;  var argsArray = Array.prototype.slice.apply( arguments );&lt;br /&gt;  &lt;br /&gt;  if( argsArray.length &gt; 1 ){ argsArray[1] = argsArray[1] || {}; }  &lt;br /&gt;  if( argsArray.length === 1 ){ argsArray.push( {} ); }&lt;br /&gt;  &lt;br /&gt;  oldPartialRefreshPost.apply( XSP, argsArray );&lt;br /&gt; };&lt;br /&gt;})();&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This code should be forwards compatible with future API updates, as it doesn&#39;t assume number of arguments in function.</content><link rel='replies' type='application/atom+xml' href='http://dontpanic82.blogspot.com/feeds/5789780611642685297/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3745504982837212509&amp;postID=5789780611642685297' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/5789780611642685297'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/5789780611642685297'/><link rel='alternate' type='text/html' href='http://dontpanic82.blogspot.com/2012/03/patch-for-bug-in-xsppartialrefreshget.html' title='Patch for bug in XSP.partialRefreshGet/-Post in 8.5.3'/><author><name>Tommy Valand</name><uri>http://www.blogger.com/profile/11052104644034054473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3745504982837212509.post-6168143863933266430</id><published>2012-01-26T09:55:00.005+01:00</published><updated>2012-01-27T07:44:59.296+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="random tip"/><category scheme="http://www.blogger.com/atom/ns#" term="xpages"/><title type='text'>Runtime optimized JavaScript and CSS - workaround for multiple stylesheets</title><content type='html'>&lt;strong&gt;Update:&lt;/strong&gt; This workaround is only needed if you use &quot;folders&quot; in the image resource name. &lt;br /&gt;E.g. &lt;em&gt;backgrounds\home.png&lt;/em&gt;.&lt;br /&gt;&lt;br /&gt;If you have multiple local stylesheets on a page, the CSS files are combined into a single file.&lt;br /&gt;&lt;br /&gt;This changes the url to the stylesheet (adds xsp/.ibmmodres/.css after the path to the db).&lt;br /&gt;&lt;br /&gt;If you have an image reference like &lt;strong&gt;url(image.png)&lt;/strong&gt;, the image can no longer be loaded, as the url is relative to the path of the stylesheet.&lt;br /&gt;&lt;br /&gt;To work around this issue, add ../../../ to the image reference.&lt;br /&gt;&lt;br /&gt;E.g.&lt;br /&gt;url(../../../image.png)</content><link rel='replies' type='application/atom+xml' href='http://dontpanic82.blogspot.com/feeds/6168143863933266430/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3745504982837212509&amp;postID=6168143863933266430' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/6168143863933266430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3745504982837212509/posts/default/6168143863933266430'/><link rel='alternate' type='text/html' href='http://dontpanic82.blogspot.com/2012/01/runtime-optimized-javascript-and-css.html' title='Runtime optimized JavaScript and CSS - workaround for multiple stylesheets'/><author><name>Tommy Valand</name><uri>http://www.blogger.com/profile/11052104644034054473</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry></feed>

If you would like to create a banner that links to this page (i.e. this validation result), do the following:

  1. Download the "valid Atom 1.0" banner.

  2. Upload the image to your own server. (This step is important. Please do not link directly to the image on this server.)

  3. Add this HTML to your page (change the image src attribute if necessary):

If you would like to create a text link instead, here is the URL you can use:

http://www.feedvalidator.org/check.cgi?url=http%3A//feeds.feedburner.com/dontpanic82

Copyright © 2002-9 Sam Ruby, Mark Pilgrim, Joseph Walton, and Phil Ringnalda