One of the requirements for my APEX application is the ability to have a form with a dynamic amount of entries and the ability to filter/search for a specific entries. Since the out of box form region requires a form entry to correspond to a database column, accomplishing this task is quite difficult.
It seems to me that the best option would be to create a custom template that looks and interacts just like a form so that each entry would correspond to a row instead of a column, which would be much more easy to deal with. Since all of the entries correspond to rows in this instance, the filtering/searching would be much easier and the total entries at any given time could be changed by a non-developer pretty easily if needed.
So far my custom template uses the following row template:
<div class="t-Form-fieldContainer t-Form-fieldContainer--floatingLabel t-Form-fieldContainer--preTextBlock t-Form-fieldContainer--postTextBlock lto1556169442680158453_0 apex-item-wrapper apex-item-wrapper--select-list js-show-label" id="P200_#ID#_CONTAINER">
<span class="t-Form-itemText t-Form-itemText--pre">
<b>#PRE_TEXT_ID#</b>
</span>
<div class="t-Form-labelContainer">
<label for="P200_#ID#" id="P200_#ID#_LABEL" class="t-Form-label">#NAME#</label>
</div>
<div class="t-Form-inputContainer">
<div class="t-Form-itemWrapper">
<select id="P200_#ID#" name="P200_#ID#" class="selectlist apex-item-select" data-native-menu="false" size="1" style="background-color: #BACKGROUND_COLOR#;">
<option value=""></option>
<option value="1">Yes</option>
<option value="3">No, PRT Action!</option>
<option value="4" selected="selected">No, Escalation</option>
<option value="5">N/A</option>
</select>
<span class="t-Form-itemText t-Form-itemText--post">
<a href="#POST_TEXT_LINK#" class="#POST_TEXT_ICON#"></a>
</span>
</div>
<span id="P200_#ID#_error_placeholder" class="a-Form-error" data-template-id="1548925300217985001_ET"></span>
</div>
</div>
This spits out a “form” that looks exactly how I need it to look but there are two main issues I am running into from fully implementing it:
- The select lists that are being created as entries can’t be hard coded into the template. My initial thought was to build the
<option value="x">blah blah</option>
lines within the source query of my classic report, but it negatively effects the readability of the region. I was wondering if there was an alternative method that allowed some of the “processing” to be done within the template - When a user changes one of the select lists at run time, I need to process some data. I don’t know how to access what the select lists created from this query contain or how to access the
#ID#
for a select list when it gets changed.
Any help with this issue, or recommendations for a completely different alternative that meets my requirements would be greatly appreciated.
1
May you don’t need to create your own Template. What you need to do is manipulate your source of region to use PIVOTING query. then customize the Form - Automatic Row Processing (DML)
process with target type PL/SQL Code
that use looping during processing.
1