Dojo DateTime does not show correct time in XPages - xpages

When i used djTimeTextBox in XPages but it does not show the correct time. TimeZone settings of Domino Server is fine because When i save the document It's saved correctly(02.12.2017 17:00:00 ZE3) but it shows one hour before in Xpages form. I do not know how to solve this problem. I tried to solve it with ComputedField It show as is. I am having problem with Dojo Object..
//Dojo Object
<xe:djTimeTextBox id="endTime_1" value="#{document1.endTime}">
</xe:djTimeTextBox>
<xp:text escape="true" id="endTime_2" value="#{document1.endTime}">
<xp:this.converter><xp:convertDateTime type="time" ignoreUserTimeZone="true" timeZone="Etc/GMT-3" timeStyle="short"></xp:convertDateTime></xp:this.converter></xp:text>

If you are in 8.5.3 look at this
http://www-01.ibm.com/support/docview.wss?uid=swg1LO79805
http://www-01.ibm.com/support/docview.wss?uid=swg1LO71280
https://www-10.lotus.com/ldd/ddwiki.nsf/m_Home.xsp?documentId=12C120AE9296BEAD852576560044ACE1#mobileViewer

Related

Xpages Extension library name picker shows SyntaxError: expected expression, got '< when clicked

ok so I got this issue that's been a big question mark to me, I'm currently using Notes version 9.0.1 both on server and designer. I created a custom control that has a field and a name picker next to it. I created a main xsp and put the custom control there. I did not change any setting in namepicker other than the provider which I set to dominoNAB... I leave the other settings as default. I ran the main xsp and clicked on the name picker but it throws a dialog box that says SyntaxError: expected expression, got '< , the namepicker is blank and there's nothing in the notes log. Does someone experienced this? Thank you in advance for the help.
Update: This is the exact code of my namepicker
<xp:inputText
value="#{accountDocument.AcctMngr}" id="acctMngr1"
style="width:267.0px" showReadonlyAsDisabled="true">
</xp:inputText>
<xe:namePicker id="namePicker1"
for="acctMngr1" dialogTitle="Account Manager">
<xe:this.dataProvider>
<xe:dominoNABNamePicker
addressBookSel="all-public" nameList="peopleByLastName">
</xe:dominoNABNamePicker>
</xe:this.dataProvider>
</xe:namePicker></xp:td>
This is the error that shows when I click the namepicker's icon.
I used firebug to check the error and this is what I saw.
Is the user logged in to the application, and do they have access to the NAB that is being accessed? I can reproduce the dialog you are seeing when trying to use the name picker as an Anonymous user. But everything works fine when logged in as a user with sufficient NAB access.
Looking at the response from the server in Firebug, as Anonymous user it responds with the login page for the NAB. And this response can't be handled somewhere in the process of rendering the name picker. It's not a very helpful error though, it should really tell you that access is denied or something like that.
As an addendum to that, you may be better off being more explicit about what NAB to use in your picker. Instead of the generic "all-public", use something like this for example:
<xe:namePicker id="namePicker1" for="acctMngr1">
<xe:this.dataProvider>
<xe:dominoNABNamePicker nameList="peopleByLastName"
addressBookDb="names.nsf" addressBookSel="db-name">
</xe:dominoNABNamePicker>
</xe:this.dataProvider>
</xe:namePicker>

XPages and Rich Text - " Item Note already exists" error

I'm migrating a Lotus Notes application to XPages. One Lotus Notes Form has a rich text item so on the XPage I added a Rich Text control and bound it to the item on the Notes form. Now whenever I edit the XPages document and make a change in the rich text editor, on saving I get the error " Item Note already exists". Is there any way of solving this prolem? I'm using 8.5.3. The rich text field on the Notes form is called "Note". Ideally I would like to be able to edit the documents both in the Lotus Notes client and in XPages. Here is the code on my XPage:
<xp:inputRichText id="NoteRT" value="#{document1.Note}" style="height:150.0px; width:300.0px" rendered="#{javascript:currentDocument.isEditable()}">
<xp:this.dojoAttributes>
<xp:dojoAttribute name="toolbarType" value="Slim">
</xp:dojoAttribute>
</xp:this.dojoAttributes>
</xp:inputRichText>
<xp:text escape="false" id="NoteRead" rendered="#{javascript:!currentDocument.isEditable()}" value="#{document1.Note}"></xp:text>
here
http://www-01.ibm.com/support/docview.wss?uid=swg1LO67696
and here
http://cynology1.rssing.com/browser.php?indx=2286169&item=1718
you can read, that this is an error which is already fixed in fix pack2
but if you have no time to update to fp2, you could try to change the property of computeWithForm of the data from 'both' to 'onLoad' or 'onSave'.
go this way
xpages->properties->data->data->dominoDocument[0]->computeWithForm
I donĀ“t know, which is right for your case, just try it and tell us if its helped.

