xpages-ssjs

Getting properties/parameters from page level

心已入冬 提交于 2020-01-16 01:52:32
问题 I wonder if I can get the parameters and/or properties of an xpage or custom control programmatically. <xp:view xmlns:xp="http://www.ibm.com/xsp/core" id="layout"> <xp:this.properties> <xp:parameter name="testcc.xsp" value="Test 1"></xp:parameter> <xp:parameter name="index.xsp" value="Main"></xp:parameter> </xp:this.properties> ... How can I access this parameter list to use it e.g. in a repeat control? EDIT You both are right, thank you! But this works only on a page, not in a custom control

How to call SSJS function from computed HTML link?

笑着哭i 提交于 2020-01-16 01:12:12
问题 I have a computed field on an xpage the result of which is HTML. In that HTML I want to compute a link that will trigger some server side js function followed by a partial refresh. My current code looks like this: <a href="#" onclick="return myFunction()">Click Here</a> This will work if my js function is a client-side function but I want to use this function to set the value of a field on the document so I need SSJS. Static links that are created from the controls pallet in an xpage allow

Xpages: get count of values in multi-value field in view

北慕城南 提交于 2020-01-07 06:18:51
问题 I have 100 documents with a multi-value field. The field holds 5 possible values (Albert,Ben,Chris,Don,Ed) let's say. The field must contain 1 value, but can contain up to 5. I need to compute the number of docs that contain each value, so Albert 56 Ben 22 Chris 79 etc. This seemed easy. I constructed a view that contains the docs, the first column is the field, and I selected show multiple documents for multiple feeds. In SSJS loop through my master list of values in the field, and for each

Regex for JavaScript source

本秂侑毒 提交于 2020-01-06 08:01:14
问题 XPages application fails with following stack trace: com.ibm.jscript.InterpretException: Script interpreter error, line=30, col=43: 'component' is null at com.ibm.jscript.ASTTree.ASTMember.interpret(ASTMember.java:153) at com.ibm.jscript.ASTTree.ASTCall.interpret(ASTCall.java:88) at com.ibm.jscript.ASTTree.ASTBlock.interpret(ASTBlock.java:100) at com.ibm.jscript.ASTTree.ASTIf.interpret(ASTIf.java:85) at com.ibm.jscript.ASTTree.ASTBlock.interpret(ASTBlock.java:100) at com.ibm.jscript.ASTTree

Regex for JavaScript source

纵饮孤独 提交于 2020-01-06 08:01:12
问题 XPages application fails with following stack trace: com.ibm.jscript.InterpretException: Script interpreter error, line=30, col=43: 'component' is null at com.ibm.jscript.ASTTree.ASTMember.interpret(ASTMember.java:153) at com.ibm.jscript.ASTTree.ASTCall.interpret(ASTCall.java:88) at com.ibm.jscript.ASTTree.ASTBlock.interpret(ASTBlock.java:100) at com.ibm.jscript.ASTTree.ASTIf.interpret(ASTIf.java:85) at com.ibm.jscript.ASTTree.ASTBlock.interpret(ASTBlock.java:100) at com.ibm.jscript.ASTTree

copy attachment from other document on fly

核能气质少年 提交于 2020-01-06 01:24:26
问题 After I save my current XPages, in the event postNewDocument of datasources..I would to copy on the fly in the backend Domino Document without saving of disk the attachment from another document andI have found this solution: var attachments:java.util.Vector = session.evaluate("@AttachmentNames", docReply); for (var i = 0; i < attachments.size(); i++) { embeddedObj = docReply.getAttachment(attachments.get(i).toString()); if (embeddedObj != null) { bufferInStream = new java.io

XPages “filter by category name” for View Panel Controll random error

别说谁变了你拦得住时间么 提交于 2020-01-05 15:06:47
问题 I got a very strange problem with View Panel Controll in IBM XPages. When I try to make a single category with the option "filter by category name" I got randomly a wrong result back, what means, I got all document back instead of the single category. The key parameter is not calculated, so that this is excluded as the reason for my problem. When I create a simple expample db to see if this is a general bug in XPages, I can't reproduce it. It seems, that it only happens when a lot more stuff

XPages “filter by category name” for View Panel Controll random error

别来无恙 提交于 2020-01-05 15:06:34
问题 I got a very strange problem with View Panel Controll in IBM XPages. When I try to make a single category with the option "filter by category name" I got randomly a wrong result back, what means, I got all document back instead of the single category. The key parameter is not calculated, so that this is excluded as the reason for my problem. When I create a simple expample db to see if this is a general bug in XPages, I can't reproduce it. It seems, that it only happens when a lot more stuff

Creating Global Array in in xPages using SSJS

≡放荡痞女 提交于 2020-01-05 07:22:27
问题 I have a custom control having a but submit and multiple SSJS libraries. I have require a global array initialized in in submit button and array values are populated from different libraries. I have declared and initialized an array button but its not available in libraries. Any clue how can I declare an array as global to make this available for all libraries? If not than how an array can be created using scope variables? Please guide me . Thanks in advance Best Regards, Qaiser 回答1: You

Xpage MIME mail Send- Error - method NotesDocument.send() null

假如想象 提交于 2020-01-03 05:25:26
问题 Mail Send Error : Exception occurred calling method NotesDocument.send() null While making the mime mail in ssjs I am having this issue, but in the Lotus script client, I am getting mime emails correctly. Please help var docEmail:NotesDocument = database.createDocument(); var rtitem:NotesRichTextItem = docEmail.createRichTextItem("Body"); docEmail.replaceItemValue("Form", "Memo"); docEmail.replaceItemValue("SendTo", "mailid.com"); docEmail.replaceItemValue("Subject", "Your Subject"); rtitem