Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

APEX 24.2 - apex.lang javascript API issue

TomasJuarez2 days ago

In an APEX 24.2 app, I have a language selector on the Global Page. When a user switches languages, a Dynamic Action runs that sets the new language as the user’s preference, changes the session language with apex_util.set_session_lang(:P0_LANG);, and then reloads the page (I tried both a submit and location.reload).

Next, I want all messages shown to the user to appear in the selected language. For that, I created some Text Messages in Shared Components.

From PL/SQL processes, everything works as expected: the user sees messages in Spanish, switches to English, and from that point on, everything appears in English. Perfect.

The problem arises when I display messages from JavaScript or Dynamic Actions. The sequence is:

  1. The default language is Spanish.
  2. The user clicks a button that only runs JavaScript, showing a message with apex.message and apex.lang.getMessage. The message correctly appears in Spanish.
  3. The user changes the language to English.
  4. The user clicks the same button again, but the message still appears in Spanish.
  5. The user presses F5 to reload the page.
  6. The user clicks the button again, and now the message appears in English.

I can’t figure out what’s causing this behavior. Can someone help me resolve it?

Comments
Post Details
Added 2 days ago
3 comments
63 views