329 Lotus blogs updated hourly. Who will post next? Home | Downloads | Events | Jobs | Twitter | Bookmarks | Pods | Blogs | Search | myPL | About 
 
Latest 7 Posts
XPages: Dojo 1.8.1 & jQuery Mobile 1.3.1
Thu, Apr 25th 2013 131
Quick-n-Dirty: Dojo 1.8 & Domino 8.5.3
Thu, Apr 25th 2013 123
XPages: Add inline CSJS with a Theme
Thu, Apr 18th 2013 117
XPages: Inject CSJS code at page top
Tue, Apr 9th 2013 142
Notes 9: Some interesting xsp.properties
Wed, Apr 3rd 2013 255
Notes 9: No Comment!
Tue, Mar 26th 2013 459
Quick-n-Dirty: How to add HTML 5 events
Tue, Mar 26th 2013 153
Top 10
Notes 9: No Comment!
Tue, Mar 26th 2013 459
A performance bottleneck?
Sun, Feb 17th 2013 288
Notes 9: Some interesting xsp.properties
Wed, Apr 3rd 2013 255
XPages: UI for editing localization files (1)
Mon, Dec 17th 2012 208
XSnippets: viewPanelHelper
Wed, Nov 28th 2012 184
Quick-n-Dirty: Import SSJS libraries with DXL
Thu, Jan 10th 2013 173
In Ya Facet!
Wed, Feb 20th 2013 159
XPages: The Problem with DataContext Variables
Mon, Feb 11th 2013 154
Quick-n-Dirty: How to add HTML 5 events
Tue, Mar 26th 2013 153
XPages: Inject CSJS code at page top
Tue, Apr 9th 2013 142


Sven Hasselbach
 
Blog Title blog@hasselba.ch
Blog Description XPages & Domino - Killing me softly
Blog URL http://blog.hasselba.ch
RSS Feed http://hasselba.ch/blog/?feed=rss2
PlanetLotus Feed http://planetlotus.org/profiles/rss/sven-hasselbach
Validate Feed feedvalidator.org or validator.w3.org
Feed Last Checked May 24, 2013 9:18:22 AM EST. Realtime Update:
Landed Here Nov 22, 2011
Location Wiesbaden, Hessen, Germany
Posts: # / 1st / Latest - -
Total Hits 5,517. myPL RSS Selections: 7


Recent Blog Posts
131


XPages: Dojo 1.8.1 & jQuery Mobile 1.3.1
Thu, Apr 25th 2013 10:46a   Sven Hasselbach
As David Leedy got into trouble with Dojo 1.8.1 and jQuery Mobile 1.3.1  and after reading the follow up from Ulrich Krause with the analysis of the problem, I thought that this problem is caused from the AMD loader of Dojo. That’s why I changed the loading order (by forcing the jQuery libraries to get loaded before Dojo), and this seems to work. I have tested it in IE 8, FF 20.0 and Chrome 26.0. Here is my test XPage:                                       [read] Keywords: domino ibm xpages css dojo java javascript mobile properties xml
123


Quick-n-Dirty: Dojo 1.8 & Domino 8.5.3
Thu, Apr 25th 2013 3:53a   Sven Hasselbach
If you want to use Dojo 1.8 with Domino 8.5.3, you can do the following: 1. Grab the Dojo JAR file from a ND9 installation: osgisharedeclipsepluginscom.ibm.xsp.dojo_9.0.0.jar 2. Create a folder “dojo-1.8.0” in your notes data directory dominojsdojo-1.8.0 3. Unpack the JAR file 4. Copy the content of the subfolder resourcesdojo-version of the unpacked JAR file in this folder: 5. Restart HTTP task. 6. Enjoy!     document.write(dojo.version)           P.S. Keep in mi [read] Keywords: domino ibm notes dojo eclipse javascript oracle xml
117


XPages: Add inline CSJS with a Theme
Thu, Apr 18th 2013 12:06p   Sven Hasselbach
I needed a way to add some inline CSJS to an existing application which affects any XPage, that’s why I did this them with a theme. Et voilà:                          alert('THEME JS!')             true              The javascript code is added and executed as expected: [read] Keywords: R6 xpages application java javascript
142


XPages: Inject CSJS code at page top
Tue, Apr 9th 2013 3:05a   Sven Hasselbach
Sometimes it is required to add a some CSJS code at the beginning of the XPage before the Dojo libaries are loaded and are executed. This can be easily achieved by using the resource aggregation feature and including a CSJS library with the . First you have to create a CSJS library which contains the code you want to execute: Then you have to add the which loads the CSJS library:                                                          [read] Keywords: ibm R6 xpages application dojo javascript properties xml
255


Notes 9: Some interesting xsp.properties
Wed, Apr 3rd 2013 2:22p   Sven Hasselbach
Some interesting new xsp.properties were introduced with Notes 9: xsp.client.resources.uncompressed When set to true, all Dojo libraries and CSS resources where delivered in the uncompressed version. The path changes f.e. to /xsp/.ibmxspres/dojoroot-1.8.1-u/dojo/dojo.js. xsp.client.script.dojo.html5attr When set to true, the Dojo HTML5 Data attribute is added to all Dojo component on the XPages. Here is an example for a Date/Time field: xsp.radiobuttongroup.item.label.prefixSpace When set [read] Keywords: ibm notes xpages css dojo properties widget
459


Notes 9: No Comment!
Tue, Mar 26th 2013 1:15p   Sven Hasselbach
[read] Keywords: notes
153


Quick-n-Dirty: How to add HTML 5 events
Tue, Mar 26th 2013 5:13a   Sven Hasselbach
One way for adding unsupported events to an XPage or a component is the trick from Keith. But this is limited to CSJS only. If you need to execute a server side event, you just need change the name of the event to a new HTML 5 event name which does not exist in the DDE. Here is an example for the new onSearch event:                                                                       After entering a value and hitti [read] Keywords: ibm bes javascript server xml
159


In Ya Facet!
Wed, Feb 20th 2013 6:27a   Sven Hasselbach
Using Facets in XPages is very nice, because it gives you an easy way for a global design of your application (and much more). It can be used in all XPages and their custom controls. The xp:callback element defines a section, and this section can be filled in by the parent component with the xp:key attribute. Take a look at this custom control: It has a single callback area (I will never understand why it is called “Editable Area” in the DDE), and a xp:text which is filled [read] Keywords: ibm xpages application javascript properties xml




288


A performance bottleneck?
Sun, Feb 17th 2013 7:17a   Sven Hasselbach
Paul Withers wrote an very interesting article about the difference between a passthrough UIComponents and the corresponding XPages elements. This means the use of instead a , or a instead of a . A while ago I have tested if this would affect the performance, and as far as I know it makes no difference. Here is the code I used to test the performance: Test with a Open the page Partial Refresh Test with [read] Keywords: ibm xpages java javascript xml
154


XPages: The Problem with DataContext Variables
Mon, Feb 11th 2013 5:40a   Sven Hasselbach
There is a large problem with data context variables if they are bound dynamically. They will be recomputed again and again, even when in Partial Execution mode and if they are not in use. Here is a small demo XPage: If you are open the XPage, a dataContext variable will be recalculated for three times: Clicking on the button will recalculate them up to eleven times: Keep in mind: Partial Refresh & Partial Execution is enabled. T [read] Keywords: ibm R7 xpages java javascript xml
122


