1
votes

My XPage will not save any data that I enter into it. The screen just flashes and the document that is open just redisplays. I assume it has something to do with where the buttons to save (Speichern) / cancel (Abbrechen) have been placed but, no matter where I place them they don't work. I am having the same problem with the New button - although I assume if the one error is found the other problem will be solved :)

Any help would be greatly appreciated as I have been looking into this for the whole day!

Here is the code for the page 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:applicationLayout id="applicationLayout1">

            <xe:this.facets>
                <xp:callback facetName="facetLeft" id="facetLeft" xp:key="LeftColumn">
                </xp:callback>
            </xe:this.facets>


            <xp:callback facetName="facetMiddle" id="facetMiddle">
            </xp:callback>




            <xe:this.configuration>
                <xe:simpleResponsiveConfiguration navbar="true" invertedNavbar="true" fixedNavbar="fixed-top"
                    navbarText="Thomas Vogel Dokumentation" pageWidth="fluid">
                    <xe:this.navbarAppLinks>
                        <xe:pageTreeNode label="Neu" page="/xpNewDocument.xsp"></xe:pageTreeNode>
                        <xe:loginTreeNode enabled="true" title="Abmelden" label="Abmelden"></xe:loginTreeNode>
                    </xe:this.navbarAppLinks>

                </xe:simpleResponsiveConfiguration>
            </xe:this.configuration>

        </xe:applicationLayout>
    </xp:view>

Here the code for the menu:

    <?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">
            <xe:this.treeNodes>
                <xe:pageTreeNode label="nach Titel" page="/xpByTitle.xsp"></xe:pageTreeNode>
                <xe:pageTreeNode label="nach Kategorie" page="/xpByCategory.xsp"></xe:pageTreeNode>

                <xe:pageTreeNode label="nach Ersteller_in" page="/xpByCreatedBy.xsp"></xe:pageTreeNode>
                <xe:pageTreeNode label="nach Datum" page="/xpByDate.xsp"></xe:pageTreeNode>
            </xe:this.treeNodes>
        </xe:navigator></xp:view>

And finally the for the EditDocument page:

    <?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="document1" formName="fmDoc" action="editDocument">
            </xp:dominoDocument>
        </xp:this.data>

        <xc:ccPageLayout>
            <xp:this.facets>
                <xc:ccMenu xp:key="facetLeft"></xc:ccMenu>
                <xp:panel xp:key="facetMiddle">

                    <xp:table>
                        <xp:tr>
                            <xp:td>
                                <xp:label value="Titel" id="titel_Label1" for="titel1">
                                </xp:label>
                            </xp:td>
                            <xp:td>
                                <xp:inputText value="#{document1.Titel}" id="titel1">
                                </xp:inputText>
                            </xp:td>
                        </xp:tr>
                        <xp:tr>
                            <xp:td>
                                <xp:label value="Datum" id="dokDatum_Label1" for="dokDatum1">
                                </xp:label>
                            </xp:td>
                            <xp:td>
                                <xp:inputText value="#{document1.dokDatum}" id="dokDatum1">
                                    <xp:dateTimeHelper id="dateTimeHelper1">
                                    </xp:dateTimeHelper>
                                    <xp:this.converter>
                                        <xp:convertDateTime type="date" dateStyle="short">
                                        </xp:convertDateTime>
                                    </xp:this.converter>
                                </xp:inputText>
                            </xp:td>
                        </xp:tr>

                        <xp:tr>
                            <xp:td>
                                <xp:label value="Kategorie" id="label3" for="kategorie1">
                                </xp:label>
                            </xp:td>
                            <xp:td>
                                <xp:comboBox id="kategorie1" value="#{document1.kategorie}">
                                    <xp:selectItems>
                                        <xp:this.value><![CDATA[#{javascript:var currDB:NotesDatabase = database;
            var profileDoc:NotesDocument=currDB.getProfileDocument("configDatabase","");
            var docUID=profileDoc.getItemValueString("kategorieDok");
            var categoryDoc:NotesDocument = currDB.getDocumentByUNID(docUID);
            var categories = categoryDoc.getItemValueString("kategorie");
            @Explode(@Text(categories), ";")
            }]]></xp:this.value>
                                    </xp:selectItems>
                                </xp:comboBox>

                            </xp:td>
                        </xp:tr>

                        <xp:tr>
                            <xp:td>
                                <xp:label value="Anhänge" id="label1" for="fileUpload1">
                                </xp:label>
                            </xp:td>
                            <xp:td>
                                <xp:fileUpload id="fileUpload1" value="#{document1.anhaenge}" useUploadname="true"></xp:fileUpload>
                            </xp:td>
                        </xp:tr>

                        <xp:tr>
                            <xp:td>
                                <xp:label value=" " id="label2" for="fileDownload1">
                                </xp:label>
                            </xp:td>
                            <xp:td>
                                <xp:fileDownload rows="5" id="fileDownload1" displayLastModified="false" value="#{document1.anhaenge}"
                                    hideWhen="true" displayType="false" displayCreated="false" allowDelete="true">
                                </xp:fileDownload>
                            </xp:td>
                        </xp:tr>



                        <xp:tr>
                            <xp:td colspan="2">
                                <xp:inputRichText id="inputRichText1" value="#{document1.body}">
                                </xp:inputRichText>
                            </xp:td>
                        </xp:tr>
                        <xp:tr>
                            <xp:td colspan="2">
                            </xp:td>
                        </xp:tr>


                    </xp:table>
                    <xp:button value="Speichern" id="button2">
                        <xp:eventHandler event="onclick" submit="true" refreshMode="complete" immediate="false" save="false">
                            <xp:this.action>

                                <xp:actionGroup>



                                    <xp:saveDocument var="document1"></xp:saveDocument>
                                    <xp:openPage name="$$PreviousPage"></xp:openPage>

                                </xp:actionGroup>
                            </xp:this.action>
                        </xp:eventHandler>
                    </xp:button>
                    <xp:button value="Abbrechen" id="button1">

                        <xp:eventHandler event="onclick" submit="true" refreshMode="complete">
                            <xp:this.action>

                                <xp:actionGroup>
                                    <xp:openPage name="$$PreviousPage"></xp:openPage>

                                </xp:actionGroup>
                            </xp:this.action>
                        </xp:eventHandler>
                    </xp:button>



                </xp:panel>
            </xp:this.facets>
        </xc:ccPageLayout>
    </xp:view>

2

2 Answers

2
votes

In one of the buttons I noticed this part immediate="false" save="false" save should be set to true, I think.

0
votes

I may have missed it but you should ALWAYS have a displayErrors control. There could be a conversion error or something that you wouldn't otherwise see. You should also think about adding the XPages Log Reader as that can expose other error messages.