Rectangle 27 0

Handling of an "attachment" is primarily done by the Browser (XPiNC being a firefox browser inside Notes). If for example, a PDF plugin is installed in the browser and the servers sends the corresponding "application/pdf" mime-type with the file, the browser uses that plugin to display the file. The correlation between mime-type and plugin or external application in the browser is something the server/webapplication can not influence.

What you can do on the server side is sending the mime-type "application/octet-stream" instead of the one corresonding to the file type, causing the browser to display the "Select application or download" dialog. So in Xpages, you would have to redirect the download through a XPage, where you set the corresponding HTTP Headers as shown in Set cache headers on an XPage and How to force PDF files to open in browser?

the issue is with XPiNC, not XPages in a normal web browser.

xpinc - xpages File Download control - open instead of save? - Stack O...

xpages xpinc
Rectangle 27 0

Try some of these other ways of getting a handle on a database:

This one uses "" instead of the null parameter to indicate current server:

This one uses database.getServer() instead of the null parameter:

This one uses sessionAsSigner to get access to the database (instead of using the credentials of the current user):

var dbOther:NotesDatabase = sessionAsSigner.getDatabase(database.getServer(), doc.getItemValueString("Database"))

Are you using a Lotus Notes 8.5.3 client?

Hi, I tried each solution you suggested, the one that fixed the problem was to use database.getServer(). Thanks for all your help

The reason database.getServer() is the solution is based on the question "What is the current server?". 'null' and '""' are used for the current server. Within a browser the current server is the server running your application. But within XPiNC the current server is your local machine, because the local XULRunner is the server that provides your XPages. If you don't have a local replica of your database you must tell Notes which server to use.

xpages - Unable to reference a view in another database from XPiNC - S...

xpages xpinc
Rectangle 27 0

Another way to do this would be to have a third page which is the launch page. This page would just have a beforePageLoads event that looks at the user roles and then does a context.redirectToPage("/otherpage.xsp") depending on the role detected.

This was the perfect solution and only took a few lines of code. Get the Role, test for each possibility and open the correct page based on the results.

One more suggestion. On the other pages you should do the reverse. Check to see if the person has the role for that particular page, if they don't send them back to the launch page. This way if somebody emails the url of one of the pages to somebody without the role they can't get into it.

Thanks Dec. I redid the entire app over the weekend to get it to work on one XPage instead of requiring two.

In an XPiNC app, how can I launch one XPage vs. another based on Role ...

xpages xpinc
Rectangle 27 0