xpages how to force a partial refresh afterPageLoad

I asked this question a couple months ago, but there has been no response so I thought I would try again. I have a block of SSJS that manipulates a number of values. There are some computed fields that are impacted by these changes and they do not display correctly. I have a refresh button on the XPage and it does a partial refresh after which everything works fine. I need to somehow trigger a partial refresh on the a specific item (a panel in this case) as the last step in the afterPageLoad in the SSJS.
Any ideas?
Thanks
Refreshing Panels from SSJS without a button, link or something like that is a bit tricky.
But i think your problem is more located in the order in wich you are trying to compute your fields what about triggering your Code in a erlier event before those Fields are rendered, to avoid displaying the wrong values in the first place, maby post some example Code.
If you only want to refresh a the panel again after the page has bean loaded try this in the onClientLoad ClientEvent this could also fix it:
<xp:eventHandler event="onClientLoad" submit="false">
<xp:this.script><![CDATA[dojo.ready(function(){
XSP.partialRefreshGet('#{id:yourPanel}',{})
});]]></xp:this.script>
</xp:eventHandler>

XPages loading time in the Firefox with richtext

i created an XPage with an richtext editor an an datepicker.
When i open documents with this XPage and change from the read to the edit mode. It will takes (without cache) 5-10 secconds to load (chrome just take 0,5 secconds).
The problem is as you can see, it will load a lot of dojo ressources.
It only happends while the richtext editor or/and the datepicker are in the XPage.
Is there a way to tell the domino server to send the dojo lib as one compressed file?
Or is there another solution to solve this problem.
Thanks.
UPDATE
the property xsp.resources.aggregate=true does not work for this problem.
You can use "Use runtime optimized javascript and CSS ressources". This option can be found on the Application Properties, Section "XPages". This will add the parameter
xsp.resources.aggregate=true
to your xsp.properties file and enables the feature for you whole application.
Alternativly you can enable this feature for one XPage only by adding this lines to the XPages source code:
<xp:this.properties>
<xp:parameter name="xsp.resources.aggregate" value="true" />
</xp:this.properties>
finally i found the problem. It will only cause if the editbutton makes a partial update on a panel with a document and a richtext editor inside. If i make a full refresh it will load the compressed files.

Dynamically add custom control on Xpage

how can I add custom control on the basis of sessionScope variable. I try include page container control but no luck:
<xp:this.afterPageLoad><![CDATA[#{javascript:sessionScope.put("viewName","ccViewAll.xsp");}]]></xp:this.afterPageLoad>
<xp:text escape="true" id="computedField1">
<xp:this.value><![CDATA[#{javascript:sessionScope.get("viewName")}]]></xp:this.value>
</xp:text>
<xc:appLayout>
<xp:this.facets>
<xp:panel xp:key="facetMiddle">
<xp:include id="include1">
<xp:this.pageName><![CDATA[${javascript:sessionScope.get("viewName")}]]>
</xp:this.pageName>
</xp:include>
</xp:panel>
</xp:this.facets>
</xc:appLayout>
The above code give me error Error 404 HTTP Web Server: Item Not Found Exception. But when I hardcode the viewname that is ccViewAll.xsp instead of sessionScope.get("viewName"), its work fine.
-MAK
You can use the dynamic content control or the switchFacet control if you have the ExtLib for XPages. The Teamroom template (demo application that comes with the ExtLib) uses these in the "allDocuments" Xpage or the "allDocsAllTab" custom control, these are good examples to look at.
If you don't have the ExtLib you could use the loaded / rendered property of a custom control to decide which one gets loaded.
e.g.
<xp:panel key="MiddleColumn">
<xc:customControl1 loaded="${javascript: if(viewScope.control == "customControl1")}"></xc:customControl1>
<xc:customControl2 loaded="${javascript: if(viewScope.control == "customControl2")}"></xc:customControl2>
</xp:panel>
loaded = false means that nothing will be done for this control.
rendered = false means that the control will be created but hidden, you can change this later to show it.
use rendered if its going to change for example when a button is clicked and loaded when its decided at start up and won't change while the user is logged in.
If you are using this to show a different view in the domino database based on some other selection that I would suggest looking at the Extension Libraries 'Dynamic View Panel' control.
Using this control means you won't need to create different custom controls for each view that you want to use, just a single page with this control and point it to the correct view to display via a scope variable.
If you need to customize how each view displays you can create a viewControl bean to set additional properties based on the view that it is showing.
Something worth to mention is that if you don't use the ExtLib - If you're using Partial Refresh then you HAVE to use the rendered property, since the loaded property only can be calculated on pageLoad.
From my understanding this means that every custom control will be computed by the server and that's probably not something you want. (Added overhead, for one thing.)
/J

Resources