When using the enableModifiedFlag you can set a custom message in modifiedMessage. However, in the prompt the rest of the text is in English:
Are you sure you want to navigate away from this page? and
Press OK to continue, or Cancel to stay on the current page.
Is there a way to translate this text or have it to follow localization?
Cannot confirm this:
in a localized xpages application I just defined the properties enableModifiedFlag = true and entered some fixed string in "modifiedMessage":
<xp:view xmlns:xp="http://www.ibm.com/xsp/core"
modifiedMessage="Wollen Sie wirklich speichern?"
enableModifiedFlag="true">
This automatically genereates the corresponding entries in both property files for localization "xpageName.properties" and "xpageName_en.properties" as follows:
/xp\:view[1]/#modifiedMessage=Wollen Sie wirklich speichern?
and
/xp\:view[1]/#modifiedMessage=[en| Wollen Sie wirklich speichern? ]
(as you see my source language is [de] with [en] being the secondary language). The application propreties are set accordingly (see screenshot)
Related
This is just out of curiosity: looking for some other type of property inside an xpage I stumbled upon "All properties > data > properties". This is a complex prop, multiple parameter elements can be added in sets of name > value pairs.
I tried to add a sample parameter here resulting in
<xp:this.properties>
<xp:parameter
name="param"
value="val">
</xp:parameter>
</xp:this.properties>
Rendering that page in a browser shows no changes at all, neither in the page's html source nor somewhere in the http headers, DOM trees etc.
Can anyone shed a light what this property set could be used for?
The xp:view this.properties accepts xsp.properties options like the Xsp Properties editor in an application in Domino Designer, and like the options in the file C:\Domino\data\properties\xsp.properties.sample
For example:
<xp:this.properties>
<xp:parameter name="xsp.client.validation" value="false"></xp:parameter>
</xp:this.properties>
will disable client-side validation for the current XPage, so that only server-side validation occurs.
Some options will be ignored when set in the xp:view on an XPage, e.g.
xsp.theme=oneuiv3.0.2
can only be set in the application xsp.properties or in the server-wide xsp.properties, and will be ignored if it is set in the per-XPage xp:view this.properties.
How do you disable the CkEditor for Rich Text fields so you only render a basic <texarea> tag with no editor whatsoever?
I'm sure I must be missing something obvious but I don't see to be able to create a document using an XPage with a field stored as RT without using the CkEditor. I want to be able to prompt the user to enter 'a lot' of text but only via a simple multiline input and have that stored as RT.
If I have a..
form with a RT field
an XPage with a xp:inputTextarea control bound to said field
a save button
a documentdatasource linked to that form
on save the document is created with the field value but it's stored as text rather than RT. Adding in computeWithForm to the dds properties doesn't help.
Is the only way to have some kind of querysave or custom converter to manually turn it into RT?
If I use the xp:inputRichText control it saves fine as RT but I don't want the CkEditor in the UI, just a basic . Is there a someway to do a editor=plain to the xp:inputRichText control?
I've been looking at trying to override the dojoType or renderType with no luck
Thanks!
You can use <xp:customConverter> in <xp:inputTextarea> to convert the text to rich text item.
For getAsObject you would write this code (document1 is your data source):
var rtitem:NotesRichTextItem = document1.getDocument().createRichTextItem("rtfield");
rtitem.appendText(value);
return null; // Return null as field has already been created
And for getAsString you would simply fetch the contents of rich text field and textual value.
value.getContentAsText()
The variable value is a standard variable which contains the actual value of the field. So you code for <xp:inputTextarea> would look something like this:
<xp:inputTextarea id="inputTextarea1" value="#{document1.rtfield}">
<xp:this.converter>
<xp:customConverter getAsString="#{javascript:value.getContentAsText()}">
<xp:this.getAsObject><![CDATA[#{javascript:var rtitem:NotesRichTextItem = document1.getDocument().createRichTextItem("rtfield");
rtitem.appendText(value);
return null;}]]></xp:this.getAsObject>
</xp:customConverter>
</xp:this.converter>
</xp:inputTextarea>
NOTE: If you wish to update the rich text field using the text area then you need to write additional code in getAsObject
I am not sure how to manipulate the field type. I assume that Domino know what is going on with the control in much the same way that the custom controls are formatted to match the content type. You might be able to force the content type.
I can present this as an alternative. You can do a custom toolbar in the ckeditor to remove the toolbar and make it appear like a normal text field. There may be UI complications with doing so though. You would also have a status bar to contend with to make it appear as a plain white box. There should be another dojo attribute type for this.
This code will give you a rich text box with no toolbar
<xp:inputRichText id="inputRichText1"
value="#{document1.content}">
<xp:this.dojoAttributes>
<xp:dojoAttribute name="toolbar">
<xp:this.value><![CDATA[#{javascript:var myToolbar = "[['']]";
return myToolbar}]]>
</xp:this.value>
</xp:dojoAttribute>
</xp:this.dojoAttributes>
</xp:inputRichText>
I like to create an XPage which have the same usability in the save behavior like a notes document, special I like to realize the SaveOptions behavior 'When the User change something, the system remember him to save and if the user save, the system to not remember him'.
I found out a 50% solution, over the data->enableModifiedFlag property the system recognized if the user change something in the document and if so post the string that is stored in the data->ModifiedMessage property.
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" enableModifiedFlag="true">
<xp:this.modifiedMessage><![CDATA["please Save"]]></xp:this.modifiedMessage>
</xp:view>
But if I save the Document in the datasource and like to leave the site, the post still occur.
How could I realize that when the XPages-Doc is different to the dataSourceDoc the post occur, and if the XPages-Doc is equal to the dataSourceDoc, the Post not occur?
enableModifiedFlag allows you to refine the functionality.
Custom Controls also have an enableModifiedFlag, which should allow you to give a message only if something in that custom control has changed.
Individual input controls have a disableModifiedFlag that can be set to true, to ensure that particular control is ignored when identifying if the page has been modified or not.
A Button of type "Cancel" will ignore enableModified and just move on.
You can also programmatically set or clear the modified flag in CSJS (XSP._setDirty(false,""). There is also a view.setEnableModifiedFlag(boolean) method that can be used to change the enableModifiedFlag property on an XPage from SSJS.
Panels don't have an enableModifiedFlag or disableModifiedFlag property, but with the options I mentioned it should give you the control you need.
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.
I've spent days trying to figure this out and I give up.
I am a LotusScript programmer and have been trying to learn XPages. All of the examples and sample programs I've studied only touch on pieces of this.
Can someone explain to me step by step how to use the Selected property of the Extension Library Navigator control?
I have created my own custom control based on the layout control from the Extension Library and created a custom property called navigationPath. I also created a navigator custom control that has 5 Page Link Nodes. In the "Selected" property of each Page Link Node, I put the following SSJS:
if(compositeData.navigationPath == "/Home/ApplicationPool"){
return true
}else{
return false
}
/Home/ApplicationPool corresponds to the value I put in the "Selection" property of the particular Page Link Node.
In each layout custom control, I set the "navigationPath" property to compositeData.navigationPath.
What did I miss?
there is a selected and selection property and they mean very different things and can't be used at the same time. In the code example in your question above you are using the selected property which is the wrong one in this case.
Your treeNodes in the navigator should be setup to use the selection property, this is a RegEx value that is used to see if it matches the value passed into the application layout via the custom property.
<xe:navigator id="navigator1" expandable="true" expandEffect="wipe">
<xe:this.treeNodes>
<xe:pageTreeNode label="nodeName" page="/page.xsp" selection="/Home/ApplicationPool" />
</xe:this.treeNodes>
</xe:navigator>
As you can see you don't need to use any SSJS to evaluate a true/false outcome. Just match the value in the treeNode to the one in the XPage's applicationLayout control.
If your using tabs in the layout titleBar then you can set a selection property there also that uses the format /Home/.* which will make that tab highlighted for every XPage that have /Home/ at the start of it's navigationpath custom property. Don;t forget it is RegEx so any valid RegEx statement can be used here adding more power to this particular property.
For the tree nodes in the navigator control you define the name of the xpage to open and then the related selection. Example:
<xe:pageTreeNode page="/text.xsp" selection="/Home/Test" label="Test page">
</xe:pageTreeNode>
For the individual xpages using the applicationLayout you define a value for navigationPath. If this value matches an entry in one of the tree nodes the naviagor control, then the corresponding menu item will be highlighted in the browser. The best way to define the value of the navigationPath is by using a custom property (as you are using). Here's an example of that:
<xe:applicationLayout id="applicationLayout1">
<xe:this.configuration>
<xe:oneuiApplication navigationPath="${javascript:compositeData.navigationPath}" ...
You can see examples of using all this in the Extension Library Teamroom and Discussion templates.
Based on my explanation on how to use it, I can see that you are not using the selection property on the navigation control correct. You just need to define a unique value for each tree node (which then will be used if it matches navigationPath on the individual xpages).
So for your specific example change your selection property to just return: "/Home/ApplicationPool"