Skip to main content

Xpages Tips

Tips Solution
Themes in OneUI Layout: 1) Oneuiv2.1 2) Oneuiv2.1_blue 3) Oneuiv2.1_gen1 4) Oneuiv2.1_gold 5) Oneuiv2.1_green 6) Oneuiv2.1_onyx 7) Oneuiv2.1_orange 8) Oneuiv2.1_pink
SSJS @Adjust on Javascript Dates: The following code will generate results that you may not expect: Eg : var myDate = new Date(2010,2,15); //this is MARCH 15th, months for JSDate is zero based myDate = @Adjust(myDate,0,-1,0,0,0,0); //--> expected date 2/15/2010 The key is to specify the "[InLocalTime]" keyword to the @Adjust function, so the correct call would be: @Adjust(myDate,0,-1,0,0,0,0,"[InLocalTime]")
Open Links in Own window in Ext Lib App Layout: To open the link in its own window, you will use a simple JavaScript Function: window.open(“http://www.mydomain.com”, “_blank”); Now, if you try to add this to the href property, it will not work, because it would be regarded as a link and not a JavaScript Function. So, to achieve the desired result, you will need to add the JavaScript Function to the onClick property. Please take note of the following 2 conditions: 1. Make sure that the href property is empty. Otherwise it will take preference over the onClick property. 2. Don’t make the onClick property computed and then add the JavaScript, otherwise it will run the Function as SSJS, which won’t work. Simply paste the JavaScript Function as a string value in the onClick property.
Redirect to Parent view, after closing the form. Assume there are 3 fields in a form a. Name. b. Age. c. EmpId And we have 3 views on the left navigation for it namely, a. By Name. b. By Age. c. By EmpId. which opens the same form (Xpage). If we Open the document through "By Name" view and close it, it should redirect to the same "By Name" view. Similarly, If we Open the document through "By Age" view and close it, it should redirect to the same "By Age" view and If we Open the document through "By EmpId" view and close it, it should redirect to the same "By EmpId" view. For this, we can write this code in the afterPageLoad event of the View Xpages, sessionScope.put("Pagename","viewName.xsp"); //(sessionScope - Available to Current User) And on the Close button of the form, Add a simple action with "Open Page" and under the "Name of the page to open" argument, write the below code in the Compute value if(sessionScope.get("Pagename")==null) { return "DefaultHomepage.xsp" } else { sessionScope.get("Pagename"); }
The document UNID needs to be retrieved from Querysave of an Xpage. If a field in xpages, carries the formula to find the UNID, it just stores the temp UNID that gets generated before submission of a form. This creates problem in loading them another form in a modal dialog. Because, the temp ID doesn't pull content from the view as the UNID did not matches. So to store correct UNID, the UNID code is added to the Xpage Query save event, and so the Original UNID is stored in the field. Thereby URL redirection and opening of Modal dialogue doesn't create any problem.

Comments

Popular posts from this blog

"Error in Agent" or "Error loading USE or USELSX" running Out-of-Office agent after upgrading to Domino 6.x

Question After upgrading from one Lotus® Domino® server version to another (for example, 5.0.11 to 6.x), you find that the Out of Office agent does not work and produces errors written to the console and the log (if enabled). The error message in the Domino console is as follows: "Error in Agent ´OutOfOffice OutOfOffice´ calling script library ´Common´: Script library signer ´CN=ServerA/O=Widgets´ does not have proper rights Agent ´OutOfOffice OutOfOffice´ error: Error loading USE or USELSX module: Common AMgr: Agent ´outofoffice´ in ´mail\jdoe.nsf´ completed execution" Maintenance on the database did not resolve the problem, nor did replacing the design or running fixup, updall -r, or compact. Answer Agent security rights in Domino 6.0 were revised to be more robust. This issue occurs when the signer of the script library does not have the correct rights to execute on the Domino server, and/or the script library has not been signed in Notes/Domino 6...

Lotusscript to establish ODBC connection:

The script, when executed from a button, will create a new record in a specified ODBC data source, attempt to save the new record and display a message indicating whether the operation was completed successfully. If the operation is not completed sucessfully, it is likely that either your data source is read-only or your ODBC driver does not permit updates to the data source. Important: Complete each of the four steps below before running the script. 1. Create a new agent and add the following UseLSX command to the Options event: UseLSX "*LSXODBC" 2. Add the following script to the Initialize event of the agent. NOTE: Do not add the 'Sub' and 'End Sub' lines. Dim ui As New NotesUIWorkspace     Dim uidoc As NotesUIDocument     Dim doc As NotesDocument     Dim connection As ODBCConnection     Dim query As ODBCQuery     Dim result As ODBCResultSet         Set uidoc=ui.CurrentDocument ...

"Responses" and "Response to responses"

Lotus Notes has any kind of format of lotus notes document, but what about the “response” and “response to the response.” When you design the form in lotus notes application you can chosen: to create a document with the document format under the primary documents call “response document” or create a document under response documents call “response to the response.” Lotus notes develops can decide whether to provide some structure when you create notes documents. There are many cases that are more relevant documents are clear. Example: a data entry in a document, you can information to employees in the two documents to be attached to the first. Remember that you have entered in the accounting documents of each set a unique ID.  How to tie documents to respond to the main document is to add a field in response documents called $REF. $REF argues that ID is not taken into account. copies of the parent. How “responses” differ from “response to responses”? Do you have a hierarchy of do...