FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.



Aug 25, 2016, 9:33 AM
94 Posts

Thank you for the input

  • Category: Debugging
  • Platform: Windows
  • Release: 9.0.1
  • Role: Developer
  • Tags:
  • Replies: 2

Yes, I had to do exactly that, stripped everything out except the date, the upload and a Save button.  I discovered that the document would actually save, and THEN the date would get reformatted.  So, as a workaround, I added code to clear the date field in the oncomplete event of the Save button - and that actually works.  So, not a solution, but a workaround.  (I was able to do that only because the Save performed a partial refresh.  The form actually appears in a dojo dialog panel)

I'm still looking for a solution, because I'm afraid I'll run into this again in the future.

Here's how it looks before Save

and after Save

Here's the xpage code

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core"><xp:panel id="panelCustPO">
        <xp:this.data>
            <xp:dominoDocument var="document3" formName="CustPOTemp" ignoreRequestParams="true">
            </xp:dominoDocument>
        </xp:this.data>
        
        <xp:table style="background-color:rgb(242,242,242);border-color:rgb(128,128,128);border-style:solid;border-width:thin">
            
            <xp:tr>
                <xp:td style="text-align:right">

                    <xp:label value="P.O. Received Date:" id="label101">
                    </xp:label>
                </xp:td>
                <xp:td style="background-color:rgb(255,255,255)">
                    <xp:inputText id="DateRec" value="#{document3.DateRec}" style="height:20px">
                        <xp:this.converter>
                            <xp:convertDateTime pattern="MMM d, yyyy">
                            </xp:convertDateTime>
                        </xp:this.converter>
                        <xp:dateTimeHelper></xp:dateTimeHelper>
                    </xp:inputText>
                    
                </xp:td>
                <xp:td></xp:td>
            </xp:tr>
            <xp:tr>
                <xp:td style="text-align:right" valign="top">
                    <xp:label value="P.O. Attachment:" id="label225"
                        style="font-size:9pt">
                    </xp:label>
                </xp:td>
                <xp:td style="background-color:rgb(255,255,255)">
                    <xp:fileUpload id="Attachments"
                        value="#{document3.Attachments}" style="width:99%;height:20px">
                    </xp:fileUpload>
                </xp:td>
                <xp:td></xp:td>
            </xp:tr>
            <xp:tr>
                <xp:td colspan="3" style="background-color:rgb(255,255,255);text-align:right;padding-top:10.0px">
                    <xp:button id="button18" value="OK" style="width:80px;margin-bottom:5.0px">
                        <xp:eventHandler event="onclick" submit="true"
                            refreshMode="partial" id="eventHandler55"
                            refreshId="panelCustPO">
                            <xp:this.action>
                                <xp:actionGroup>
                                    <xp:saveDocument var="document3"></xp:saveDocument>
                                    <xp:confirm
                                        message="save successful">
                                    </xp:confirm>
                                </xp:actionGroup>
                            </xp:this.action>
                            <xp:this.onComplete><![CDATA[//var fld = XSP.getElementById("#{id:DateRec}");
//fld.value = ""]]></xp:this.onComplete>
                        </xp:eventHandler>
                    </xp:button>
                </xp:td>
            </xp:tr>
        </xp:table>
    </xp:panel>
</xp:view>

 

 


FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.