I have a traditional Notes application I am converting to XPages. In this application all of the XPages run the Page Load and Render Response events twice. I made a very simple XPage to illustrate this:
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:this.beforePageLoad><![CDATA[#{javascript:print("db1 beforePageLoad");}]]></xp:this.beforePageLoad>
<xp:this.afterPageLoad><![CDATA[#{javascript:print("db1 afterPageLoad");}]]></xp:this.afterPageLoad>
<xp:this.afterRestoreView><![CDATA[#{javascript:print("db1 afterRestoreView");}]]></xp:this.afterRestoreView>
<xp:this.beforeRenderResponse><![CDATA[#{javascript:print("db1 beforeRenderResponse");}]]></xp:this.beforeRenderResponse>
<xp:this.afterRenderResponse><![CDATA[#{javascript:print("db1 afterRenderResponse");}]]></xp:this.afterRenderResponse>
</xp:view>
When this page is loaded in the browser the following is outputted to the server console:
My xsp settings are:
xsp.ajax.renderwholetree=false
xsp.client.script.radioCheckbox.ie.onchange.trigger=early-onclick
xsp.error.page.default=true
xsp.persistence.mode=file
xsp.resources.aggregate=true
xsp.user.timezone=true
xsp.html.doctype=html
xsp.theme.mobile.pagePrefix=m_
xsp.library.depends=com.ibm.xsp.extlib.library
xsp.theme=Bootstrap3
To ensure this isn't normal behavior I made a new, empty application and created the same XPage in it and set the same xsp settings. The XPage in the new application:
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:this.beforePageLoad><![CDATA[#{javascript:print("beforePageLoad");}]]></xp:this.beforePageLoad>
<xp:this.afterPageLoad><![CDATA[#{javascript:print("afterPageLoad");}]]></xp:this.afterPageLoad>
<xp:this.afterRestoreView><![CDATA[#{javascript:print("afterRestoreView");}]]></xp:this.afterRestoreView>
<xp:this.beforeRenderResponse><![CDATA[#{javascript:print("beforeRenderResponse");}]]></xp:this.beforeRenderResponse>
<xp:this.afterRenderResponse><![CDATA[#{javascript:print("afterRenderResponse");}]]></xp:this.afterRenderResponse>
</xp:view>
When this page is loaded in the browser the output on the server console looks correct:
What would cause these events to execute twice?
After running compact -c (copy style compact) on the application the page load and render response events ran once:
It must have been some kind of corruption issue that was resovled by the compact.
Related
After a new Domino Designer Installation (newest Trail) I created a simple, simple Xpage and try to open it in a Browser (FF). The Xpage was loaded but has not HTML code. In other words its a blank page.
What did I do wrong ?
Update :
This is the XPage source code , very simple
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" rendered="true">
Hello World
<xp:br></xp:br>
<xp:comboBox id="comboBox1" style="width:82.0px">
<xp:selectItem itemLabel="Eis"></xp:selectItem>
</xp:comboBox>
</xp:view>
UPDATE :
The solution to my question was answered by stwissel givving a hint to the viewport. Indeed the viewport 80 was blocked by another program. Can' remember which one. Then I changed the viewport under preferences->Domino Designer -> Web View Port to 8080 and it works. But I doubt that this is a permanent solution.
Check if "Build automatically" is turned off. If so (recommended setting btw) just build the project manually after every change you made.
Also check if the page has the "rendered" property set to "false". This will result in an empty response though you won't get an error message.
I answer my question myself, because there are different behaviours with FireFox and Edge Browser. In another try with Edge the browser shows a 404 Eror, while FireFox did not do that. So the question finally has to be why is there a 404 Error coming up
Have you tried cleaning the project? Project >>> Clean (from the top toolbar in designer)
I have a strange bug that is reproducible but i cant find out whats causing it.
If i call this xpage i get the following error message:
Error while executing JavaScript computed expression
'fieldname' not found
<?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">
<xp:this.data>
<xp:dominoDocument var="Request"></xp:dominoDocument>
</xp:this.data>
<xp:repeat rows="999" var="fieldname">
<xp:this.value><![CDATA[#{javascript:"myfieldname"}]]></xp:this.value>
<xc:Widgets_Field
field_datasource="#{javascript:currentDocument}"
field_name="#{javascript:fieldname}">
</xc:Widgets_Field>
</xp:repeat>
I have tried to empty the cc but without any success. The only thing thats working is when i am either hardcoding the property field_name or when i set the repeat control to "create controls at page creation"
I am absolutely sure that code was working before but i cant find out whats causing the error message. Can you please give it a try and let me know if you also have the same problem.
Attached please see stack trace
com.ibm.xsp.exception.EvaluationExceptionEx: Error while executing JavaScript computed expression
com.ibm.xsp.binding.javascript.JavaScriptValueBinding.getValue(JavaScriptValueBinding.java:132)
com.ibm.xsp.page.compiled.ExpressionEvaluatorImpl.getBindingValue(ExpressionEvaluatorImpl.java:151)
xsp.Widgets_005fField$Widgets_005fFieldPage.createInputText4(Widgets_005fField.java:776)
xsp.Widgets_005fField$Widgets_005fFieldPage.createComponent(Widgets_005fField.java:142)
com.ibm.xsp.page.compiled.AbstractCompiledPage.buildComponent(AbstractCompiledPage.java:265)
com.ibm.xsp.page.compiled.CompiledComponentBuilder.buildChildren(CompiledComponentBuilder.java:115)
com.ibm.xsp.page.compiled.CompiledComponentBuilder.buildAll(CompiledComponentBuilder.java:84)
Within the custom control, if you use wrong binding that should be known at the page load, it throws such an error. For instance if your custom control contains a "loaded" attribute like:
<xp:text
loaded="${compositeData.field_name}">
That will throw such an error. That's why it works with "create controls at page creation" setting.
Update: If you are going to use dynamic binding within the custom control, see my answer at this question:
Dynamic Data Binding?
The default XML generated when a new XPage is created looks like thi
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
</xp:view>
but when you add new components from the extension library and other palette items the view xsmlns namespace changes. It also reformats code and screws up any JavaScript and or CSS on the page.
How can I change the default XML created to look more like this and therefore cover my bases when I add new components?
<?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">
</xp:view>
One possible solution I could come up with would be to create a template in your Eclipse Designer (Preferences > XML > XML Files > Editor > Templates).
Just to test this I created this template:
xmlns:xe="http://www.ibm.com/xsp/coreex"
xmlns:xc="http://www.ibm.com/xsp/custom"
Saved it under the name "myAddNamespace" with context "XML Attribute" and "Automatically insert" = ENABLED.
If then I create a new xpage, I can go into source view, place my cursor at the end of the default namespace before the closing '>', then type "my", hit - and then select my template to be inserted at the cursor position:
I'm aware that this is NOT what you really asked for, but it's at least something
Tested this on 9.0.1 and it automatically formats the way you mention. For example without touching anything I get 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"
xmlns:xc="http://www.ibm.com/xsp/custom">
<xe:dialog id="dialog1"></xe:dialog>
<xc:test></xc:test>
</xp:view>
You can force a reformat pressing CTRL-SHIFT-F (or right click, source->format). You can modify how the formatting works by selecting "File-Preferences" menu option, then select "XML->XML Files->Editor".
I think what you want is "Split Multiple Attributes each on a new line".
Ok, I have two custom controls:
MainLayout: Contains an Application Layout control (from the Domino extension library)
Section1: Contains a section with a header and a few items
Now I create a new XPage, and drag the MainLayout control on it.
Now I want to drag Section1 to the page, and connect it to LeftColumn area of the MainLayout... which seems like something trivial, but I can't get it to work for some reason.
When I drag the section1 control to the leftColumn area, the component is always getting inserted at the top of the page. The little pencil-icon next to "LeftColumn" seems decoration-only to me, because no matter if you left-click or right-click on it, nothing happens...
How is this supposed to work?
Update:
This how my xpage looks like after adding the MainLayout control:
<?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.resources>
<xp:styleSheet href="/custom.css"></xp:styleSheet>
</xp:this.resources>
<xc:MainLayout></xc:MainLayout>
</xp:view>
XML of the MainLayout custom component:
<?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:applicationLayout id="applicationLayout1">
<xe:this.configuration>
<xe:oneuiApplication titleBarName="Test"
placeBarName="Server1" legalText="YadaYada">
<xe:this.footerLinks>
<xe:userTreeNode label="User 1"></xe:userTreeNode>
</xe:this.footerLinks>
<xe:this.bannerUtilityLinks>
<xe:loginTreeNode label="Login 1"></xe:loginTreeNode>
</xe:this.bannerUtilityLinks>
<xe:this.placeBarActions>
<xe:basicContainerNode label="Select server">
<xe:this.children>
<xe:basicLeafNode label="Server1"></xe:basicLeafNode>
</xe:this.children>
</xe:basicContainerNode>
</xe:this.placeBarActions>
</xe:oneuiApplication>
</xe:this.configuration>
</xe:applicationLayout>
</xp:view>
I also have a custom where i use the application layout.
in my custom control I have above the configuration tag the following code
And in my XPage which use my custom layout I referer to my LeftColumn editable area by the following code
Another hopefully simple issue from an xpages beginner.
I am trying to use the Navigator control from the Extension Library. No matter what I do with it, I cannot get it to render on any of the pages I try it on. Code is below. Thanks for any assistance.
<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:navigator id="outline" expandable="true">
<xe:this.treeNodes>
<xe:pageTreeNode page="/bcbsarequirements.xsp" selection="/bcbsarequirements" label="BCBSA Requirements" role="navigation"/>
<xe:pageTreeNode page="/compliance.xsp" selection="/compliance" role="navigation" label="Compliance"/>
<xe:pageTreeNode page="/finance.xsp" selection="/finance" label="Finance" role="navigation"/>
</xe:this.treeNodes>
</xe:navigator>
</xp:view>
This will happen at least if your view tag is missing the extension library attribute. Make sure the view tag looks like this: <xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xe="http://www.ibm.com/xsp/coreex">. If the attribute is missing there is an error visible in the source.
Make sure there is no error in XPage source.
Make sure the application is built (sometimes project -> clean is needed).
Make sure extension library is checked in application properties (you should get errors if not).
Check for any error messages in the server console/log when loading the XPage on browser.
Do other extension library controls render for you? If not there is a problem in ExtLib installation.
Make sure your Designer and server have the same and preferably the latest (20121217) ExtLib version.
If you are using the Upgrade Pack then you can open an SPR with IBM.