Saturday, October 27, 2012

AJAX Style file uploads using an iFrame

I was recently trying to solve a strange issue with Internet Explorer 8 (it's always IE...) on redirecting the user after successfully uploading a file.  Couldn't use HTML5's FileUpload API as we had to be able to support older browsers but what we wanted was AJAX style in place uploads without having to redirect users back to the page after they had uploaded a file.

Then I came across the following blog post:
http://www.alfajango.com/blog/ajax-file-uploads-with-the-iframe-method/

This method feels like a bit of a hack but is a decent solution to the problem.  Target the empty iFrame and you can keep users on the same page.  It seems to be a popular method and one I'll use again until we can finally move to using the proper HTML5 API for doing this.

Friday, September 21, 2012

Working with lists

This is more a note to remind me in future but when dealing with lists in LiveCycle it can sometimes be a little tricky to just keep adding to a list without creating a loop.  An easy way to do this within one set value step is to use the collection size to determine the index for adding something to the list.

Here's an example XPath statement which will add to the end of the list (where "listAttachments" is your list variable):

/process_data/listAttachments[number(get-collection-size(/process_data/listAttachments)+1)]

Thursday, September 20, 2012

WebLogic LiveCycle ES3 Installation

On a recent installation of LiveCycle ES3 on WebLogic I realized that I had started creating a list of "extras" which I often needed to do before the installation would work properly.  These might not always be required and may in fact be buried in the documentation somewhere but here's the list regardless:


  • Setting up the servers (both Admin and Managed Server) as Windows Services.  Not strictly a LiveCycle step but useful nonetheless.  Just don't forget to copy the lines you added to "startManagedServer.cmd" into your new service. 
  • Adding the SQL driver to the classpath.  When using SQL Server we need the sqljdbc4 JAR file in the CLASSPATH.  Unfortunately the text LiveCycle gives you during the installation to copy into your startup script doesn't include this.  Again this might be the way we had configured WebLogic but I needed to add the path onto the end of the CLASSPATH supplied in order to get us talking to the database (we had setup the data source manually in WebLogic rather than bundling it into the LiveCycle EAR files.  
I'll keep adding to this as and when I come across other configurations.

Wednesday, February 8, 2012

Knockout.js

It’s been a hectic couple of months with my move to Canada but having now settled in I hope to be able to write a few more posts on some of the technology I’m working with.  My most recent project is HTML5 and JavaScript based which has introduced me to a new library – Knockout.js.

The reason for choosing Knockout was simple; we needed a library which could manage data binding and that could map from JS objects to JSON.  Knockout (plus the mapping plugin) filled those needs perfectly.  For those moving over from the world of data binding in Flex it will quickly feel familiar. 

Over the next couple of weeks I’ll be posting about some of the pitfalls we encountered whilst using the library and some tips on how to most effectively use it.  I’ll also be relating some of the concepts from ActionScript/Flex which should help others making the transition over to the HTML5 world.