0

Working with a html select element with 4D as can be seen below. On load, If user has a bankID, I wasn't able to make the chosen bank as selected, despite having it on memory already. 4D is on version 16.3. It seems like the browser is ignoring the 4DIF altogether.

<select style="width:100%;" id="bank_list" class="form-control input-sm" tabindex="0" name="bank">
<option></option>
<!--4DLOOP [Bank]-->
<option value="<!--4DVAR [Bank]ID-->" <!--4DIF ([User]BankID=[Bank]ID)--> selected="selected" <!--4DENDIF--> ><!--4DVAR [FinvoiceFactoring]PartyName -->
</option>
<!--4DENDLOOP -->

Dylan
  • 37
  • 6
  • I stored the [User]BankID as a interprocess variable, and the 4DIF condition seems to work fine! – Dylan Jan 23 '20 at 10:23

2 Answers2

1

when you make a 4DLOOP on a table ( Bank ) the code inside the 4DLOOP-4DENDLOOP cycle on every record of current selection.

So, when you write "IF [table]Field = [table]Field " you'll have the same values. The solution is to have a variable where to save the current BankId.

Beware: You have to use Process Variable, not Interprocess (identified with <> prefix), because this last type is shared among all web processes: so if you'll have two user they'll have the same variable content!

Umberto Migliore
  • 317
  • 4
  • 17
0

I stored the [User]BankID as a interprocess variable, and the 4DIF condition seems to work fine!

Dylan
  • 37
  • 6