0

A Domino Classic Web Development question.

I have a form with a checkbox field in in, IsCustomerTX. The single choice of the checkbox is

Ich bin bereits Kunde|1

enter image description here

The form is submitted with

<input value="Reservation abschicken" class="f-submit" name="f-submit-button" type="submit">

I have a WebQuerySave Agent that catches the documentcontext and transfers the values to a back-end document docRes.

docRes.Salutation1TX = docContext.Salutation1TX(0)      
docRes.IsCustomerTX = docContext.IsCustomerTX(0) 'checkbox 'Ich bin bereits Kunde'
'Call docRes.ReplaceItemValue("%%Surrogate_IsCustomerTX", "Ich bin bereits Kunde")
docRes.IsCustomerTX = "Ich bin bereits Kunde" 'checkbox 'Ich bin bereits Kunde'
docRes.BirthdayTX = docContext.BirthdayTX(0)

In case there are some validations that are not satisfied, I display docRes with an URL parameter that makes the fields go red.

If I check the checkbox and submit the form: enter image description here

enter image description here

the field value gets sent correctly to the server.

However, when the page re-loads

enter image description here

the checkbox is unchecked.

You can see the effect on:

http://www.magermandemo2.ch/Development/webres/webres1_0/Webres_(1_0)_Dev.nsf/Address!open&resid=83BD3AB1A310C297C1258306003B185B&s=1

My expected behaviour is that the checkbox remains checked during the resubmit.

Many thanks for the help.

Andrew Magerman
  • 1,394
  • 1
  • 13
  • 23
  • Does the checkbox ever come back checked? That is to say, if the back end document has that value set to 1, and you load the document, is it checked? Or is this only a problem when validation fails? – Duston Sep 12 '18 at 13:48
  • no It doesn't come back checked - that's my problem :-( – Andrew Magerman Sep 12 '18 at 15:07
  • So your form action performs an ?OpenForm. That opens a blank form without the checkbox checked. Do you call WebQueryOpen to populate the fields? I created a simple form with a checkbox, and its form action is ?EditDocument and the checkbox works as expected. – Duston Sep 12 '18 at 16:14
  • doh! I had forgotten about the WQO of the form. That's what was happening. I've updated the code, and it now works. Thanks a bunch Duston! Write up the answer 'check your WQO' and I'll mark you as the correct answer. – Andrew Magerman Sep 12 '18 at 16:30

1 Answers1

1

Did you check your WebQueryOpen? If you handle some things that way, it can cause problems elsewhere.

Duston
  • 1,601
  • 5
  • 13
  • 24