359 Lotus blogs updated hourly. Who will post next? Home | Downloads | Events | Pods | Blogs | Search | myPL | About 
 
Latest 7 Posts
Dynamically pointing DomSQL to current database
Tue, Jan 28th 2014 146
HTML5, script tags and partial refresh inside target area
Mon, Jan 27th 2014 178
Configuring input field for DateTime picker with localized date/time format
Tue, Oct 8th 2013 198
Simple workaround for partial refresh issues with radio buttons
Mon, Sep 23rd 2013 148
Strange implementation of Document.setPreferJavaDates( true )
Thu, Sep 19th 2013 141
Workaround for issues with XPage in iframe on external website
Wed, Jul 3rd 2013 162
Benchmark: Fetching NoteIDs and documents from view
Thu, Jun 27th 2013 108
Top 10
Fix for partial refresh on Dojo Tab Container/Content Pane
Wed, Mar 20th 2013 205
Configuring input field for DateTime picker with localized date/time format
Tue, Oct 8th 2013 198
Multi value fields and Beans in XPages
Mon, Jun 25th 2012 188
HTML5, script tags and partial refresh inside target area
Mon, Jan 27th 2014 178
Simple trick to format XPages Checkbox group
Thu, Apr 14th 2011 167
Workaround for issues with XPage in iframe on external website
Wed, Jul 3rd 2013 162
Simple workaround for partial refresh issues with radio buttons
Mon, Sep 23rd 2013 148
Dynamically pointing DomSQL to current database
Tue, Jan 28th 2014 146
Strange implementation of Document.setPreferJavaDates( true )
Thu, Sep 19th 2013 141
Snippet to clear session for user
Thu, Sep 6th 2012 134


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
68 hits



Recent Blog Posts
146


Dynamically pointing DomSQL to current database
Tue, Jan 28th 2014 3:02a   Tommy Valand
I couldn't find a way to specify current database in the .jdbc file, so I dug around in the API. When creating the connection to a DomSQL database, you can do it with getConnection and the name of a .jdbc config file: public static Connection getConnection() throws SQLException { return JdbcUtil.getConnection( FacesContext.getCurrentInstance(), "nameOf.jdbc" ); } Or use createConnection and specify the path for the connection: public static Connection getConnection() throws SQLException { [read] Keywords: domino ibm database openntf
178


HTML5, script tags and partial refresh inside target area
Mon, Jan 27th 2014 3:22a   Tommy Valand
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. It turns out that this is by design for HTML5. When script tags are inserted into a document using Ajax/innerHTML, the spec states that the script tag should not execute. HTML5 spec "...script elements inserted using innerHTML do not execute when they are inserted..." My workaround for this was to set full refresh for the event that refreshed the panel. [read] Keywords: ajax
198


Configuring input field for DateTime picker with localized date/time format
Tue, Oct 8th 2013 4:02a   Tommy Valand
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. 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's a simpler solution. Sourc [read] Keywords: domino application
148


Simple workaround for partial refresh issues with radio buttons
Mon, Sep 23rd 2013 4:02a   Tommy Valand
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: This seems to work nicely across the browsers I tested in, regardless of triggering the value change through the radio button or the label. [read] Keywords: server
141


Strange implementation of Document.setPreferJavaDates( true )
Thu, Sep 19th 2013 6:22a   Tommy Valand
I wanted to try the Document.setPreferJavaDates today and see how it worked. I called Document.setPreferJavaDates( true ); to ensure that no NotesDateTime objects were created as I didn't need them/didn't want to deal with recycling. First I tried: Document.getItemValueDateTimeArray( "fieldname" ); This returned a Vector of NotesDateTime. Then I tried: Document.getItemValue( "fieldname" ); This also returned a Vector of NotesDateTime. The way that finally returned a Vector [read] Keywords: domino java server
162


Workaround for issues with XPage in iframe on external website
Wed, Jul 3rd 2013 7:02a   Tommy Valand
A colleague of mine had some issues with an XPage running in an iframe on a customer's website. The customer notified us that some users with Chrome/Safari had issues with the page going blank. When doing partial refresh, the page went into a reload loop. I did a quick check, and couldn't find anything wrong with the code. I believe it has something to do with cross domain cookies and Webkit. My workaround was to have a script block that adds the SessionID parameter that was previously a [read] Keywords: xpages javascript




108


Benchmark: Fetching NoteIDs and documents from view
Thu, Jun 27th 2013 5:03p   Tommy Valand
In relation to an experiment I'm working on, I wrote a Java test agent to find the fastest way to get note id's from a view/fetching document values from documents in a view. Here are the results from the benchmark: All numbers are milliseconds. The code was run on a desktop computer (Core 2 Duo/Windows XP). The benchmark code is written so that I think caching on the server is avoided between tests. What's interesting from the results is that it seems like it's marginally faste [read] Keywords: agent application desktop java server
100


Custom Control for custom layout of checkboxes
Tue, May 21st 2013 4:09a   Tommy Valand
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. I couldn'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 checkb [read] Keywords: firefox interface javascript properties
205


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
80


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




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