0
votes

I have an Xpage with 3 comboboxes related to each other. In the onchange event of Combobox1 I have a partial refresh of combobox2(since the key of the dblookup of combobox2 is the value of combobox1). As server option I have "Do not validate or update data" Same for combobox2 and 3. Then I have a button that will pick up the submitted values of the comboboxes , and saves a document with these values. The problem : when I pick up a value for combobox1 and click on the "Save"button a document is saved . When I click on the second and also the third button, I can't save a document anymore ... I don't get any error message either. edit ; Simplified version of the code :

<?xml version="1.0" encoding="UTF-8"?> <xp:view xmlns:xp="http://www.ibm.com/xsp/core"> <xp:br></xp:br> <xp:this.data> <xp:dominoDocument var="document1" formName="bestelbon"></xp :dominoDocument> </xp:this.data>

<xp:table>
    <xp:tr>
        <xp:td><xp:comboBox id="comboBox1" value="#{sessionScope.item}">
                                            <xp:selectItem itemLabel="Please select">
                                            </xp:selectItem><xp:selectItems id="selectItems2">
                                                <xp:this.value><![CDATA[#{javascript:@Unique(@DbColumn("product/Bestelbon.nsf","item",1));    
}]]></xp:this.value>
                                            </xp:selectItems>
                                            <xp:eventHandler event="onchange" submit="true" refreshMode="partial" refreshId="comboBox2" immediate="true">
                                            </xp:eventHandler>


                                        </xp:comboBox></xp:td>
        <xp:td><xp:comboBox id="comboBox2" value="#{sessionScope.subitem}">

                                            <xp:selectItem itemLabel="Please select">
                                            </xp:selectItem>
                                            <xp:selectItems id="selectItems3">
                                                <xp:this.value><![CDATA[#{javascript:var combo1 = getComponent("comboBox1").getSubmittedValue();
@Unique(@DbLookup("product/Bestelbon.nsf","subitem2",combo1,2));
}]]></xp:this.value>
                                            </xp:selectItems>
                                            <xp:eventHandler event="onchange" submit="true" refreshMode="partial" refreshId="comboBox3" immediate="true">
                                            </xp:eventHandler>
                                        </xp:comboBox></xp:td>
        <xp:td><xp:comboBox id="comboBox3" value="#{sessionScope.subsubitem}">
                                            <xp:selectItem itemLabel="Please select">
                                            </xp:selectItem>
                                            <xp:selectItems id="selectItems4">
                                                <xp:this.value><![CDATA[#{javascript:var combo1 = getComponent("comboBox2").getSubmittedValue();
@Unique(@DbLookup("product/Bestelbon.nsf","subsubitem2",combo1,2));
}]]></xp:this.value>
                                            </xp:selectItems>
                                        </xp:comboBox></xp:td>
        <xp:td><xp:comboBox id="comboBox4" value="#{sessionScope.optie}" defaultValue="Gratis optie">
                                        <xp:selectItems>
                                            <xp:this.value><![CDATA[#{javascript:@Unique(@DbColumn("product/Bestelbon.nsf","mogelijkheid",1));}]]></xp:this.value>
                                        </xp:selectItems>
                                    </xp:comboBox></xp:td>
        <xp:td><xp:comboBox id="comboBox5" value="#{sessionScope.combinatie}">
                                        <xp:selectItem itemLabel="Please select">
                                        </xp:selectItem>
                                        <xp:selectItems>
                                            <xp:this.value><![CDATA[#{javascript:@Unique(@DbColumn("product/Bestelbon.nsf","subsubitem",1));}]]></xp:this.value>
                                        </xp:selectItems>
                                    </xp:comboBox></xp:td>
    </xp:tr>
    <xp:tr>
        <xp:td></xp:td>
        <xp:td></xp:td>
        <xp:td></xp:td>
        <xp:td></xp:td>
        <xp:td></xp:td>
    </xp:tr>
</xp:table>
<xp:br></xp:br>
<xp:button id="button1" value="Save">
    <xp:eventHandler event="onclick" submit="true"
        refreshMode="complete">
        <xp:this.action><![CDATA[#{javascript:var combo1 = getComponent("comboBox1")
var value1= combo1.getSubmittedValue();
if (null == value1){
value1 = combo1.getValue();
}
var combo2 = getComponent("comboBox2")
var value2= combo2.getSubmittedValue();
if (null == value2){
value2 = combo1.getValue();
}
var combo3 = getComponent("comboBox3")
var value3= combo3.getSubmittedValue();
if (null == value3){
value3 = combo3.getValue();
}
var combo4 = getComponent("comboBox4")
var value4= combo4.getSubmittedValue();
if (null == value4){
value4 = combo4.getValue();
}
var combo5 = getComponent("comboBox5")
var value5= combo5.getSubmittedValue();
if (null == value5){
value5 = combo5.getValue();
}
document1.replaceItemValue("bbitem",value1);
document1.replaceItemValue("bbpsubitem",value2);
document1.replaceItemValue("bbsubsubitem",value3);
document1.replaceItemValue("bbmogelijkheid",value4);
document1.replaceItemValue("bbopmerking",value5);
document1.replaceItemValue("bbland","VF");
document1.replaceItemValue("bbproduct","NAVIX");
document1.save();
}]]></xp:this.action>
    </xp:eventHandler></xp:button></xp:view>
1
are you sure document is not saved? or it is saved without proper combo values (I suppose)? check last update and let me know. I think "Do not validate or update data" is the problem - it does not submit values to datasource.Frantisek Kossuth
The document isn't saved. I've put fixed values in order to be sure there was something to be saved. Once you click on more than one of those comboboxes nothing will be saved anymore. If you click on only one combobox the document will be saved. Seems like a bug to me , but I don't know how to go around it ... By the way I'm using 8.5.3Marc Jonkers

1 Answers

0
votes

In order to get the submitted values you must use getComponent("comboBoxX").getSubmittedValue() (instead of .getValue() ).

I need more details of the data source in order to understand why you are unable to save. But try using .getSubmittedValue() and see if that helps you.