I cannot get the iNotesCalendar control to work.
It works in a tearoom.nsf. But if I put the controls in normal mail.nsf I always get a blank calendar.
I can get JSON via a web browser. Looks like this:
My code is this:
<?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">
<xe:restService
id="restService1"
pathInfo="/inoteslegacyjson"
preventDojoStore="false">
<xe:this.service>
<xe:calendarJsonLegacyService
viewName="calendarOutline"
var="entry"
contentType="text/plain"
colCalendarDate="CalDateTime"
colStartTime="StartDateTime"
colEndTime="EndDateTime"
colSubject="For"
colChair="Chair">
</xe:calendarJsonLegacyService>
</xe:this.service>
</xe:restService>
<xp:br></xp:br>
<xe:calendarView
id="calendarView1"
jsId="cview1"
type="#{javascript:sessionScope.dateRangeActions_selectedValue}"
storeComponentId="restService1"
style="width:100%">
<xe:this.summarize>
<![CDATA[#{javascript:summarize = sessionScope.calendarFormatActions_selectedValue == "true";}]]>
</xe:this.summarize>
</xe:calendarView>
</xp:view>
You'd like to present the calendar view as iNotesCalendar for a normal mail database which is based on mail.ntf.
Your question's example is designed for and works with the teamroom.nsf. It uses a specialized view "calendarOutline". All calendarJsonLegacyService's properties which start with "col" define the specific column names of this view. So, you can't really use this example to read a "normal" calendar view of a mail database.
Luckily, all calendarJsonLegacyService properties' default values are dedicated to the "normal" calendar view "($Calendar) | Calendar" of mail boxes.
Change your code this way:
delete all "col..." parameters
change viewName property to "Calendar"
add property databaseName with value "yourServerName!!pathToMailDatabase.nsf"
Your restService would look like this then:
<xe:restService
id="restService1"
pathInfo="/inoteslegacyjson"
preventDojoStore="false">
<xe:this.service>
<xe:calendarJsonLegacyService
viewName="Calendar"
contentType="text/plain"
databaseName="Server1!!mail.nsf">
</xe:calendarJsonLegacyService>
</xe:this.service>
</xe:restService>
Your code for xe:restService and xe:calendarView looks similar to what I use.
I have experienced issues with using xe:calendarView with Internet Explorer 11. The problem is that the calendar is empty - exactly as what you experience. In order for it to work with IE11 I force IE11 to act as IE10 by setting the X-UA-Compatible to "IE=10".
Related
Design pattern in my Xpages application looks like below. When I in list view, I want to call dominoDocument1 for print and expect return null, because dominoDocument do not have key(documentId in url), but return UNID.I want this behavior for global custom control what can delete how in view mode and how in form mode. In form_toolbar component I what do something with dominoDocument and that`s why my dominoDocument define above another components.
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core"
xmlns:xc="http://www.ibm.com/xsp/custom">
<xp:this.data>
<xp:dominoDocument var="dominoDocument1" formName="sample"
concurrencyMode="force" action="openDocument">
<xp:this.databaseName><![CDATA[#{javascript:var object1 = new SamplesDB();
object1.getDBPath();}]]></xp:this.databaseName>
</xp:dominoDocument>
</xp:this.data>
<xp:this.resources>
<xp:script src="/dbClass.jss" clientSide="false"></xp:script>
</xp:this.resources>
<xc:resources></xc:resources>
<xc:global_left_sidebar></xc:global_left_sidebar>
<xc:layout_content>
<xp:this.facets>
<xc:form_toolbar xp:key="sample_form"></xc:form_toolbar>
<xc:view_toolbar xp:key="sample_view"></xc:view_toolbar>
<xc:form_toolbar xp:key="sample_to_researches_table"></xc:form_toolbar>
</xp:this.facets>
</xc:layout_content>
<div class="container-fluid">
<div class="row">
<xc:layout_content>
<xp:this.facets>
<xc:sample_form xp:key="sample_form"></xc:sample_form>
<xc:sample_view xp:key="sample_view"></xc:sample_view>
<xc:cc_sample_to_researches_table
xp:key="sample_to_researches_table">
</xc:cc_sample_to_researches_table>
</xp:this.facets>
</xc:layout_content>
</div>
</div>
</xp:view>
w>
First, create the XPages application as a stand alone NSF for only one purpose, a web UI, and leave all the legacy Notes and new NSF data as data repositories for the UI.
-XPages UI NSF-
I think its best to create a 'Managed Bean' in faces-config, such as App.java and name it 'app'. Then create a DominoService.java that gets and sets data to the database NSF.
Design Java model objects, plain old Java objects that are in between the NSF and XPages UI. Reuse in other XPages projects.
On start, the server instantiates the Java objects in faces-config.
You also can can add Action Listeners to events that will do some work like get all documents from a view and return a ArrayList and that 'persons' is what is the in the 'value' property of a <xp:repeat /> or <xp:table /> component.
You will will want your XPages UI components to bind to Plain Java objects and lists for data.
The benefit you can always switch out the backend, for example, instead of writing and reading from a Key/Value pair NSF data store you can create a NoSQLHelper.java or SQLHelper.java and implement the same methods from the DominoService.java and the UI does not change.
I cant find a solution for this problem. I am using design definitions for almost all my controls.
They are working fine the only problem i have is that if i am computing one of the properties i cant use the property anymore in the design definition. It will create a text in red and the xpages will prompt some error messages.
Is there a way to ask if the property is computed and show a standard text instead.
This is the design definition.
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xc="http://www.ibm.com/xsp/custom">
<xp:inputText type="text" value="<%=this.field_name %>"></xp:inputText>
</xp:view>
Whenever the value of the property field_name is computed in the custom control it brings up that error.
Anybody any ideas?
When I insert the Field custom control with a static text value for field_name, the design definition will display the field_name properly.
<xc:Field field_type="text" field_name="myfield_1"></xc:Field>
If I insert the Field custom control with a computed text value for field_name, it doesn't:
<xc:Field field_type="text"><xc:this.field_name><![CDATA[# {javascript:"myfield_"+#Text(1)}]]></xc:this.field_name>
</xc:Field>
Make sure field_name is the exact name of the property passed in as CompositeData. For example, I was able to reference the string property 'create' to create the image of field this way:
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:inputText value="<%=this.create%>">
</xp:inputText>
</xp:view>
So, I suspect it's a typo, a missing property, or not a string.
I am using a navigator control from the extension library. I want to use the default styling where only the selected item is highlighted and all the others are not highlighted and show the pointer cursor. For some reason it is applying the class "lotusSelected" to all the navigator nodes which are rendered as list items <li>.
I know that the "selected" property of tree nodes controls this. It does the same whether the property is set to true, false, or nothing. I am not trying to do anything fancy here, just use the default behavior. There is nothing in the custom css or theme to override this.
This happens on all browsers. Using Chrome tools I can see that removing the class causes the behavior I want. The navigation opens an XPage and changes a dynamic content control, this all works. This is used inside of the application layout control.
<?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">
<xe:navigator id="navigator1" expandable="false">
<xe:this.treeNodes>
<xe:pageTreeNode label="Add New ATM"
page="/xpSupervisor.xsp" queryString="content=newATM">
</xe:pageTreeNode>
<xe:pageTreeNode label="Update ATM Information"
page="/xpSupervisor.xsp" queryString="content=updateATM"
selected="false">
</xe:pageTreeNode>
<xe:pageTreeNode label="One Time Settlement Amount Change"
page="/xpSupervisor.xsp" queryString="content=changeSettlementAmt"
selected="false">
</xe:pageTreeNode>
</xe:this.treeNodes>
</xe:navigator></xp:view>
UPDATE: It seems to be some conflict between the pageTreeNode and the way I created the dynamic content control. It only messes up when on that one Xpage. Here is the code for that:
<?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"
xmlns:xc="http://www.ibm.com/xsp/custom">
<xe:dynamicContent id="dynamicContent1" useHash="true"
defaultFacet="default">
<xp:this.facets>
<xc:ccSupervisorHelp xp:key="default"></xc:ccSupervisorHelp>
<xc:ccNewATM xp:key="newATM"></xc:ccNewATM>
<xc:ccUpdateATM xp:key="updateATM"></xc:ccUpdateATM>
<xc:ccChangeSettlementAmt xp:key="changeSettlementAmt"></xc:ccChangeSettlementAmt>
</xp:this.facets>
</xe:dynamicContent>
</xp:view>
If I'am right, all nodes are selected because all nodes has the same page page="/xpSupervisor.xsp" as aim.
So if the page xpSupervisor.xsp is open, the navigator renders the nodes as select.
The property selected is only a boolean value, indicating whether the pageTreeNode is selected or not.
You should take a look at the property selection. This property is used in conjunction with navigationPath in the applicationLayout control. The property selection can take regular expressions to determine the selection state.
Despite two good answers which go me closer, I could not get the menu to work using the pageTreeNode. The fix was to switch to using a basicLeafNode and use a submittedValue and open the correct page in the onItemClick event of the navigator. I also added code in the 'selected' property to calculate which menu item was selected.
I could not get the context.getSubmittedValue() method to work in the selected property. I overcame this by setting it to a sessionScope var in the event. (viewScope didn't work for some reason)
<xe:basicLeafNode label="Update ATM Information" submitValue="updateATM">
<xe:this.selected><![CDATA[#{javascript:if(sessionScope.menuValue == "updateATM"){
return true;
} else {
return false;
}}]]></xe:this.selected></xe:basicLeafNode>
This is the code in the onItemClick that opens the correct link:
sessionScope.menuValue = context.getSubmittedValue();
if (sessionScope.menuValue == "newATM") {
context.redirectToPage("xpSupervisor.xsp?content=newATM");
} else...
The bottom of page 244 of the Extension Library book confirms this problem without offering a fix. Even though I have the book, hopefully this searchable answer will help others avoid the hassle I went through.
Has anyone noticed an issue with datacontexts in xpages. In certain scenario a single xpage with multiple custom controls would result in the datacontext being evaluated 12 times during a single page load?? Does this happen with other dataSources as well?
Here is a simple example, which gets executed 3 times!!
<?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.dataContexts>
<xp:dataContext var="doc1">
<xp:this.value><![CDATA[#{javascript:var doc:NotesDocument = database.createDocument();
doc.replaceItemValue("Form", "frmContact");
doc.replaceItemValue("fldFirstName", "test");
print("got here");
return doc;}]]></xp:this.value>
</xp:dataContext>
</xp:this.dataContexts>
<xp:inputText id="inputText1" value="#{doc1.fldFirstName}"></xp:inputText>
</xp:view>
Should I not be using dataContexts in my application?
And also watch out, if you are using partial refresh. Let's assume, you datacontext is in id B and you do a refresh on id A. The datacontext in id B will also be refreshed. Also happens to all other data sources.
I have described this behaviour here http://www-10.lotus.com/ldd/xpagesforum.nsf/topicThread.xsp?action=openDocument&documentId=56E9B8537DA50A90852579A6002EAC64#FA00DE3675A456C0852579AB005A1FF4
And there are also some hints about a PMR and a possible workaround for this.
Just like other controls on the page, the datacontext could be evaluated multiple times. See here for more information about the benefits of dataContexts. But in my opinion, from your code example, it could be faster to use a xp:data source but I'm not sure.
As with all other value bindings, if you change the # to a $, the value attribute of the dataContext may be requested multiple times, but the calculation to determine that value will only be executed once.
I was wondering if someone could help me out with Sharepoint 2007. What I want to do is to add a custom menu item to a context menu (the menu that opens when you click a document or another item).
Right now, the menu looks like this:
picture
I want to add an item, "Do stuff" for example, to this menu. Major problems:
I wish this item to appear only in menus for a certain file type (e.g. only for .html but not for .doc);
When I click this item ("Do stuff"), I want to call custom external code (written in C#, either an exe or a DLL), which accepts the name of the clicked file as an input parameter.
I understand the way to achieve this is by using Custom Actions (no javascript editing required in 2007, right?). But since I'm quite new to MOSS, I'm a bit lost and not sure what exactly to do and where to start, so any help is greatly appreciated.
You have to implement a CustomAction like this:
<CustomAction
Id="YourUniqueId"
Location="EditControlBlock"
RegistrationType="FileType"
RegistrationId="html"
Sequence="20"
Title="The text you want">
<UrlAction Url="~site/_layouts/company/ActionPage.aspx?List={ListId}&ID={ItemId}" />
</CustomAction>
What you put in the Url of UrlAction depends on what you want to do. It can be JavaScript or the url of a Page or Handler.
In my example it's a Page which gets the QueryParameters so that SPContext.Current.ListItem will contain the selected documents listitem.
<?xml version="1.0" encoding="utf-8"?>
<Elements Id="d0574a32-59ce-4561-9496-ccf17da37a35" xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction Id="Test2"
Location="EditControlBlock"
RegistrationType="FileType"
//docx = documents, txt = text files, html = html files**
RegistrationId="docx" Sequence="10"
Title="View Item Properties">
<UrlAction Url="~site/_layouts/WSSHOL/ViewPageRedirect.aspx?listid={ListId}&itemid={ItemId}" />
</CustomAction>
</Elements>