Hash Variable in SQL within form used within a Form Grid

Confluence User - 03 Dec, 2021

I am attempting to use a JDBC Binder to load a Select Box within the Form used to populate a Form Grid.

This works fine when I use a WHERE and then a LIKE so long as the LIKE parameter is of the form '%individual%', where the string "individual" is the value on which I am filtering. However, when I try to bring in a value from a field on the Form to use as the filter by using a Hash Variable it does not seem to work. It ignores the second like.

See below. Is the syntax correct or allowed to do this?

I also get these lines in the log:

ERROR 02 Dec 2021 21:35:45 org.owasp.csrfguard.CsrfGuard - Referer domain https://ws1.tpf1.net/jw/web/userview/accounts/accounts/_/account_crud?_mode=edit&id=afc4696c-6d2f-481c-b4d8-963331e1452a does not match request domain: http://ws1.tpf1.net/jw/csrf
ERROR 02 Dec 2021 21:36:04 org.owasp.csrfguard.CsrfGuard - Referer domain https://ws1.tpf1.net/jw/web/userview/accounts/accounts/_/welcome does not match request domain: http://ws1.tpf1.net/jw/csrf
ERROR 02 Dec 2021 21:36:05 org.owasp.csrfguard.CsrfGuard - Referer domain https://ws1.tpf1.net/jw/web/userview/accounts/accounts/_/account_crud does not match request domain: http://ws1.tpf1.net/jw/csrf
ERROR 02 Dec 2021 21:36:08 org.owasp.csrfguard.CsrfGuard - Referer domain https://ws1.tpf1.net/jw/web/userview/accounts/accounts/_/account_crud?_mode=edit&id=afc4696c-6d2f-481c-b4d8-963331e1452a does not match request domain: http://ws1.tpf1.net/jw/csrf
ERROR 02 Dec 2021 21:36:10 org.owasp.csrfguard.CsrfGuard - Referer domain https://ws1.tpf1.net/jw/web/app/accounts/2/form/embed?_submitButtonLabel=Submit&__a_=accounts&__u_=accounts&OWASP_CSRFTOKEN=2CE9-Q4FA-XGBA-JXM3-YR93-FR8Q-RGG8-3PJN does not match request domain: http://ws1.tpf1.net/jw/csrf

forms

2


03 Dec, 2021
confluenceUser
confluenceUser

The form Hash Variable #form.table.fieldname# only works if the record is ALREADY saved into the database in a prior form, for example. Maybe you could try using the AJAX Subform#EditAJAXSubform see the demo app in this page, where the pass in field value can be accessed using the hash #requestParam.primaryKey#.

03 Dec, 2021
confluenceUser
confluenceUser

Thanks! The value I am trying to bring in actually already exists in a field in the parent form of the Form Grid as well. Can I retrieve it from there into the other Form that I use to populate the Form Grid? I am successfully able to prepopulate fields in the popup Form from the parent Form with the following Javascript. Can I somehow add on to this code such that I can get accountType (which successfully populates into account1Type on the popup Form) to be accessible also within the JDBC Binder SQL query WHERE statement?

Thanks!

<script type="text/javascript">
$(document).ready(function(){
var mainFormField = "accountName";
var mainFormField2 = "zid";
var mainFormField3 = "accountType";
var fieldId = "account1";
var fieldId2 = "account1Zid";
var fieldId3 = "account1Type";

//get value from parent form
var value = $('[name='+mainFormField+']:enabled', window.parent.document).val();
var value2 = $('[name='+mainFormField2+']:enabled', window.parent.document).val();
var value3 = $('[name='+mainFormField3+']:checked', window.parent.document).val();


//store the value to a field
$('[name='+fieldId+']:enabled').val(value);
$('[name='+fieldId2+']:enabled').val(value2);
$('[name='+fieldId3+']:enabled').val(value3);
});
</script>


RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print