Forum Stats

  • 3,817,099 Users
  • 2,259,276 Discussions
  • 7,893,655 Comments

Discussions

Page submitting when I don't want it to

Scott H.
Scott H. Member Posts: 322 Bronze Badge
edited Jan 22, 2016 10:18AM in APEX Discussions

I have written a mobile scanning app...

For speed, i have a dynamic action when you press enter on the barcode.. it calls pl/sql and then refreshes a region.

there are no branches nor page processes on this.. only a pre-load process to create a collection

I've made many pages in this.. the latest page I'm working on.. keeps submitting when I press enter on the item.  Submit when enter pressed is not checked.

The item is not set to submit on enter...

i have disabled my dynamic action and the page keeps submitting

Any help would be greatly appreciated.

debug log below.  Apex 5.01 running on 11.2.0.4... using weblogic 11g

<td class="u-tR" headers="C451353331050603354" style="padding: 4px 8px; text-align: right; color: #404040; border-left-style: solid;
0.005000.00000
R E Q U E S T accept
4

0%

0.005000.00200
Metadata: Fetch application definition and shortcuts
4

66%

0.007000.00100
NLS: wwv_flow.g_flow_language_derived_from=FLOW_PRIMARY_LANGUAGE: wwv_flow.g_browser_language=en
4

33%

0.008000.00000
alter session set nls_language='AMERICAN' nls_territory='AMERICA'
4

0%

0.008000.00000
NLS: CSV charset=WE8MSWIN1252
4

0%

0.008000.00000
...NLS: Set Decimal separator="."
4

0%

0.008000.00000
...NLS: Set NLS Group separator=","
4

0%

0.008000.00000
...NLS: Set g_nls_date_format="DD-MON-RR"
4

0%

0.008000.00000
...NLS: Set g_nls_timestamp_format="DD-MON-RR HH.MI.SSXFF AM"
4

0%

0.008000.00000
...NLS: Set g_nls_timestamp_tz_format="DD-MON-RR HH.MI.SSXFF AM TZR"
4

0%

0.008000.00000
Setting NLS_DATE_FORMAT to application date format: MM/DD/RR
4

0%

0.008000.00000
...NLS: Set g_nls_date_format="MM/DD/RR"
4

0%

0.008000.00100
...NLS: Set g_nls_timestamp_format="DD-MON-RR HH.MI.SSXFF AM"
4

33%

0.009000.00000
...NLS: Set g_nls_timestamp_tz_format="DD-MON-RR HH.MI.SSXFF AM TZR"
4

0%

0.009000.00100
...metadata, fetch translated app info
4

33%

0.010000.00100
Authentication check: Database Account (NATIVE_DB_ACCOUNTS)
4

33%

0.011000.00000
...fetch session state from database
4

0%

0.011000.00000
fetch items (exact)
4

0%

0.011000.00000
... sentry+verification success
4

0%

0.011000.00100
...Session ID 10333711702282 can be used
4

33%

0.012000.00000
...Setting session time_zone to -05:00
4

0%

0.012000.00000
Setting NLS_DATE_FORMAT to application date format: MM/DD/RR
4

0%

0.012000.00000
...NLS: Set g_nls_date_format="MM/DD/RR"
4

0%

0.012000.00000
...NLS: Set g_nls_timestamp_format="DD-MON-RR HH.MI.SSXFF AM"
4

0%

0.012000.00000
...NLS: Set g_nls_timestamp_tz_format="DD-MON-RR HH.MI.SSXFF AM TZR"
4

0%

0.012000.00000
...Check for session expiration:
4

0%

0.012000.00100
...Metadata: Fetch Page, Computation, Process, and Branch
4

33%

0.013000.00000
...Validate item page affinity.
4

0%

0.013000.00000
... Compute item values
4

0%

0.013000.00100
...Validate protected items.
4

33%

0.014000.00000
...Check authorization security schemes
4

0%

0.014000.00100
Session State: Save form items and p_arg_values
4

33%

0.015000.00000
...Session State: Save "P41_SCAN" - saving same value: ""
4

0%

0.015000.00000
...Session State: Saved Item "P41_ADD" New Value=""
4

0%

0.015000.00000
...Session State: Save "P41_WHOUSE" - saving same value: "01"
4

0%

0.015000.00000
...Session State: Save "P41_AISLE" - saving same value: "00"
4

0%

0.015000.00100
...Session State: Save "P41_RW" - saving same value: "000"
4

33%

Tagged:
Ender Polanco

Best Answer

  • John Snyders-Oracle
    John Snyders-Oracle Member Posts: 1,428 Employee
    edited Jan 21, 2016 9:18PM Answer ✓

    By any chance do you have exactly one text input page item on the page? Most browsers will submit the page on Enter key if there is just one text input element on a page. The rational is that it is a "search" page.

    If this is the problem, the solution is to prevent default behavior. In the KeyDown dynamic action add a javascript action like so:

    if (this.browserEvent.which === 13) {
      this.browserEvent.preventDefault();
    }
    
    Ender Polanco

Answers

  • John Snyders-Oracle
    John Snyders-Oracle Member Posts: 1,428 Employee
    edited Jan 21, 2016 9:18PM Answer ✓

    By any chance do you have exactly one text input page item on the page? Most browsers will submit the page on Enter key if there is just one text input element on a page. The rational is that it is a "search" page.

    If this is the problem, the solution is to prevent default behavior. In the KeyDown dynamic action add a javascript action like so:

    if (this.browserEvent.which === 13) {
      this.browserEvent.preventDefault();
    }
    
    Ender Polanco
  • Scott H.
    Scott H. Member Posts: 322 Bronze Badge
    edited Jan 22, 2016 10:18AM

    John.. thank you so much.. that did it.. i made it the first true action in my dynamic action, and it stopped the page from submitting.

    I appreciate it.

    -Scott

This discussion has been closed.