I don't know if anyone is using my EventDelegation technique for custom events.
In case any of you do, I've updated the demo/script in the demoapp. You can now also delegate onChange events.
Monday, February 14, 2011
Thursday, February 10, 2011
XPages: dojo performance tip
This tip is most valid if there's a big difference between edit mode and read mode.
You can compute if dojo modules are rendered the same way you compute any other component.
E.g. in this.resources (source mode):
I don't notice much difference, as I'm on a decent line with low latency, but for users with low bandwith/high latency the difference can probably be highly noticable.
You can compute if dojo modules are rendered the same way you compute any other component.
E.g. in this.resources (source mode):
<xp:dojoModule name="dijit.Editor" rendered="#{javascript:return currentDocument.isEditable();}" />
In one of my XPages the read mode has 17 requests, and the edit mode has 56 requests. I don't notice much difference, as I'm on a decent line with low latency, but for users with low bandwith/high latency the difference can probably be highly noticable.
Labels:
dojo,
random tip,
xpages
XPages: RichTextEditor + custom partial refresh + validation error = lost content
I ran into a problem today with content disappearing from a rich text editor when there was a validation error/saving. I did a little investigation, and it turns out that the RichTextEditor has a submitListener that updates a hidden field. This hidden field is used by the server to set the field/scope value on the server (at least it looks that way).
When my custom partial refresh ran, the hidden field didn't have a value. When combined with a validation error, this resulted in an empy RichTextEditor after refresh.
To work around this problem, I run the code (CSJS) below before running any "custom" partial refreshes:
When my custom partial refresh ran, the hidden field didn't have a value. When combined with a validation error, this resulted in an empy RichTextEditor after refresh.
To work around this problem, I run the code (CSJS) below before running any "custom" partial refreshes:
// Process any autogenerated submit listeners
if( XSP._processListeners ){ // Not sure if this is valid in all versions of XPages
XSP._processListeners( XSP.querySubmitListeners, document.forms[0].id );
}
This code won't work if you have multiple forms. Then you'd have to write a loop that calls the method once per form.
Labels:
random tip,
xpages
Thursday, February 3, 2011
Domino Designer setting that cleans up whitespace in XPage source
(Clear all blank lines)
Press Ctrl+Shift+F to autoformat code. With the above setting in place, you also should get rid of blank lines.
Share and enjoy!
Labels:
random tip