Quick-n-Dirty: Disable all validators at once
Sun, Feb 10th 2013 7:47a   Sven Hasselbach
In a larger project there are a lot of forms to fill in, each form has many fields with validators and converters. During the development of the workflow it was really helpful to disable all validators at once by using the setDisableValidators() method of the facesContext. To control the behaviour I have added an URL parameter which is checked in the afterRestoreView event. If you open the XPage in the format http://hostname/db.nsf/xPage.xsp?noValidators=true all validators and converters will b [read] Keywords: ibm development javascript xml
131


XPages: compositeData is undefined
Sun, Feb 10th 2013 3:50a   Sven Hasselbach
An interesting question was asked on StackOverflow.com: The compositeData of custom control is undefined in beforeRenderResponse event. I have never noticed this before, but if you are accessing the compositeData object in the before-, afterRenderResponse or the afterRestoreView event, the object is undefined. Here is a simple demonstration CC which just prints the type of the compositeData object to the console:                                          [read] Keywords: ibm xpages javascript xml
173


Quick-n-Dirty: Import SSJS libraries with DXL
Thu, Jan 10th 2013 3:02p   Sven Hasselbach
In the last time I have developed different techniques for manipulation the design elements of XPages applications. While I am still working on a way for manipulating the localization files, I was playing a little bit with DXL imports. Here comes a Java class to import a SSJS library with DXL to a database. It allows to create a new library directly from the browser: By clicking the Import button the new Library will be added to your database (perhaps you have to refresh the DDE): To use the [read] Keywords: acl dxl ibm lotus R6 scriptlibrary xpages applications database java javascript security xml
208


XPages: UI for editing localization files (1)
Mon, Dec 17th 2012 12:39p   Sven Hasselbach
For one of my customers I am developing an easy way for editing the localization/translation of existing XPages applications: Instead of importing and exporting the property files with the Domino Designer (which is not an option for non-developers) it would be more suitable, if the users would have the possibility to edit the files directly in the browser. I am currently  working on a XPage solution for this, and this is my current beta version. This is a proof-of-concept with some known bugs, [read] Keywords: domino ibm lotus notes xpages application applications database java javascript openntf properties xml
184


XSnippets: viewPanelHelper
Wed, Nov 28th 2012 2:40a   Sven Hasselbach
I have added a new XSnippet, the viewPanelHelper. The code helps to keep the selection of the selected documents in a view panel even if pager is used or categories are expand or collapsed. It is not required to modify the view: Only the script and the hidden field must be added to the facets section of the panel and the CSJS class “viewPanelHelper” must be added to the XPage (the class is loaded only once and can be stored in a separate CSJS resource file). The selected documents ar [read] Keywords: openntf
122


XPiNC and Attachments: A better PDF handling
Thu, Nov 15th 2012 2:11p   Sven Hasselbach
For one of my customers I have created a small XPiNC application with contains a lot of documents with attached PDFs. One of the key requirements was the posibility to open and read a PDF directly in Notes Client, without storing it on the desktop. The first thing to know is that XPiNC applications are running in XULRunner, which means that there is a compatibility to Firefox. That’s why you can use FF plugins*, for example the Foxit Reader plugin (npFoxitReaderPlugin.dll) or the original [read] Keywords: domino ibm lotus notes notes client R4 R7 xpages application applications desktop eclipse firefox java javascript vm wiki xml
51


XPages: Disable iOS “autocorrect” and “autocapitalize” features
Wed, Oct 31st 2012 3:48a   Sven Hasselbach
Two of the worst features ever implemented are the “autocapitalize” and “autocorrect” features from iOS devices, because they are enabled by default. It does not make fun to write a blog comment in another language… Or if you just want to enter your email address in a form: The first letter is always upper case, and you always have to kill the suggestion while writing some text. To disable this behaviour, you have to add two attributes to the components, autocorrect [read] Keywords: domino ibm xpages apple application email
56


Quick-n-Dirty: Use your own Factory classes in XPages(2) – The VirtualPageTransformer
Wed, Oct 24th 2012 5:43a   Sven Hasselbach
While playing a little bit with core XPages functionality I found the interesting VirtualPageTransformer interface. With this interface it is possible to implement “virtual” XPages, and this allows to do something which can be described like an url mapping (the $$OpenDominoDocument.xsp url for example was implemented this way). To do create your own transformations you have to do the following: 1. Read the first article about using Factory classes in XPages and create the required /W [read] Keywords: ibm xpages database interface java properties
55


Quick-n-Dirty: Disable Validation for FileDownload control
Wed, Oct 24th 2012 3:12a   Sven Hasselbach
If you are using the file download control,  you sooner or later want to allow your users to delete an existing file. But if you have some required fields on your XPage, a deletion is not possible because the validation is always fired before the attachment is removed. To disable to validation you can use this little SSJS snippet which sets the “disableValidators” property for all events of the UIFileDownload control. Just add the following code to the beforeRenderResponse event o [read] Keywords: ibm java javascript
54


Quick-n-Dirty: Non Closable Dialog for ExtLib
Fri, Oct 19th 2012 2:53a   Sven Hasselbach
I have created a dirty hack for dialogs which prevents users to close the dialog by pressing the escape key or the close button. In my first approach  (StackOverflow.com)the hack has overwritten all dialogs for the whole XPage. This version allows to enable / disable it per dialog. To use this hack you have to add the CSJS library to your XPage and call the dialog with an additional parameter ‘nonclosable‘: XSP.openDialog("#{id:dialogNonClosable}", {'nonClosable': true } ); The [read] Keywords: ibm dojo xml
73


