Posts Tagged ‘ajax’

19 Dec 2012

XPages Query: Strange behavior between partialRefreshGet and Post

Hi all. I hit a very strange issue this morning with my Partial Refreshes. It’s the first time i’ve been faced with this problem. I’m happy to say that I managed to resolve the issue, but I’m a bit confused as to why it was an issue in the first place.

Ok, so I have a button that performs an SSJS Function. It also triggers a Partial Refresh of a Panel in my XPage. This Panel that gets refreshed excludes my Button Bar Panel and for very good reasons. My Button Bar Panel should only be refreshed after the initial Partial Refresh of my other Panel in the XPage.

I do this by adding some CSJS to the onComplete event of my Button that’s triggered. It uses a Remote Service to check a condition, then if that condition is True, it performs a Partial Refresh of the Button Bar Panel. I used a XSP.partialRefreshGet for the partial refresh of the Button Bar Panel.

Now, what I noticed, was that the Button Bar Panel in some cases, was been refreshed before the Primary Partial Refresh. This doesn’t happen in the first 2 times that the button is clicked, but only from the 3rd time onward. I couldn’t understand this because according to Firebug, the Partial Refreshes occur in the correct Sequence.

How I fixed the issue was quite simple: I changed the XSP.partialRefreshGet to a XSP.partialRefreshPost. This immediately resolved the issue and everything works perfectly.

In short, I am just a bit confused as to why a XSP.partialRefreshGet would run its actions out of sequence. Very strange behavior.

Would love some feedback or comments.




20 Jul 2012

A quick example of the Dynamic Content & Data View Controls used in an XPages App

Hi Everyone. I’ve finally made some time to test out a few features from the XPages Extension Library. It was a bit of a learning curve, but it’s looking good.

Click here to view a Demo of these Controls.

I apologize in advance if there’s a small delay when using this App. It’s been hosted on a Server in South Africa…so the Internet Line is to blame.

Anyways…below is a list of Controls I’m using in the XPages App:

1. On top you’ll see the XPages Debug Control that was created by Mark Leusink and is available on OpenNTF. It’s very cool in the sense that it allows you to print messages directly to the Control and not via the Server Console. It also allows you to see all Scoped Variables that are being used in the XPage. Finally, it has an awesome feature where you can execute SSJS Scripts and view the result. I am very happy with this Control.

2. I’m using the Application Layout to control the Look and Feel of the XPage. It’s always a massive time saver. Click here to view the Video from NotesIn9 that explains the Application Layout in more detail.

3. in the Left Section I’m using the Navigation Control made available in the XPages Extension Library. This was a trick and a half, but I managed to use Partial Refreshes for all my onclick events. This allows me to use 1 XPage and multiple Custom Controls.

4. Depending on loading time, you might see the XPage go into Standby during the Partial Refresh. This is thanks to the Standby Custom Control which is available for download from OpenNTF. This is an awesome feature that needs no additional resources to function.

5. I have 2 views in the Main Content Section. These are Data Views that I am using from the XPages Extension Library. It’s safe to say that I am currently using very basic functionality from the Data View. There’s a lot more that you can do with it.

6. The 2 Data Views exist in a Dynamic Content Control, also from the XPages Extension Library. I won’t go into too much detail about this except that the Dynamic Control keeps your XPage light, and only loads Controls when they are needed. Very awesome stuff.

I am quite happy with what I’ve achieved in the last 3 hours. I had to put a few hacks in place to make everything work with Partial Refreshes, but all in all it was quite easy to implement.

I highly recommend the XPages Extension Library Book. It’s a life saver.

Till next time. Enjoy :)

5 Dec 2011

Some hard lessons learned during a XPages Project

Hi Everyone. This is a shortish post where I feel it’s important to make mention of a few issues I ran into during one of my XPages Projects. Please heed my warnings and learn from my experience.

1. I had a problem where I have a button that triggers SSJS, but when I click on the button, nothing happens. My first guess was that the partial refresh wasn’t working as planned. But after what felt like forever, I finally realised that there were controls on the page that were been validated, and I had no error message box for them, because they were in a panel that wasn’t supposed to be refreshed. In my head, they shouldn’t be validating because I’m not refreshing that part of the page, but it seems that i’m wrong.

LESSON LEARNED: Please remember that if your button’s not doing anything, it’s most likely returning false before executing the SSJS, due to failed validation on controls that aren’t bound to an Error Message or Error Messages Control.

2. If you’re creating XPages the right way, your pages won’t be reloading when clicking on buttons, etc. You’ll be using partial updates. Now, the problem here is if you’re executing some advanced business logic, and somewhere it’s failing, you don’t see any XPages Errors returned because your partial refresh is an AJAX Post back. What I do here as a quick fix, is I set the button that fails to perform a full update instead of a partial update. This way, it will reload the page, and return the error that’s occurring. This is not best practice, but a relatively quick fix. I have not had the time to mess around with Medusa on OpenNTF, and OpenLog of XPages works well, but sometimes is a lengthy alternative.

LESSON LEARNED: A Full update is your worst enemy in XPages, but it will always tell you the truth :)

That’s it for now. Back to XPages Development.

Cheers all.

25 Oct 2011

Ukuvuma welcomes its newest Xpage to the Showcase – The Timesheet Dashboard

Hi Everyone. Well, here it is. I promised this yesterday, but I decided to include a Video walk through of the Timesheet Dashboard, and I struggled a bit to get the Dojo Accordion Control to work in IE7 & 8. Thanks Paul Withers for your help.

In this Blog Entry, I explain the technical features of the Timesheet Dashboard. To test out the Timesheet Dashboard, click here to open up the Ukuvuma Xpages Showcase. Additionally, you can watch the below video which gives you a walk through of the Timesheet System in our Xpages Showcase.



The idea behind the Timesheet Dashboard, is to allow Users to quickly Add, View and Edit their Timesheets without having to navigate away from the Page or wait for the Page to reload. This is where Xpages is very powerful. once the Users Timesheets are added, they can then navigate to the Project Manager Report and view their captured timesheets per Project.


The Timesheet Dashboard makes use of the following additional Custom Controls that aren’t shipped with Domino 852:

  • Dojo Accordion Container + Pane – Used to separate General Details from Claim Details – ( Xpages Extension Library )
  • Tooltip Control – Used to create Tooltip Popups when hovering over Information or Help Icons – ( Xpages Extension Library )
  • Dialog + Dialog Button Bar – Used to Edit Timesheet Records in the Repeat Control – ( Xpages Extension Library )
  • View Picklist Control – Used to select Projects for the Timesheet Document – ( Mark Hughes )
Over and above these controls, I also use a Repeat Control with a Pager to display already captured Timesheets.
  1. The Dojo Accordion Container does not work properly in IE7 and 8 if you do not specify a height in the Style Properties.
  2. Add a Panel to each Accordion Pane and then add your content into the Panel.
  3. Make sure that your Tooltip Controls refresh if the controls they are mapped to are refreshed. If not, they lose their binding to the mapped Control.
I trust you will enjoy, and please as always, feel to provide as much feedback as you want.
Many Thanks