The documentation is in the XPages Extension Library Book, which is great (I had forgotten to look there. However, because it is such a core issue I would have hoped to find it in the IBM on-line documentation. While I think that the XPages Extension Library book is an essential part of an XPages Developers Library I find IBM's documentation to be lacking. Searching the web (and I do that a lot) we can find bits and pieces but many core issues are really hard to find.

installation - Documentation on how to deploy the extension library to...

installation xpages xpages-extlib xpinc
Rectangle 27 0

One option you could try is that add your own HTML img tag something like this:

<img url="/.ibmxspres/domino/icons/vwicn___.gif">

In your case you would have to render this code specifically using a computed text.

<xp:text escape="false" disableTheme="true">
    <xp:this.value><![CDATA[#{javascript:<YOUR CODE>}]]></xp:this.value>
</xp:text>

xpinc - xpages Column icon not shown in Notes Client - Stack Overflow

xpages xpinc
Rectangle 27 0

XPiNC (XPages in Notes Client) uses XULRunner (=embedded Firefox, unfortunately not the latest version) to render its content. It is rather restrictive in what it shows. There are some goatchas around ports, but that doesn't seem your problem here. You might need to investigate proxy settings. If everything fails, you could use a backend class to download the image and use the binary data (no need to save to disk) as image source.

thanks Stephan, I could not get to the bottom of it, but downloading and attaching the images instead seemed to be a good solution also from other considerations

Did you download them to a file or use the "inline" method: en.wikipedia.org/wiki/Data_URI_scheme ?

I download as a file, attached and computed the link. reasonably straightforward and safer than rely on some images on internet out of my control. Well, on client now they are fine, but some of them are not showing up on server - a routine investigation :-) Inline sounds clever, but having them as a file - they can be easier re-used for other purposes.

well as it turns out java.net.URLEncoder encodes spaces as "+", so I still had to replace those manually... now it's tip-top

display external/linked image in XPage on Notes client - Stack Overflo...

xpages lotus-notes
Rectangle 27 0

Easiest one is to specify in your Form properties "open xpage instead" Second option is to specify a URL link pointing to it with the href=notes://server/.... You might be better off using mime mail (snippets for that on OpenNTF) since you have easier formatting options

this is the way to do it, but beware of problems, if such document/form is opened by native Domino URL format in browser - stackoverflow.com/questions/10802986/

Frantisek is right. So when you do MIME messages, you want to use the ...nsf/myPages.xsp&unid... format

lotusscript - How to link to an xpage in email? - Stack Overflow

xpages lotusscript xpinc
Rectangle 27 0

You are stuck between a rock and a hard place. XPiNC and classic Notes don't mix that easily. But there is hope. Head over to the Composite Application Wiki. There you will find that you can open a composite instead of a document which allows you to have tabs and stuff inside a composite.

It is also the way a classic application and a XPages (publish/subscribe using the property broker) can exchange data. Make sure you read the comments too. Karsten has good further links.

I don't have a working example for what you exactly want to do, but Composite feels like the best bet you have.

Thanks Stephan, but I think that adds a level of complexity I was hoping to avoid - a better solution for me might be to move further towards XPages or open in a browser.

Thanks Per, I had read two of them, but the third one (with your comments and code) somehow escaped me. I still can't get it working though. In the original notes form I've changed the button to client javascript, thinking that this might help. I'm going with window.open(url) from a button on my notes form. In the XPage that is opened, I've got a button with window.close() in it, but it isn't closing the window.

xpages - Opened new document in xpinc. How to close window or redirect...

xpages xpinc
Rectangle 27 0

It is true that remote applications (NSFs residing on a non-local server) are slower than local client replicas or remote apps run in a web browser. This is due to the fact that a lot more network transactions are generated when running in this mode. There are various things that can be done however to remedy the problem.

First however we need to identify the cause of the problem - you are seeing a 10MB transfer for each GET request, which is very large and will obviously negatively impact performance. One or more of the XPages in your application may be using the computeWithForm feature? If an XPages document data source "computes" a Notes form (typically to execute pre-existing application logic) then the form must be copied across the net to be computed in the local client. However all children of the form will also be hauled over - subforms, shared fields etc, and this can result in large net transactions like those you are seeing.

Often the computeWithForm feature is used as a development convenience and as long as the size of the form is small then the performance impact can be negligible. However, if the aggregate form is large, then it may be worth your while replacing the computeWithForm usage with separate XPages SSJS application logic.

Before going further we would need verify that this is in fact the issue - there could be other issues. Typically this manifests only on pages that open/edit documents - so you can maybe try turning computeWithForm off in a test environment and see if there is a difference.

xpages - Access directly to server with XPINC...very very slow - Stack...

xpages xpinc
Rectangle 27 0

XPiNC is a little special. When you open a server based NSF, all the program code needs to be downloaded to the client to be executed in the server container of the Notes client. The reasonable way to use an XPiNC with data in the server is to split the application. Have one NSF that contains all the program logic (all XPages and other code) and the other with forms, views and documents. Replicate the application NSF locally and access only the data on the server. This should give you much better performance. You could have a configuration setting to compute the data NSF, so disconnected users could use a local replica of the data.

xpages - Access directly to server with XPINC...very very slow - Stack...

xpages xpinc
Rectangle 27 0

It is possible to execute CSJS from SSJS with view.postScript().

<xp:button value="client" id="button3">
        <xp:eventHandler event="onclick" submit="true" refreshMode="partial" disableValidators="true">
            <xp:this.action><![CDATA[#{javascript:var url = myJavaClass.createNewDocumentAndReturnNotesUrl(); view.postScript("window.open('" + url + "')");}]]></xp:this.action>
        </xp:eventHandler>
    </xp:button>

CSJS function window.open(url) is executed from SSJS after creating document in other database and getting back the URL for the new document. This way, the code is only executed when button is clicked and new document opens in a new window.

<xp:button value="client" id="button3">     <xp:eventHandler event="onclick" submit="false">         <xp:this.script> 			<![CDATA[window.open('#{javascript:myJavaClass.createNewDocument();}')]]> 		</xp:this.script>     </xp:eventHandler> </xp:button>

You'r welcome, I am happy we could finaly find the solution

How to open a classical Notes document in a new client tab, triggered ...

xpages lotus-notes xpinc
Rectangle 27 0

I would transform the replica ID to the server!!path-to-nsf format. Try to get first the local database with db.openByReplicaID("", repID). If this fails, try to open the database on the server.

With the resulting object build the server!!path-to-nsf string and use this instead

Little challeng: NotesDatabase.getFilePath() returns C:\Users\notessensei\development\test.nsf when my data directory is c:\Users\notessensei\notes\data and contains development.dir that points to the directory above. XPages seems to require development\test.nsf as path

xpages - How to force the local database to be used when using replica...

xpages xpinc
Rectangle 27 0

Adding the following Css in to xpage, can resolve alignment issue of Date picker in Notes 9 xpinc.

<style type="text/css">
     .xspInputFieldEditBox > div {
  width:auto;
}
</style>
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core"
    xmlns:xe="http://www.ibm.com/xsp/coreex">
    <style type="text/css">
     .xspInputFieldEditBox > div {
  width:auto;
}
</style>

    <xp:inputText id="inputText1" value="#{viewScope.inputText1}"
        defaultValue="#{javascript:@Now()}">
        <xp:this.converter>
            <xp:convertDateTime type="date" />
        </xp:this.converter>
        <xp:dateTimeHelper />
    </xp:inputText>
    </xp:view>

Even with change of theme such as One UI V2, 2.1, web standard you can resolve this issue

datepicker - xPages date field in IBM Notes 9, the Default value not s...

datepicker xpages xpinc
Rectangle 27 0

<?xml version="1.0" encoding="UTF-8"?>
 <xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xe="http://www.ibm.com/xsp/coreex">

<xp:this.beforeRenderResponse><![CDATA[#{javascript:viewScope.DateEntered = viewScope.DateEntered || @Yesterday();}]]>
    </xp:this.beforeRenderResponse>
<xe:formTable id="formTable1" formTitle="Sample date input"
    formDescription="Test for date functionality">
    <xe:formRow id="formRow1" for="inputText1" label="Please enter a date:"
        labelPosition="left">
        <xp:inputText id="inputText1"
            value="#{viewScope.DateEntered}">
            <xp:this.converter>
                <xp:convertDateTime type="date"></xp:convertDateTime>
            </xp:this.converter>
            <xp:dateTimeHelper></xp:dateTimeHelper>
        </xp:inputText>
    </xe:formRow>
    <xe:formRow id="formRow2" for="inputText2" label="Please enter some Text:"
        labelPosition="left">
        <xp:inputText id="inputText2"
            value="#{viewScope.textEntered}">
        </xp:inputText>
    </xe:formRow>
</xe:formTable>
</xp:view>

Works flawless. How does your code look like? If you use data binding, then NO default value is pulled from the control's properties, but the value provided by the variable the control is bound to. Binding always trumps defaults.

When I look at the page source (that what gets generated in the client in this case - which you can see on the machine where your Domino designer is installed, then I get:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="/xsp/.ibmxspres/.mini/css/2Ojcore.css&amp;2Ojdojo.css&amp;2OldefaultTheme.css&amp;2OldojoTheme.css&amp;@Da&amp;@Ib&amp;@Th&amp;@Ti.css">
<script type="text/javascript" src="/xsp/.ibmxspres/dojoroot-1.8.0/dojo/dojo.js" djConfig="locale: 'en-us', parseOnLoad: true"></script>
<script type="text/javascript">dojo.registerModulePath('extlib', '/xsp/.ibmxspres/.extlib');</script>
 <script type="text/javascript" src="/xsp/.ibmxspres/.mini/dojo/.en-us/@Eya&amp;@Ie&amp;@Iu.js"></script>
<script type="text/javascript">dojo.require('ibm.xsp.widget.layout.xspClientDojo')</script>
<script type="text/javascript">dojo.require('ibm.xsp.widget.layout.xspClientRCP')</script>
<script type="text/javascript">dojo.require('dojo.parser')</script>

<script type="text/javascript">dojo.require('extlib.theme.OneUIA11Y')</script>
<script type="text/javascript">dojo.require('ibm.xsp.widget.layout.DateTextBox')</script>
</head>
<body class="xsp lotusui tundra">
<form id="view:_id1" method="post" action="/xsp/My2003Xpages.nsf/Test6.xsp?1367936627%3FOpenXPage&amp;xspRunningContext=Notes" class="lotusForm" enctype="multipart/form-data">
<fieldset id="view:_id1:formTable1">
<table class="lotusFormTable" role="presentation" cellpadding="0" cellspacing="0" border="0"><tbody>
<tr><td class="lotusFormTitle" colspan="3"><h2>Sample date input<div class="lotusMeta">Test for date functionality</div></h2></td></tr>
<tr class="lotusFormFieldRow"><td style="width:15%" class="lotusFormLabel"><label for="view:_id1:inputText1">Please enter a date:</label></td><td><input type="text" value="2013-05-06" id="view:_id1:inputText1" name="view:_id1:inputText1" class="xspInputFieldDateTimePicker" dojoType="ibm.xsp.widget.layout.DateTextBox" iconStyleClass="xspInputFieldDatePickerIcon" constraints="{datePattern:&quot;MMM d, yyyy&quot;,timePattern:&quot;h:mm:ss a&quot;,selector:&quot;date&quot;}">        <td></td></td></tr>
<tr class="lotusFormFieldRow"><td style="width:15%" class="lotusFormLabel"><label for="view:_id1:inputText2">Please enter some Text:</label></td><td><input type="text" id="view:_id1:inputText2" name="view:_id1:inputText2" class="xspInputFieldEditBox"><td></td></td></tr>
</tbody>
</table>

</fieldset>

<input type="hidden" name="$$viewid" id="view:_id1__VUID" value="!dgw05ue5xc!">
<input type="hidden" name="$$xspsubmitid">
<input type="hidden" name="$$xspexecid">
<input type="hidden" name="$$xspsubmitvalue">
<input type="hidden" name="$$xspsubmitscroll">
<input type="hidden" name="view:_id1" value="view:_id1"></form>
<script type="text/javascript">

XSP.addOnLoad(function() {
XSP.attachValidator("view:_id1:inputText1",null,new XSP.DateConverter("MMM d, yyyy","This field is not a valid date."));
}); 

</script>
<input type="hidden" id="XspBridgeIn">
<input type="hidden" id="XspBridgeOut">
</body>
</html>

If change Application theme to One UIV2, ONE UIV2.1, web standard, The date picker aligned properly and able to see good in xpinc. But if Application theme is server default or One UI, it looks bad in xpinc.

datepicker - xPages date field in IBM Notes 9, the Default value not s...

datepicker xpages xpinc
Rectangle 27 0

To further my comments, this is a work around I use the below code for an app that uses the bootstrap extension library on the web but uses basic functionality with xpinc.

If the values for xPinc are different you could make the confirm action different in the browser and in the client.

if (@ClientType()== "Notes")
{
<action>;
}
else{
<action>;
}

I think that profile documents are a bad idea in xPages though. Having to restart HTTP to get a new value ruins the point I think. Almost better to hard code values at that point. I think you can set application scope to handle the work of profile documents. But then application scope in xpinc is just on the current machine as the server is the client.

xpages: compute Confirm Action confirmation text does not work in XPiN...

xpages
Rectangle 27 0

Look at a normal client installation (not Designer) - the icons are not there. You need to add them into resources

xpages - XPiNC view icons - Stack Overflow

xpages
Rectangle 27 0

To further my comments, this is a work around I use the below code for an app that uses the bootstrap extension library on the web but uses basic functionality with xpinc.

If the values for xPinc are different you could make the confirm action different in the browser and in the client.

if (@ClientType()== "Notes")
{
<action>;
}
else{
<action>;
}

I think that profile documents are a bad idea in xPages though. Having to restart HTTP to get a new value ruins the point I think. Almost better to hard code values at that point. I think you can set application scope to handle the work of profile documents. But then application scope in xpinc is just on the current machine as the server is the client.

xpages: compute Confirm Action confirmation text does not work in XPiN...

xpages
Rectangle 27 0

I found a partial solution, Java is your friend. It works in a button should work in a link too. The only problem is when called from an event like onClose the current xpage looses focus and the current pages stays open. I tried to emulate send keys and it presses the ESC key. It works fine from a button in. Button on CLick event

<xp:button value="Label" id="button1">
    <xp:eventHandler event="onclick" submit="true"
        refreshMode="complete">
        <xp:this.action><![CDATA[#{javascript:var robot:java.awt.Robot= new java.awt.Robot;var event:java.awt.event.KeyEvent=java.awt.event.KeyEvent;
enter code here
</xp:eventHandler>
</xp:button>

xpages - Opened new document in xpinc. How to close window or redirect...

xpages xpinc
Rectangle 27 0

Only if the page is opened by window.open, then window.close works fine. otherwise it does not work. Please see the following question, same question has already appeared in stackoverflow.

And I am also searching the fine solution for this problem.

javascript - How to close xpages in notes client? I use CSJS window.cl...

javascript xpages xpinc
Rectangle 27 0

Add a title to your XPage at Properties tab "XPage". You can add a string there or calculate a title.

The title is visible in XPiNC and browser.

If you want to set the same title to all XPages then define it in a theme: http://stackoverflow.com/a/11802089/2065611.

Thanks, @Knut. Btw, is there any chance to add a title globally no matter what XPage users are selecting ?

Yes, you can define a session scope variable and refer to it with pageTitle="#{sessionScope.PageTitle}" or you can use a managed bean with a methode getPageTitle() and use it with pageTitle="#{yourBean.PageTitle}"

And the field which use the scoped variable can be declared anywhere , on any xpage/custom control? I can not add some default value for my field which use the scoped variable... arhhh

Yes. Or, you define a title for all XPages in a theme. I added a link to my answer.

xpinc - xpages how to set title to be displayed in browser window - St...

xpages xpinc