This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Mar 29, 2012, 2:03 PM
3 Posts

Passing a doc handle to a customized control

  • Category: Other
  • Platform: Windows
  • Release: 8.5.2
  • Role: Developer
  • Tags:
  • Replies: 3
Hello,
 
I have a customized control that I want to use in several pages. Each page has is own backend document with different names. Sometimes the control is used as part of  a repeat control. Now I am looking, how to pass the handle of the current document to that control. I can use user defined properties to pass strings and other values, but how can I pass the courrent doc handle?
 
Any suggestions?
 
Regards,
 
Vera Nentwich
Mar 29, 2012, 5:43 PM
56 Posts
Re: Passing a doc handle to a customized control
Hey there,
 
you can set up the class  com.ibm.xsp.model.DataSource in the class of your property in the Custom Control. Then you can pass on the name of the datasource in the XPage. But it has to be like that:
 
#{nameOfDatasource}
 
No, the javascript is not missing, this is expression language, with that you can pass on the datasource directly. But be careful, it can happen that you save the datasource more than once.
 
An alternative would be to pass on the backend documentdirectly, or you pass on the UNID of the document and create your own datasource in your custom control.Everythings possible. Please ask if you have further problems, it is likely that some will occur.
Mar 30, 2012, 9:46 AM
3 Posts
Re: Passing a doc handle to a customized control
Tank you for your explanation. 
 
I tried to use com.ibm.xsp.model.DataSource as type. On the page where I use my custom control and try to set this property I got oly the seletction xp:dominoDocument or xp:domnoView.
If I select xp:dominoDocument I get the hole set of properties, which are also available with the normal definition of the data source, like action, allowDeletedDocuments, computeDocument and so on. On which property do I have to set the formula for the doc handle? 
 
Regards, 
 
Vera 
Mar 30, 2012, 9:58 AM
56 Posts
Re: Passing a doc handle to a customized control
Hmm, I think you choose Datasource as Editor for the property. Try a String instead and pass the datasource as I wrote on post above. Then you are able to use this property as a reference to your datasource, just like you would do it in the XPage.
You could also use the name of the datasource and bind it to an element. Because Custom Controls are being merged with the XPage before running the code, you can access the name of the datasource without doing something else to access it. It isn't a clean solution, but works too.

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal