329 Lotus blogs updated hourly. Who will post next? Home | Downloads | Events | Jobs | Twitter | Bookmarks | Pods | Blogs | Search | myPL | About 
 
Latest 7 Posts
Fix for partial refresh on Dojo Tab Container/Content Pane
Wed, Mar 20th 2013 214
Small LS class that can be used to check if fields have changed
Fri, Jan 18th 2013 386
Code Snippet - Close dialog if all fields are valid
Fri, Oct 12th 2012 262
Snippet to clear session for user
Thu, Sep 6th 2012 266
Comprehensive guide to Design Definitions
Mon, Aug 20th 2012 127
XPages - Grouping data in comboboxes
Fri, Jul 27th 2012 215
Multi value fields and Beans in XPages
Mon, Jun 25th 2012 301
Top 10
Small LS class that can be used to check if fields have changed
Fri, Jan 18th 2013 386
XPages: SSJS code snippet that lets you parse/stringify JS-JSON
Wed, Sep 29th 2010 333
Multi value fields and Beans in XPages
Mon, Jun 25th 2012 301
XPages: Code snippet for Multi Value Custom Converter
Thu, Jun 17th 2010 279
Simple trick to format XPages Checkbox group
Thu, Apr 14th 2011 271
Snippet to clear session for user
Thu, Sep 6th 2012 266
Code Snippet - Close dialog if all fields are valid
Fri, Oct 12th 2012 262
XPages: Make categorized views behave
Fri, Oct 22nd 2010 218
XPages: Simple function to clear scoped variables
Thu, Jun 24th 2010 218
XPages - Grouping data in comboboxes
Fri, Jul 27th 2012 215


Showing horizontal notes data as vertical in view
   

Today at work, I needed to transfer some data from a Notes application to SQL. The documents in question were horizontal.

An example of what I mean:
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.


Traditionally, if you want to show this data in a regular notes view, you have to have a column per field.


Thanks to the way the index is organized in a Notes view, you can show this data vertically using Show multiple values as separate entities.


A summary of the technique:
  • In each column, create a list of the field values that you want to show
  • Each column list has to have equal amount of values
  • Each column has to have Show multiple.. property enabled
  • Only the first column can be sorted (it can be categorized), or you end up with a lot of rows.
    This is probably due to how the index is organized/matching of multiple values

Here's the demoapp I took the screenshots from:
>> Download

Take a look at the Vertical view to see the technique I used.

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.

Share and enjoy!


---------------------
http://feedproxy.google.com/~r/dontpanic82/~3/WgXdYBvG29U/showing-horizontal-notes-data-as.html
Mar 15, 2012
105 hits



Recent Blog Posts
214


Fix for partial refresh on Dojo Tab Container/Content Pane
Wed, Mar 20th 2013 4:05a   Tommy Valand
I wrote this a while back, but I couldn't find that I'd shared it. You need to use the partial refresh hijacker to use the code snippet. This code snippet initializes Dojo Tab Containers/Dojo Content Panes in the area that's refreshed: // Fix problem with partial refresh on Dojo Tab Container/Content pane // Source for inspiration: // http://www.openntf.org/projects/pmt.nsf/0/D228115FAA98DDEC86257A7D0050E7FF dojo.subscribe( 'partialrefresh-complete', this, function( method, form, [read] Keywords: xpages dojo openntf widget
386


Small LS class that can be used to check if fields have changed
Fri, Jan 18th 2013 3:02a   Tommy Valand
We'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's done. We'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. Several of the routines saved documents even if there were no field changes. I wrote a simple class to test for [read] Keywords: database server
262


Code Snippet - Close dialog if all fields are valid
Fri, Oct 12th 2012 12:42a   Tommy Valand
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'm not aware of any inbuilt XSP methods that does this. This code snippet checks for any invalid fields in the dialog. If all fields are valid, the dialog is closed: function closeDialogIfValid( dialogId ){ var invalidCount = dojo.query( '[id="' + dialogId + '"] [aria-invalid="true"]' ).length; if( invalidCount === 0 ){ XSP.closeDialog( dialogId ); } } This pr [read] Keywords: blogger dojo server
266


Snippet to clear session for user
Thu, Sep 6th 2012 4:42a   Tommy Valand
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. Today, I looked for a solution to automate this. This line will clear all objects related to a session:facesContext.getExternalContext().getSession( false ).invalidate(); If you want to clear session when logged in user changes for the current "XPages" session, here's the snippet I use (put the code in afterPa [read] Keywords: xpages blogger server
127


Comprehensive guide to Design Definitions
Mon, Aug 20th 2012 6:26a   Tommy Valand
I found this guide in IBM's Application Development wiki while looking for information on Design Definitions: Native and Custom Control Custom Visualization Best Practices So far it's the most comprehensive guide to Design Definitions I've found. [read] Keywords: ibm ldd lotus application blogger development wiki
215


XPages - Grouping data in comboboxes
Fri, Jul 27th 2012 6:29a   Tommy Valand
I wanted to have some values grouped in a ComboBox. Not sure if it's possible to do with pure SSJS (without using the Java API), but found a way using beans: JSF Tree in a dropdown (see accepted answer). The resulting html is select node with options grouped in optgroup nodes. [read] Keywords: xpages blogger java




301


Multi value fields and Beans in XPages
Mon, Jun 25th 2012 4:10a   Tommy Valand
I had an issue with multi value fields bound to bean fields in an XPages I worked on. I got this error message on refresh: java.lang.IllegalArgumentException: argument type mismatch 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. To work around the issue, have the getter return an Object, and the setter accept an object. E.g. public Obje [read] Keywords: xpages blogger java
154


Update for Enhanced Messages Control - Show "system" messages
Fri, Jun 22nd 2012 9:50a   Tommy Valand
In response to this question on the XPages Forums, I've updated the source code for my Enhanced Messages Control, so that it also shows messages not bound to controls. The "system" messages are show above the messages from components. [read] Keywords: ldd lotus xpages blogger
123


Recommended tutorials for doing asynchronous processing in beans
Fri, Jun 15th 2012 6:29a   Tommy Valand
Asynchronous processing in Java applications – leveraging those multi-cores Using asynchronous mechanisms in Java and JavaScript for improving the user experience [read] Keywords: applications blogger java javascript
97


Update for Enhanced Messages - Now in page order
Fri, Jun 8th 2012 3:49p   Tommy Valand
I added a small snippet of code that sorts the messages in the order that the components are in the page. I only had a simple page to test on, but in theory it should work for large pages with complex structure. Original post with source code for custom control [read] Keywords: blogger




Created and Maintained by Yancy Lent - About - Blog Submission - Suggestions - Change Log - Blog Widget - Advertising - Mobile Edition