In prior versions of APEX, you were effectively limited to a single DML load process and a single DML submit process, and all the items on the page that were linked to a table column were required to be from only a single table. The new Form Region feature introduced in Oracle APEX 19.1 is a big improvement to the way that single-record forms are defined declaratively. To do this, I add a call to utl_i18n.unescape_reference:ĪPEX / APEX_ESCAPE / apex-18.2 / tips-&-tricks / UTL_I18N / Instead, before sending this string to my procedure, I’ve chosen to unescape the data. This would allow using a surrogate key for the vendor list and this escaping behaviour would no longer be a problem.Īnother alternative here is to use the latest transaction ID as a surrogate key for each vendor but then I would need to modify the form to translate this back into a vendor name when inserting or updating the table and this would add unnecessary complexity to this simple form, in my opinion. If I was doing this properly, I would fix the data model to make vendors first-class entities, instead of using a free-text field. Usually, I would try to rework my code to send a numeric ID instead of a string but in this particular case the data model does not have surrogate keys for vendors (it’s just a free-text field in the transactions table) so I want to use the name. I believe APEX uses the apex_escape.html function to do this. “Ben & Jerry’s” was escaped to “ Ben & Jerry's“. Therefore, the value sent by the dynamic action to my PL/SQL procedure had the special html characters escaped, e.g. This is because the item had Escape special characters set to the default (Yes), which is good practice to protect against Cross-Site Scripting (XSS) attacks. That would be all, once created, when you click the button the code will be executed on the server.This didn’t work in some cases where a vendor name included special characters, such as &. Once defined click next and here you decide the action type, the one you need is "Execute PL/SQL Code", which will show a text field on which you can paste your code, and the parameters needed from the page.įinally you can specify if the action will have a repercussion on any kind of visual component on the page, this is for efficiency, but is not necessary. if so then you would be able to define actions to execute in both cases, if you leave it empty ("No condition") then all the actions defined will be executed. In condition you can define a true/false evaluation. Then, back on the page definition, create a dynamic action, on Event choose "Click", on Selection type choose "Button" this will make a field named button appear whit a list of the available buttons to choose. On the button definition go to "Action when button clicked" region and on the action field select "Defined by dynamic action" There are several ways to do what you need, the simplest one would be to bind a dynamic action to the click event on the button.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |