1
votes

I don't know if this is a feature or a bug: In an inputText control, bound to an item of a notes document, the value is overwritten each time the xpage is reopened and saved by the defaultvalue when the inputText control is flagged as disabled:

                        <xp:inputText
                            value="#{fback.EmployeeIDCreator}" id="EmployeeIDCreator1"
                            defaultValue="#{javascript:sessionScope.meUser.EmployeeID}"
                            style="width:94px" disabled="true" />

I expected the same behaviour as in "normal" (=enabled) items:

  • defaultValue assigned when document/xpage is new and the item is created,

  • field value when xpage is reopened and reedited.

Is this the "wished" behaviour?

thx in advance, Uwe

3
is fback standard document data source, or your bean? isn't there another script overwriting the value?Frantisek Kossuth
fback is a standard document data source. I don't find any script which overwrites the value. The effect only occurs when disabled="true". sessionScope.meUser.EmployeeID is the employeeID of the current user, and this value is set in the EmployeeIDCreator item each time another user saves the xpage.Uwe J.
what version of Domino you use?Frantisek Kossuth
we use version 9.0.1.Uwe J.

3 Answers

2
votes

We'd run into this problem with fields that were marked 'readonly' as well. Set the style on the inputText to "display:none;" and have a separate control that displays the value. That way, your default value is saved in the field, but the user cannot edit it.

2
votes

Looks to be a bug. Reproducible on R9.0.1: disabled state of edit field resets its binded value to default value on save.

0
votes

We have a ticket open with HCL for this in 11.0.1 - CS0306235 The initial HCL response was "working as expected" Subsequently someone in HCL raised this "Aha!" ticket because they disagreed - go vote for the "idea" - https://domino-ideas.hcltechsw.com/ideas/DDXP-I-980

In our case the workaround is to include .isNewNote() in an if statement as a condition of the default value.

<xp:this.defaultValue><![CDATA[#{javascript:if (document1.isNewNote()){
    var addQText = getDbSettingsValueBlk('Configurable Additional Questions Text') ;
    if (addQText==''){
        // do nothing
    }else {
        return addQText;
    }
}}]]></xp:this.defaultValue>