Quick-n-Dirty: Use your own Factory classes in XPages
Thu, Oct 18th 2012 5:27a   Sven Hasselbach
Here is a easy way to use your own factory classes in XPages: 1. Create a file named “com.ibm.xsp.factories.properties” in the WEB-INF-Folder of your NSF 2. In this file, define the factory classes you want to use in the format= HelloWorldFactory=ch.hasselba.factory.HelloWorld 3. Create a java class, in this example ch.hasselba.factory.HelloWorld package ch.hasselba.factory; public class HelloWorld {    public HelloWorld(){       System.out.println("Hello World Fa [read] Keywords: domino ibm lotus xpages application java javascript properties server xml
70


Quick-n-Dirty: Controlling Dojo generation for individual XPages
Wed, Oct 17th 2012 2:29a   Sven Hasselbach
Another interesting question has been asked on stackoverflow.com: How to enable or disable the Dojo libraries for individual XPages, not the whole application? Just adding the parameter as shown below to the XPage won’t work: The workaround is to add a single line to beforePageLoad or beforeRenderResponse event: facesContext.getRequestParameters().setJsLibrary(0); The parameter can be set as the following “0″ disables Dojo Framework “1″ enables Dojo Framwork [read] Keywords: traveler xpages application dojo javascript properties
37


Quick-n-Dirty: A simple isRecycled() method (2)
Thu, Oct 11th 2012 3:20a   Sven Hasselbach
Tommy Valand improved the idea: In his solution the isDead method of the NotesBase class is accessed, and this works better, because the method addionally checks for the C object handle. Here you can find the method: http://stackoverflow.com/questions/12740889/what-is-the-least-expensive-way-to-test-if-a-view-has-been-recycled [read] Keywords: domino lotus notes
53


Quick-n-Dirty: A simple isRecycled() method
Wed, Oct 10th 2012 3:24a   Sven Hasselbach
You will find that the domino java API does not have a suitable method to test if a domino object was already recycled or not. And because of the internal caching of some method calls it is not reliable to check for example for a specific property with a try/catch block. But domino objects have a private property isdeleted which is transient and gives us the required information. With Java Reflection it is possible to access this property: package ch.hasselba.domino; import java.lang.reflect. [read] Keywords: agent domino lotus xpages database java oracle
43


Teamstudio Unplugged: SSJS & Error Messages
Fri, Sep 28th 2012 5:06a   Sven Hasselbach
Today I had to fight with a mysterious error message in a XPage application which is running on Teamstudio Unplugged: SyntaxError: missing ; before statement This IS the message. No more information. No stack trace. No library name. Nothing! It was a hard piece of work to find the needle in the haystack: I used the synchronized keyword in a SSJS library. Hope in future Teamstudio will provide better error informations… [read] Keywords: application
55


XPages: Capture Signatures with the jQuery-Plugin ‘jSignature’
Wed, Sep 26th 2012 12:35a   Sven Hasselbach
In one of my current projects it is one of the goals that the members of the field staff have the possibility to sign a report directly on their iPad. After some research I found the very cool jQuery plugin jSignature, which easily allows to add a signature capture field to a XPage. The plugin is very easy to use: Just add a to your XPage and initialize the plugin with the .jSignature() constructor and that’s it! The API is very simple, but provides everything needed: The captured signatu [read] Keywords: agent ibm notes xpages css database javascript openntf wiki xml
68


Quick-n-Dirty: Development Helper for Unplugged
Fri, Sep 21st 2012 5:32a   Sven Hasselbach
I started today testing/evaluating Teamstudio Unplugged for a customer project. The first thing I missed during developement was a button to sync the current page directly to see my changes on the fly. That’s why I created this small custom control:                   Unplugged Development Helper                                                                                     The Wor [read] Keywords: ibm development workspace xml
50


XPages: High Performance Applications
Tue, Sep 18th 2012 3:22p   Sven Hasselbach
During the last months I worked on a high performance XPages application used by a lot of end users.  To get a better data throughput, I decided to use a reverse proxy for load balancing, caching of ressources, SSL connections etc. For static resources I am using some “special” domains: This means that the browser is allowed to do more HTTP requests at once to the same NSF. If you have for example some images in your database which are reachable from outside via http://www.example.c [read] Keywords: agent connections domino ibm lotus xpages application applications css database java javascript security server xml
63


XPages: Lost in Translation
Tue, Sep 18th 2012 2:29a   Sven Hasselbach
The localization feature is really nice and helps a lot, but you also can have some trouble using it. The first problem is that the language codes which are used in XPages are different from the language codes in java.util.Locale. This SSJS code for example will not work: var locale = new java.util.Locale( "fr_BE" ); context.setLocale( locale ); context.reloadPage(); It will not work because the java.util.Locale object returns “fr_be“, but the PageDetails are set to “fr_BE [read] Keywords: ibm xpages css database java javascript xml
34


This is not me!
Wed, Sep 12th 2012 9:17a   Sven Hasselbach
Hey! This is not me on CollaborationToday.info! That’s me: [read] Keywords: xpages
47


XPages: The Outputstream and binary data
Wed, Sep 12th 2012 2:49a   Sven Hasselbach
If you want to get control over the outputstream of a XPage, you can use the response object from the ExternalContext: var response = facesContext.getExternalContext().getResponse() This will give you access to an object of type com.ibm.xsp.webapp.XspHttpServletResponse which allows some basic operations, but the response will always be encoded to UTF-8. You can not return any binary data directly. But if you access the underlying LCDAdapterHttpServletResponse directly, it is possible to get the [read] Keywords: ibm xpages java javascript oracle xml
32


Security: Another XSS Vulnerability in Domino
Tue, Sep 11th 2012 3:55a   Sven Hasselbach
Stephan Wissel wrote about a XSS vulnerabilty for Domino servers (< 8.5.4) and in his post you will get a advise how to protect your domino server against this attack. Thanks for this! Works great! But there is still a problem with another URL pattern: */xsp/.ibmmodres/* This resolves resources from databases, that’s why it only works in a database URL. But normally domcgf.nsf is reachable from outside. [read] Keywords: domino database security server
36


Quick-n-Dirty: Disable Domino’s Cache for easier development
Sat, Sep 8th 2012 4:31a   Sven Hasselbach
I am currently developing a larger application and have a lot of different mobile devices for testing purposes. After making some changes it is required that all test devices have the latest version of my XPages running, and that the clients get the latest version of the frontend libraries (CSJS, CSS, Images, etc.). Because it is rather annoying to always check whether the browser cache is cleared or not I decided to disable the caching on the domino server directly via a web rule. This works re [read] Keywords: admin domino dwa R7 xpages application css development mobile server
38


SSJS: Execute remote SSJS Code
Fri, Aug 24th 2012 6:26a   Sven Hasselbach
I have created a small helper class to run SSJS code from a remote server. The basic idea behind this class is a question on stackoverflow: http://stackoverflow.com/questions/12054733/include-jss-file-from-notes-document-as-resource As far as I know there is no way to add a SSJS resource via the src attribute, this won’t work: It will always fail, even if the file is available, has the correct file extension etc. That’s why I wrote the code, it’s only a proof of concept. [read] Keywords: ibm notes xpages java javascript security server xml
28


SSJS: What’s “this”?
Fri, Aug 24th 2012 4:31a   Sven Hasselbach
In Serverside JavaScript the keyword this always refers to the “owner” of the function which is executing,  or rather, to the object that a function is a method of. This means f.e. that this refers to the UIComponent which contains the SSJS code. If you add a label to a XPage and compute the value…                … this will always return the current corresponding instance of the XspOutputLabel: But if you are inside a function this will return th [read] Keywords: ibm javascript server xml
41


Quick-n-Dirty: @ClientType() in XPages
Thu, Aug 23rd 2012 6:27a   Sven Hasselbach
The @ClientType formula provides an interesting behaviour: If you add the value to a label, the result will be as expected. It returns “Web” in Browser and returns “Notes” in XPiNC. But if you add it to a computed field on a form and use this form in a datasource, the result in XPiNC is not “Notes“, it is “None” instead.                                [The computeWithForm property of the datasource has [read] Keywords: ibm notes xpages javascript xml
34


XPages: Additional Facets for Viewpanels
Thu, Aug 16th 2012 3:08a   Sven Hasselbach
Today I found some additional facets sections for a normal view panel component which can help to design a layout of an application. They are named like the wind directions and  are equivalent to the position information for the relevant content. The following screenshot shows all facets in use. In the center you can see the content of the view panel. The pagers are not used, only place holders for a better demonstration: As you can see there is some HTML source code in the top of the page vis [read] Keywords: ibm xpages application javascript xml
33


XPages: Access a datasource from one custom control in another one
Sun, Aug 5th 2012 1:10p   Sven Hasselbach
On stackoverflow.com, a very interesting question was asked: How can you access a document datasource from one custom control in another custom control. And here comes my solution in a small SSJS function. First you have to add an id to the custom control which contains the datasource. This gives you a handle for other custom controls: Now it is possible to get the custom control by using the SSJS function getComponent(). The datasources are stored in the data attribute of the custom control. [read] Keywords: domino ibm xpages java
26


XPages: Access resources and their content (2)
Tue, Jul 17th 2012 7:21a   Sven Hasselbach
By using the same code as described in the previous article you can access the complied java classes. To get the correct path you have to do the following: 1. Select the java element you want to access 2. Have a look inside the “$ClassIndexItem” field 3. This is the path of the compiled Java class: 4. Change the variable url to the specific path var url = "WEB-INF/classes/ch/hasselba/jsf/servlet/MyServletFactory.class"; The first 30 Bytes of the resulting output are for internal [read] Keywords: xpages java
38


XPages: Access resources and their content
Sun, Jul 15th 2012 1:12p   Sven Hasselbach
To access XPages resources during runtime and to get their content as a string, you can use the following SSJS code snippet:                             [This displays the current faces-config.xml] By using the correct URL path it is for example possible to access the code of SSJS libraries or even the source code of java classes in the database. To access the source code of a XPage, just use the name of the XPage itself. Same procedure for SSJS libraries, just add [read] Keywords: ibm xpages database java javascript xml
29


XPages: Run your own Servlets
Mon, Jul 9th 2012 6:17a   Sven Hasselbach
A really interesting article about running your own servlets on domino server can be found here: http://www.ibm.com/developerworks/cn/lotus/xpage-servlet/index.html It’s chinese, but you can translate f.e. with Google’s Translator. With 8.5.3 I had have some problems because the required interface IServletFactory could not be resolved in DDE. To get the example running, you have to add a JAR to your build path. Open Project properties, select “Java Build Path” and click [read] Keywords: domino ibm lotus notes xpages eclipse google interface java properties server
36


XPages application events: Create your own ApplicationListener (2)
Sat, Jul 7th 2012 11:13a   Sven Hasselbach
There is another interface available which provides the additional method applicationRefreshed. This event is always raised if the method refresh() of the Application-Object is fired. Instead of implement the interface described in the previous posting, you have to use the interface named com.ibm.xsp.application.events.ApplicationListener2. package ch.hasselba.jsf.debug; import com.ibm.xsp.application.ApplicationEx; import com.ibm.xsp.application.events.ApplicationListener2; public class MyApp [read] Keywords: ibm xpages application interface javascript xml
35


XPages application events: Create your own ApplicationListener
Sat, Jul 7th 2012 9:02a   Sven Hasselbach
If you want to get a handle to application events and want to know if a XPages application is created or destroyed (which means the application was destroyed because of a time out), you can implement this by creating your own own application listener. For this you have to do the following steps: Create a class which implements the ApplicationListener interface Activate the class in XPages runtime To realise the first part, you have to create a class that implements the interface com.ibm.xsp.ap [read] Keywords: domino ibm xpages application interface java server
33


DocumentDataSource with Signer/SignerWithFullAccess-Rights
Thu, May 31st 2012 12:33a   Sven Hasselbach
Yesterday I read the very interessting question from Daniele Grillo at stackoverflow.com: Is a datasource available for XPages who can access the underlying document with different access levels? I have never seen one before, so I decided to do some tests and tried to find a workaround / hack for this problem. But after a while and a some lines of coding, I was unable to get a solution, so I decided to create a new datasource: A datasource which can access the documents in the backend with diffe [read] Keywords: domino ibm lotus xpages java javascript
30


Controlling the HTTP Expires Header
Wed, May 23rd 2012 6:59a   Sven Hasselbach
After reading a question on stack overflow about setting an own HTTP expires header and the problem that an additional header is generated automatically,  I made some tests how the domino server can be forced to stop this behaviour programmatically. During my tests I was able to stop it by using  facesContext.responseComplete() but this works only for “headless” XPages (set rendered to false). If you are calling the method in a normal XPage (set rendered to true), the generated ou [read] Keywords: domino ibm xpages java javascript server xml
35


Quick-n-Dirty: HTML5 UIComponents without effort
Thu, May 17th 2012 4:20a   Sven Hasselbach
Obviously it was Chris Toohey who first has discovered the way of manipulation UIComponents with the tagName attribute: http://www.dominoguru.com/pages/xpage_xptext_tagName_options.html The xp:text – element can easily manipulated to add HTML5 functionality to a XPages. By overriding the property tagName, the component can be accessed like every other UI component in the component tree. Normally the designer only allows a small list of choices for the tagName property: But this can be [read] Keywords: ibm xpages javascript xml
31


XSnippets: Cancel a partial refresh via SSJS
Thu, May 3rd 2012 12:18a   Sven Hasselbach
With the assistance of Philippe Riand I was able to shorten the original idea of canceling a partial refresh to a single SSJS function.  By setting the HTTP header “X-XspRefreshId” to “@none” it is possible to get the same result as in the posting before, but there is no “Dojo hack” required. function cancelPartialRefresh(){ var response = facesContext.getExternalContext() .getResponse();    response.setHeader("X-XspRefreshId", "@none");    response [read] Keywords: ibm ajax dojo java javascript openntf xml
35


Cancel a partial refresh via SSJS
Tue, May 1st 2012 4:29a   Sven Hasselbach
After reading Tim Tripcony’s blog post , I thought about a way how to cancel a partial refresh via server side javascript. To bring this to life, there are just three things to do: Abort the processing of the request on the server Give feedback to the client that request is canceled Stop Dojo to process the XHR request To stop the processing of a request on the server and to send an empty response to the client, this SSJS code can be used: var response = facesContext.getExternalContext() [read] Keywords: ibm ajax dojo java javascript server xml
28


Lotus Domino Entwickler ab 07/2012 verfügbar
Sun, Apr 22nd 2012 3:29a   Sven Hasselbach
Als erfahrener freiberuflicher Lotus Domino Entwickler suche ich ab Juli 2012 neue Herausforderungen in Form von spannenden Projekten, bevorzugt im XPages-Umfeld. Ich bin deutschlandweit verfügbar, bin aber anderen Länder gegenüber nicht abgeneigt. Auf Wunsch stelle ich natürlich gern mein Profil zur Verfügung. Bei Interesse bitte einfach eine eMail an contacthasselba.ch oder mich auf XING aufsuchen: [read] Keywords: domino lotus xpages email profile
37


XSnippets: Fire querySave / postSave – Events
Sun, Apr 22nd 2012 2:07a   Sven Hasselbach
The second XSnippet I have added to the XSnippet Contest is a help to fire the querySave- and postSave-events from SSJS: Save Datasource & Fire querySave/postSave events If you only do a simple document1.save() , the events of a datasource won’t be executed. To fix this, you have to use the save() method of com.ibm.xsp.model.domino.DominoDocumentData instead: var dsName = "document1.DATASOURCE"; // change this to the name of // the datasource you want // to save var app = facesCont [read] Keywords: domino ibm java openntf
34


XSnippets: XPages Localization Setter
Sun, Apr 22nd 2012 12:45a   Sven Hasselbach
I have submitted some XSnippets for the XSnippets-Contest. This is the first one, the XPages Localization Setter: The Snippet allows to change the language settings of a XPage “On-The-Fly”, including the browser language used, the dojo settings, the ressource files etc. package ch.hasselba.xpages.jsf.core; import javax.faces.context.FacesContext; import javax.faces.application.Application; import javax.faces.event.PhaseEvent; import javax.faces.event.PhaseId; import javax.faces.even [read] Keywords: ibm xpages application dojo java javascript openntf xml
26


LotusScript in XPages (3): Quick-n-Dirty-Aktivierung
Tue, Apr 10th 2012 4:09a   Sven Hasselbach
LotusScript in XPages Dies ist der dritte Teil des Artikels “LotusScript in XPages”. Der erste Teil befindet sich hier, der zweite Teil hier. Die Quick-n-Dirty-Aktivierung Damit die BindingFactory verwendet werden kann, müsste eigentlich ein Plugin erstellt werden, doch es gibt auch eine “Abkürzung”, denn die Factory kann auch über einen angepassten ViewHandler in XPages verwendet werden. Dies ist beim Testen / Entwickeln eine sehr praktische Angelegenheit, da sich d [read] Keywords: ibm lotusscript xpages application xml
34


LotusScript in XPages (2): LotusScript-Wrapper
Sun, Apr 8th 2012 2:58p   Sven Hasselbach
LotusScript in XPages Dies ist der zweite Teil des Artikels “LotusScript in XPages”. Der erste Teil befindet sich hier. Der LotusScript-Wrapper Um dynamischen LotusScript-Code auszuführen, bietet sich die Execute()-Funktion an: Mit der Funktion lässt sich fast der gesamte Umfang der LotusScript-eigenen Backendfunktionalität nutzen, also auch Scriptlibraries einbinden uvm. Leider steht diese Methode jedoch nicht  in Java direkt zur Verfügung (im Gegensatz zur Session.evaluate() [read] Keywords: agent domino lotus lotusscript xpages database java
30


LotusScript in XPages (1): Basics
Sat, Apr 7th 2012 8:44a   Sven Hasselbach
LotusScript in XPages Wäre es nicht schön, wenn man in XPages direkt mit Lotus Script arbeiten könnte? Wenn es einen Weg gäbe, mit der sich Lotus Script-Code direkt in der XPage einbetten liesse, und wie folgt zu verwenden wäre? Prinzipiell ist das möglich, aber der hier dargestellte Weg ist eher als Workaround anzusehen und wird das Alpha-Stadium wohl eher nicht verlassen. Aber es lässt sich anhand dieser Anleitung zeigen, wie man XPages flexibel erweitern und weitere Interpreter-Sprach [read] Keywords: ibm lotus lotusscript xpages application javascript xml
25


ObjectDataSource: Kleines “How To”
Sun, Apr 1st 2012 5:33a   Sven Hasselbach
Mit der Extension Library bzw. dem Upgrade Pack 1 ist für XPages eine neue Datasource-Komponente hinzugekommen, die ObjectDataSource. Diese Datasource kann wie die Standard-Datasources für View und Dokument ebenfalls an den verschiedensten Elementen einer XPage angehangen werden, d.h. sowohl an die UIViewRoot der XPage, als auch in Custom Controls, Repeat Controls oder sonstigen Elementen, die eine DataSource verwenden. Grundlegend gilt für ObjectDataSources, das sie beliebige Java-Objekte be [read] Keywords: xpages interface java javascript oracle xml
30


Bug: facesContext.getRenderResponse()
Sun, Mar 11th 2012 1:28p   Sven Hasselbach
Eigentlich sollte die Methode  getRenderResponse() true zurück liefern, wenn der Code in der Render Response-Phase ausgeführt wird, doch leider ist die Funktion nicht korrekt implementiert. So liefert die Funktion bei einem normalen Seitenaufruf falsche Ergebnisse, bei einem Partial Refresh hingegen funktioniert sie jedoch wie sie soll. Zur Erläuterung verwende ich folgende XPage:                                                  Öffnet man [read] Keywords: ibm bug javascript oracle xml
30


Quick-n-Dirty: Id der UIViewRoot ändern
Sun, Mar 11th 2012 1:13p   Sven Hasselbach
Setzt man dem UIViewRoot-Element eine Id… … ändert sich der generierte HTML-Code entsprechend ab: ... ... Auch kann man auf die UIViewRoot nun mittels der Id zugreifen, ein getComponent(“abc”) liefert die Komponente zurück. [read] Keywords: ibm xml
30


Quick-n-Dirty: SSJS Code vor BeforPageLoad ausführen
Sun, Mar 11th 2012 12:10p   Sven Hasselbach
Um SSJS Code vor dem “BeforePageLoad“-Event auszuführen, kann der Code einfach in eine DataContext-Variable gepackt werden. Die Berechnung der DataContext-Variable sollte auf “ComputeOnPageLoad” gesetzt sein, dann wird der Code auch nur einmal ausgeführt. Als Rückgabewert sollte null verwendet werden, dann verschwindet Sie aus dem Speicher und die Variable ist auch nicht via SSJS referenzierbar. Natürlich bleiben die im SSJS-Code definierten Variablen Ereignisübergre [read] Keywords: ibm javascript xml
35


Performance-Killer in der XPage
Mon, Feb 20th 2012 3:51a   Sven Hasselbach
Dank einer Frage von Ulrich Krause im XPages Developer Forum wurde ein Thema “wiederbelebt”, das mir vor einiger Zeit in einem Projekt aufgefallen ist und sich als wahre Bremse bei XPages-Applikationen herausstellt: Sämtliche Datenquellen (DataContext-Variablen, Repeat Controls, usw.) werden bei jedem Partial Refresh neu berechnet, auch wenn sie nicht das Ziel (bzw. ein Kind-Element des Ziels) des Refreshs sind. Ich nutze als Beispiel hierfür die von Ulrich Krause gepostete Beispie [read] Keywords: ibm ldd lotus xpages ajax java javascript xml
27


Bug: Invalider Java-Code durch berechnete Tag-Attribute
Fri, Feb 17th 2012 8:40a   Sven Hasselbach
António A Ramos hat einen interessanten Bug entdeckt: Werden die Attribute eines HTML-Tags im Designer berechnet, wird die XPage nicht mehr verarbeitet und ein Internal Server Error tritt auf So wird der folgende HTML-Tag ordnungsgemäß gerendert… … jedoch ist eine Berechung nicht zulässig: Der Grund ist dabei die Umsetzung in den Java-Code, denn dieser verwendet das Attribute ungeprüft als Variablenname – was natürlich fehl schlagen muss. So sieht der generierte [read] Keywords: ibm ldd lotus R6 xpages bug java javascript server xml
24


“Compute Dynamically” Vs. “Compute on Page Load”
Sat, Feb 11th 2012 12:29p   Sven Hasselbach
Der Artikel von Mark Roden über den Mix von ${} und #{} zur gleichen Zeit brachte mich dazu, mich noch einmal ausführlich mit dem Thema “Compute Dynamically” und “Compute on Page Load” zu befassen, denn der hervorragende Artikel von Paul Withers erläutert zwar die grundsätzlichen Unterschiede zwischen den beiden Berechnungsvarianten, allerdings gibt es noch ein paar Ungereimtheiten. Um einen Überblick über die Unterschiede bei der Verwendung aufzuzeigen, sind hier z [read] Keywords: xpages bug java javascript
29


“It’s not a feature, it’s a bug!”
Fri, Feb 10th 2012 2:50a   Sven Hasselbach
In meinem letzten Beitrag habe ich einen Bug entdeckt, den ich an dieser Stelle noch etwas ausführlicher darstellen möchte, denn es handelt sich hierbei nicht um ein normales Verhalten von JSF, sondern schlichtweg um einen Bug während der Transformation nach Java. Im Vorfeld möchte ich jedoch auf einen sehr guten Artikel von Paul Withers aufmerksam machen, in dem ausführlich dargestellt wird, wie es sein müsste: http://www.intec.co.uk/xpages-bindings-when-runs-at-page-load/ Der Einfachheit [read] Keywords: odf R8 xpages bug java javascript
31


Bug: ${} in Output Script-Blöcken
Wed, Feb 8th 2012 5:48a   Sven Hasselbach
Bei der Verwendung eines Output Scripts muss darauf geachtet werden, dass kein Code verwendet wird, der eine Zeichenfolge beinhaltet, die eine “Compute On Load“-ähnliche Syntax hat: Ein Bug sorgt dafür, das bei der Verwendung von ${} (mit oder ohne Inhalt) einiges durcheinander gerät, und der komplette SSJS-Code falsch verarbeitet wird. So gibt folgender Code wie zu erwarten eine Messagebox mit der Id des Labels aus…                              [read] Keywords: ibm bug xml
27


DataContext-Variablen
Wed, Feb 1st 2012 5:05a   Sven Hasselbach
Will man auf die DataContext-Variablen einer XPage zugreifen, gibt es die Möglichkeit, die Methode getDataContexts() zu verwenden, die für jede UIComponent existiert. Die Methode liefert eine java.util.List zurück, die sich z.B. in einen Array verwandeln lässt, um auf die einzelnen Mitglieder zu zugreifen. Die Mitglieder wiederum sind vom Typ com.ibm.xsp.model.DataContext, mit getVars() lässt sich auf den Inhalt der jeweiligen Variable zugreifen. Hier ein Beispiel: view.getDa [read] Keywords: ibm java javascript xml
28


Security: Domino Server Backdoor (2)
Thu, Jan 19th 2012 8:11a   Sven Hasselbach
Aus einer XPages-Applikation lässt sich der XSP Command Manager (das zugrundeliegende OSGi Framework) fernsteuern. Das Kommando entspricht dem Befehl tell http xsp auf der Domino Serverkonsole, nur dass hierfür kein Serverkonsolenzugriff benötigt wird. Mit Hilfe der folgenden XPage lassen sich beliebige OSGi-Kommandos absetzen, also z.B. Prozesse starten, Bundles installieren (egal von welcher Quelle, auch aus dem Internet) und vieles mehr.                          [read] Keywords: domino ibm xpages java javascript security server xml
33


Security: Fernsteuerbare DocumentDataSources
Thu, Jan 12th 2012 1:22p   Sven Hasselbach
Analog zu den ViewDataSources lassen sich auch DocumentDataSources über die Adresszeile des Browsers manipulieren: Der URL-Parameter databaseName ermöglicht hierbei die Steuerung der zugrundliegenden Datenbank, und überschreibt einen eventuell in der XPage hinterlegten Wert.                                                                     Wird diese XPage mit dem Parameter databaseName=DB2.nsf aufgerufen und abgeschickt [read] Keywords: ibm db2 security xml
21


Quick-n-Dirty: Locale setzen (2)
Thu, Jan 12th 2012 10:12a   Sven Hasselbach
Wie die Locale-Einstellung für eine einzelne Xpage gesetzt wird, ist hier beschrieben. Um die Einstellung jedoch Applikationsweit zu setzen, kann dies durch einen eigenen ViewHandler umgesetzt werden. Dazu benötigt man eine eigene Java-Klasse, die die bestehende Methode calculateLocale überschreibt: package ch.hasselba.xpages.debug; import java.util.Locale; import javax.faces.context.FacesContext; import javax.faces.application.ViewHandler; public class ViewHandlerSH extends com.ibm.xsp.ap [read] Keywords: ibm xpages application java oracle xml
28


Security: Domino Server Backdoor
Sat, Jan 7th 2012 4:12p   Sven Hasselbach
Mit XPages lässt sich ein Domino Server auf einfachste Weise lahm legen, da man über die Java Runtime beliebige Threads starten kann. Ein kleiner Button startet z.B. Notepad auf einem Windows Domino Server: Bei jedem Klick wird auf dem Domino Server einmal Notepad gestartet. Eine kleine Schleife, und auch ein großzügig dimensionierter Server geht in die Knie. Richtig übel wird es allerdings, wenn dieser Button geklickt wird: ACHTUNG! NICHT AUF PRODUKTIVEN SYSTEMEN AUSFÜHREN! [read] Keywords: domino notes nsd R4 xpages java javascript security server
27


Quick-n-Dirty: Locale setzen
Thu, Jan 5th 2012 5:12a   Sven Hasselbach
Um die Locale-Einstellung einer XPage programmatisch zu beeinflussen, kann die Methode setLocaleString bzw. setLocale des context-Objektes verwendet werden.  Damit die Änderungen übernommen wird, muss die Einstellung im BeforePageLoad gesetzt werden. So ändert ein… context.setLocaleString("zh-tw") … bzw. ein … context.setLocale(java.util.Locale.TAIWAN) …die Spracheinstellungen der generierten XPage. Sowohl das lang-Attribute der HTML-Seite als die Dojo-Konfiguration [read] Keywords: R6 dojo java javascript oracle
26


Security: Fernsteuerbare ViewDataSources
Fri, Dec 30th 2011 5:12a   Sven Hasselbach
Ist bei einer Datenbank die Option “Don’t allow URL open” gesetzt, ist sie nicht mehr im Web erreichbar. Mit den URL-Parametern databaseName und viewName lässt sich in Verbindung mit einer ViewDatasource dieser Schutzmechanismus jedoch aushebeln, und könnte ein Problem darstellen, wenn sich nur auf diese Option verlassen wurde. Als Beispiel dient hier eine lokales NAB, dass zu Demonstrationszwecken eine offene ACL hat (Default = Manager), bei dem die genannte Option jedoch ak [read] Keywords: acl ibm xpages javascript security xml
29


Domino Datasources On-the-Fly (3): ValueBinding & MethodBinding
Thu, Dec 29th 2011 6:12a   Sven Hasselbach
Das ist der dritte Teil der Serie “Domino Datasources On-the-Fly”. Der zweite Teil findet sich hier. Will man eine Wertezuweisung berechnen lassen, muss ein ValueBinding erstellt werden. Damit lässt sich dann z.B. der Formname eines DominoDocumentData-Objektes berechnen (zugegebenermaßen ein kleinwenig sinnlos, da man dies im Code sowieso erledigen könnte…). Hierfür existiert die Methode createValueBinding() der Application-Klasse, mit der ein neues ValueBinding-Objekt instanziert [read] Keywords: domino ibm xpages application javascript xml
26


Domino Datasources On-the-Fly (2): DominoDataView
Tue, Dec 27th 2011 8:11a   Sven Hasselbach
Das ist der zweite Teil der Serie “Domino Datasources On-the-Fly”. Der erste Teil findet sich hier. Views lassen sich ebenfalls programmatisch erstellen, allerdings muss mindestens der Name der Ansicht angegeben sein (und ausserdem muss die Ansicht existieren): var data = new com.ibm.xsp.model.domino.DominoViewData(); data.setVar("view1"); data.setViewName("All"); view.addData(data); Hier eine Beispiel-Implementierung in eine XPage (in der Datenbank muss die Ansicht “All [read] Keywords: domino ibm javascript xml
26


Domino Datasources On-the-Fly (1): Basics
Fri, Dec 23rd 2011 9:11a   Sven Hasselbach
Um eine Datasource On-the-Fly mittels SSJS zu erstellen, muss zum Einen ein neues Datasource-Objekt instanziert werden, zum Anderen die neue Datenquelle der XPage bekannt gegeben werden. Mit dem folgenden Code wird eine neue Document Datasource namens document1 erstellt und dann dem UIViewRoot-Element bekannt gemacht: var data = new com.ibm.xsp.model.domino.DominoDocumentData(); data.setVar("document1"); view.addData(data); Direkt nach der Anlage lässt sich die Datenquelle leider noch nicht [read] Keywords: domino ibm javascript xml
54


Quick-n-Dirty: Die HTTP-Session des Domino-Servers
Wed, Dec 14th 2011 2:11p   Sven Hasselbach
Um mit SSJS auf die HTTP-Session eines Domino-Servers zuzugreifen, ist nicht viel Code nötig: var exCon = facesContext.getExternalContext(); var sess = exCon.getRequest().getSession(); Dadurch lassen sich folgende Informationen ermitteln: getAttribute(Name:String) Liefert gebundenes Objekt des Attributes “Name” zurück getAttributeNames() Liefert die Namen aller Attribute als java.util.Enumeration zurück. getCreationTime() Zeit der Session-Erstellung, Millisekunden seit 1.1.1 [read] Keywords: domino java
44


Quick-n-Dirty: Hijacking TypeAhead in CSJS
Fri, Dec 9th 2011 3:12p   Sven Hasselbach
Matthias Nicklisch hat eine interessante Frage im XPages Forum gestellt, nachdem er festgestellt hat, dass im Designer zwar ein OnStart- / OnComplete-Event für die TypeAhead-Funktion angeboten wird, der Code aber als Deprecated angezeigt wird – und auf der XPage auch nicht funktioniert: Wie kann ein OnStart- / OnComplete-Event trotzdem verwendet werden? Meine Idee dazu ist, den darunter liegenden dojo.xhr-Request zu hijacken, und auf diese Weise die Events zu erhalten. Dadurch lässt sich [read] Keywords: domino ldd lotus xpages dojo javascript server
23


Performance-Tuning (6): Parallele Partial Refreshs
Wed, Dec 7th 2011 12:12p   Sven Hasselbach
Multiple Partial Refreshs sind eine schöne Sache, um mehrere Elemente einer XPage zu aktualisieren. Doch da die AJAX-Requests generell asynchron verarbeitet werden, stellt sich die Frage, in wieweit es erforderlich ist, sie sequentiell wie in dem verlinkten Beispiel abzuarbeiten: Denn je länger die Kette der Partial Refreshs ist, desto mehr Performance gewinnt man, wenn man stattdessen mit parallenen Aufrufen arbeitet. Das verlinkte Beispiel sieht in der parallelen Variante wie folgt aus: XSP. [read] Keywords: xpages ajax dojo wiki
30


Quick-n-Dirty: Das xp:hidden-Element
Tue, Dec 6th 2011 5:12a   Sven Hasselbach
Durch die Verwendung des -Elements lässt sich ein verstecktes Feld auf der XPage anlegen. Hier ein Beispiel mit einem statischen Wert: Die XPages-Engine rendert daraus diesen HTML-Code: Soweit so gut, doch wenn man den Wert dynamisch zuweisen will, rendert die XPages-Engine nicht mehr ein referenzierbares Feld,… … sondern einen -Tag, der natürlich auch den Wert nicht enthält: Will man trotzdem den Wert des Feldes berechnen, gibt es zwei Möglichkeiten: 1. Die Berechnung [read] Keywords: xpages javascript
27


Der neue HTTP Header ‘X-XspRefreshId’
Mon, Dec 5th 2011 8:11a   Sven Hasselbach
Mit Domino 8.5.3 ist der neue HTTP Header ‘X-XspRefreshId’ eingeführt worden, mit dem sich die refreshId eines Partial Refreshs vom Server aus verändern lässt. Dadurch ist es möglich, ein Element zu refreshen, dass Ergebnis dieser Operation jedoch auf ein anderes Element im Client anzuwenden. Hier ein kleines Beispiel anhand einer XPage, die vor dem Partial Refresh wie folgt aussieht: Der Code der XPage ist ebenfalls simpel, ausser das bei einem Partial Refresh der XPage ein Hea [read] Keywords: domino ibm dojo javascript server xml
25


Abbrechen eines Partial Refresh im Client
Sun, Dec 4th 2011 5:12a   Sven Hasselbach
Leider bietet das XSP-Objekt keine Möglichkeit, einen Partial Refresh via CSJS vorzeitig zu beenden. Zwar basiert der Partial Refresh-Mechanismus auf dojo.xhr-Requests, die diese Funktionalität bieten, doch das XSP-Objekt stellt keine Möglichkeit zur Verfügung, auf die darunter liegenden Dojo-Objekte zuzugreifen. Um dennoch Zugriff auf die Requests zu erhalten, müssen die Aufrufe von dojo.xhrGet und dojo.xhrPost daher direkt abgefangen und umgebogen werden. Dadurch kann auf das  zurück ge [read] Keywords: ajax dojo
25


Quick-n-Dirty: Leeres NotesDocumentCollection-Objekt instanzieren
Mon, Nov 28th 2011 11:11a   Sven Hasselbach
Domino bietet Out-of-the-Box leider keine Möglichkeit, ein leeres NotesDocumentCollection-Objekt zu instanzieren. Um trotzdem in den Genuss zu kommen, mit einer leeren NotesDocumentCollection arbeiten zu können, ist der schnellste Weg, einfach alle Dokumente der Datenbank zu verwenden und von sich selbst “abzuziehen”. In SSJS sieht das wie folgt aus: /*****  *** getEmptyDocumentCollection()  *** returns an empty NotesDocumentCollection-Object  *****/ function getEmptyDocumentCo [read] Keywords: domino lotusscript database java
34


OpenNTF XSnippets Beta gestartet
Tue, Nov 22nd 2011 3:45p   Sven Hasselbach
XSnippets – The next generation code bin, ist als Beta gestartet. Das neue OpenNTF Projekt dient als Sammlung für kleine Code-Schnipsel, die von der Community für die Community zur Verfügung gestellt werden. Hier sind die ersten Schnipsel zu finden. [read] Keywords: community openntf
27


Performance-Tuning (5): Links und xsp.redirect
Fri, Nov 18th 2011 8:53a   Sven Hasselbach
Ein Serverseitiger Redirect wird durch die XPages-Engine standardmäßig so durchgeführt, daß an den Client ein spezieller HTTP-Header gesendet wird, der via Javascript ausgewertet und dann durch CSJS geöffnet wird. Der Hintergrund hierbei ist, daß sich dadurch die URL in der Browser-Addressleiste ändert, und so dem Nutzer die Seitenänderung aktiv angezeigt wird. Das Problem hierbei ist jedoch, daß dadurch ein zusätzlicher Request vom Server an den Client gesendet wird, der zum Einen nat [read] Keywords: xpages google javascript properties server
25


Art des Refreshs programmatisch ermitteln
Sun, Nov 13th 2011 3:16p   Sven Hasselbach
Um festzustellen, ob das Berechnen eines Elementes von einem Full Refresh oder einem Partial Refresh ausgelöst wird, kann die Klasse com.ibm.xsp.ajax.AjaxUtil verwendet werden. Die Klasse stellt die Methode isAjaxPartialRefresh() bereit, die das nötige Ergebnis zurückliefert. Hier eine Beispiel-XPage, die die Verwendung demonstriert:                                  Hier ein Screenshot der XPage beim Aufruf der XPage. Durch Klick auf die Buttons [read] Keywords: ibm ajax javascript xml
31


Application-Properties mittels SSJS auslesen
Sun, Nov 13th 2011 1:54p   Sven Hasselbach
Um Serverseitig zu ermitteln, welche Dojo-Version verwendet wird, kann folgender Code verwendet werden:    [Code liefert unter 8.5.3 in der Standard-Einstellung "1.6.1" zurück] Um zu ermitteln, ob die Clientseitige Validierung aktiviert bzw. deaktiviert ist, liefert die Methode isClientSideValidation() das gewünschte Ergebnis: [Liefer true bzw. false zurück, je nach Einstellung der Datenbank] Welche Komprimierungseinstellung verwendet wird, kann so ermittelt werden: [Lie [read] Keywords: ibm application dojo javascript properties
23


Performance-Tuning (4): Fein-Tuning von xsp.resources.aggregate
Fri, Nov 11th 2011 12:55p   Sven Hasselbach
Mit Domino 8.5.3 wurde eine neue Option eingeführt, mit der automatisch verschiedene Ressourcen-Dateien vom Server vor der Auslieferung an den Browser zusammengefasst werden. Dadurch läßt sich die Performance einer Web-Applikation deutlich erhöhen, denn zum Einen werden dadurch weniger Anfragen vom Browser an den Server gesendet,  zum Anderen wird der Browser nicht unnötig “blockiert”, da sich die Anzahl der zu ladenden Ressourcen deutlich reduziert (siehe dazu RFC 2616) In fo [read] Keywords: domino ibm xpages css dojo javascript properties server
31


Performance-Tuning (3): XSPClientLite.js
Thu, Nov 10th 2011 2:09p   Sven Hasselbach
Im xsp.properties-File gibt es einen undokumentierten Parameter, mit der sich eine abgespeckte Version der JavaScript-Routinen im Client einbinden läßt: die XSPClientLite.js. Die Library wird bei einer Standard-Installation von der IBM mitgeliefert. Hierbei handelt es sich um eine deutlich kleinere Version der XSP Routinen, allerdings auch mit einem kleineren Funktionsumfang: Es fehlen z.B. die Routinen für Partial Refreshs, auf die aber je nach Anwendungsfall auch verzichtet werden kann. Hin [read] Keywords: ibm javascript properties
23


Quick-n-Dirty: Kontrolle über $$OpenDominoDocument
Wed, Nov 9th 2011 3:29p   Sven Hasselbach
Wird ein Dokument via $$OpenDominoDocument.xsp geöffnet, muß nicht zwangsläufig eine passende XPage mit gleichem Namen der gespeicherten Form vorhanden sein, um das Dokument anzuzeigen. Auch über das xsp.properties-File läßt sich das Verhalten steuern. Durch folgende Eintrag kann einer Form eine bestimmten XPage zugeordnet werden: xsp.domino.form.xpage.formname=xpage Wichtig ist, daß der Name der Form klein geschrieben sein muß. Um der Form TestForm (bzw. dem Wert des Form-Feldes) die XP [read] Keywords: domino properties
28


Quick-n-Dirty: Dojo-Version auf Datenbankebene setzen
Wed, Nov 9th 2011 12:20a   Sven Hasselbach
Will man unterschiedliche Dojo-Versionen einsetzen, ist dies nicht nur auf Serverebene möglich. Auch für jede einzelne Datenbank läßt sich die gewünschte Dojo-Version über das xsp.properties-File vorgeben. Zwar greift die Manipulation der Dojo-Version im xsp.properties-File nur auf dem Domino-Server (die installierte Version vorausgesetzt)… xsp.client.script.dojo.version=1.5.0 …fügt man allerdings folgende Zeile in das xsp.properties-File in der Datenbank hinzu, wird die entsp [read] Keywords: domino notes xpages dojo properties server
22


Quick-n-Dirty: Manipulation von UI Komponenten via SSJS (2)
Thu, Nov 3rd 2011 2:45p   Sven Hasselbach
Ist einer der Items durch einen Mehrfachwert definiert worden,  muss das entsprechende Item anders behandelt werden. Eine Definition wie folgt…             …ist auch intern als Array zu behandeln. Eine Funktion, die mit beiden Item-Typen umgehen kann (auch im Mix), kann dann wie folgt aufgebaut sein: function getSelectableValues( id ) {    var ComboBox = getComponent( id );    var ChildrenList:java.util.ListIterator; ChildrenList = ComboBox.getChildren().listItera [read] Keywords: ibm java javascript
24


Quick-n-Dirty: Manipulation von UI Komponenten via SSJS
Thu, Nov 3rd 2011 9:48a   Sven Hasselbach
Serverseitig lassen sich die die Items einer Auswahlbox (z.B. eine Combobox, Listboxen, usw.) auslesen und ggf. manipulieren. Hier eine Combobox mit drei Items:          Um via SSJS die Items der UI Komponente und deren Eigenschaften zu erhalten, kann man wie folgt darauf zu greifen: function listSelectableValues( id ) {    var cBox = getComponent( id );    var cList:java.util.ListIterator; cList = ComboBox.getChildren().listIterator();    while (ChildrenList.hasNext()) {    [read] Keywords: java javascript




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