Skip to main content

Xpages issues and Solutions

Issue List Solution
For opening a '<a href>' in Xpage in new window, pls use this code: docID:=@Text(@DocumentUniqueID); database := @Subset(@DbName; -1); databasename:=@ReplaceSubstring(database;"\\";"/"); server :=@ServerName; servername:=@Name([Abbreviate];server); xspfrm:=@If(form="FormA";"XpageA.xsp"; form="FormB";"XPageB.xsp";"XPageC.xsp"); "<a href='/"+databasename+"/"+xspfrm+"?databaseName="+servername+"!!"+databasename+"&documentId="+docID+"&action=openDocument' target=_new>"+Open Document+"</a>"
Redirecting one Xpage to another Xpage: If Redirecting One Xpage to another Xpage is done by using “redirectToPage” function available in SSJS
@DbColumn in SSJS: var viewHandle:NotesView=database.getView(viewName) return viewHandle.getColumnValues(colNumber-1)
@DBLookup from a different database present in a different server in XPages : var dbName=Server-Name+"!!"+Database-Path result= @DbLookup(dbName,viewName,lookupKey, {lookupField or column no})
Customizing the Application UI layout design Basically, the server style classes get set to the xpage OneUi layout design on preview. To customize it, we can write our styles with server style class and include that stylesheet in the xpage. By doing this, our stylesheet overrides the server styles. For example: lotusContent is a class inherited from server core.css. It has overflow style as hidden. To overcome this, we can add a stylesheet (name it applicationstyeles.css), write overflow as auto for the same class and include it under resources in the xpage/oneUi layout custom control.
@DBlookup from a different database present in XPages : Lookup from foreign db requires path to be mentioned with "\\" as shown below, var dbName = new Array("Home/Personal","Development\\Projects\\Canon\\PMSystem17Aug12.nsf"); var tmp = @DbLookup(dbName,"lkpEEmpDetails","01453",5); return @If(@IsError(tmp),"Errors",tmp)
Authors and readers field type to render using xpage For the authors and readers field type to render using xpage, assign computeWithForm to onLoad under xpage - All properties - data - domino data source. computeWithForm property has three options "onLoad","onSave" and "both". "onSave" and "both" options work only if the computation on the form and xpage syntax are similar. For example: Assume we have three fields in form and we are using xpage for it. Case 1 : a. Author Field - Default value - "[SUPERUSER]" b. Reader Field - Default value - "[SUPERUSER]" c. ChkUnique Field - Default value - @Unique For this case, on asssigning computeWithForm to "onSave" and "both" works fine (Similar syntax). Case 2 : a. Author Field - Default value - "[SUPERUSER]" b. Reader Field - Default value - "[SUPERUSER]" c. ChkUnique Field - Default value - tmpVar:=@DbLookup("":"NoCache";Server:dbPath;"lkupSystemConfiguration";"sysTest";"Test"); For this case, on asssigning computeWithForm to "onSave" and "both" does not work as Xpage DbLookup syntax is different as follows. TmpVar =@DbLookup(@DbName,"lkupSystemConfiguration","sysTest","Test");
To witness constant window/page title across Xpages, mention the below line on the AfterPageLoad event of the oneUILayout custom Control, as it would be embedded in all Xpage. View.setPageTitle("Mention your application name or whatever content you want it displayed as window title")
The prefix "#" and “$” means "compute dynamically” and "compute on page load"
While using tabbed panel with mandatory fields in more than one tab, validation of fields in the tabs other than the tab currently in focusdid not occur. This was because every time, only The fields under the current tab gets loaded and the fields in the hidden tabs donot get loaded. Avoiding the use of XPages tabbed table and using HTML tabbed table will solve the problem

Comments

Popular posts from this blog

Dynamically changing the combo box values in Javascript:(Lotus Notes)

I need to change the 2nd combobox value depend on the value of the first combobox value. Steps: 1) Create a combo box name it as "cmbValue" . And have some values. 2) Give  default value to that combobox. 3) In the Onchange of that combo box place the code below. 4) Create another combobox value and name it as "cmbValue1" . 5) Give default value to that combobox also. Sample Code(Modify according to your values):   var doc = document.forms[0].cmbValue; var doc1 = document.forms[0].cmbValue1; if(doc.options[doc.selectedIndex].text=="--Select--") { doc1.remove(0) doc1.options[0] = new Option("--Select--","cmbValue1") return false; } else { if(doc.options[doc.selectedIndex].text=="One") {     doc1.options[0] = new Option("four","cmbValue1")     doc1.options[1] = new Option("five","cmbValue1")     return false; } else if(doc.options[doc.selectedIndex].text=="Two") {     doc1.opt...

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 ...

Lotus Notes Development important points

1) What is the difference between a Pull Pull & a Push Pull replication? Answer:  Pull - Pull Replication In pull pull replication the Server A contacts Server B & Pulls all new and updates information Then Server B contacts Server A and pulls all new and modified information With this type of replication, both servers "share" the work of replication. Over modem connections, however, Server A and Server B PULL simultaneously. This approach helps maximize the usage of the low bandwidth connection. Note : There is no console command equivalent to the Pull-Pull replication type. PULL-PUSH : Server A contacts Server B and PULLS all new and modified information. Once Server A completes the pulling process, Server A PUSHES all of its new and modified information to Server B. The Replicator task on Server A does all of the work. PULL-PUSH replication Command REPLICATE Server B/Acme  2) Is it possible to use the script libraries of...