如何更改区域背景颜色? (Oracle Apex 21.1)

发布于 2025-02-09 02:49:03 字数 478 浏览 0 评论 0原文

当用户单击按钮时,我可以更改背景颜色吗?

按下该按钮(P21_CHECKOUT_BUTTON)被按下,执行一个将状态更改为ON或ON ON或OFF的过程。

目前,我想更改区域(p21_checkout)颜色,on:white off:yellow。

我找到了旧问题,但它仅起作用的JavaScript。 将背景color更改为Apex Oracle中的按钮

无法为新版本提供最佳解决方案,然后在运行PL/SQL时使用此JavaScript将值设置为项目。 以上问题有点老式。 (但是足够好。)

有人可以给我答案吗? 先感谢您 :)

May I change the background color when a user clicks a button?

When that button (P21_CHECKOUT_BUTTON) is pressed, execute a process that changes the status OFF to ON or ON to OFF.

At this time, I want to change region (P21_CHECKOUT) color, ON: White OFF: YELLOW.

I found old question, but it is working only javascript.
Change Background-color to button in APEX Oracle

If there is no way to best solution for newer versions, then use this javascript to set the value to the item when you run PL/SQL.
The above question feel a bit old-fashioned. (but enough good.)

Can someone please give me an answer?
Thank you in advance :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

雨的味道风的声音 2025-02-16 02:49:03

问题中的链接使用jQuery来操纵DOM元素并设置背景颜色。这可能会起作用,但绝对不是升级证明。它也可以在Apex发表声明,随着时间的流逝,这要安全得多。

这是设置区域单击按钮的背景颜色的示例。可以应用相同的技术来为您的过程添加/删除背景颜色类:

页面有一个按钮(按钮1),一个区域(region1)

  • 在按钮1上创建事件的动态动作单击
  • 在动态动作中添加真正的动作动作添加类
    • 设置>班级:“ U-Color-7-BG”
    • 选择类型“区域”
    • 按钮“区域1”
    • 初始化的火灾: OFF

这就是其中的全部。类“ U-Color-7-BG”类来自通用主题参考应用程序(Apex Universal主题>参考> color and Status修饰符)。可以使用块/文本/背景/边框的许多预定义类。这些都是升级的证明,强烈建议将它们用于家庭啤酒解决方案

The link in the question uses jquery to manipulate the DOM element and set the background color. This could work but it definitely is not upgrade proof. It can be achieved declaratively in apex as well and that is a lot safer over time.

Here is an example of setting background color of a region click of a button. The same technique can be applied to add/remove the background color class for your process:

Page has a button (BUTTON1) and a region (REGION1)

  • Create a dynamic action of event Click on BUTTON1.
  • add a true action of action Add Class to the dynamic action
    • settings > class: "u-color-7-bg"
    • selection type "Region"
    • button "REGION1"
    • fire on initialization: off

That's all there is to it. The class "u-color-7-bg" comes from the universal theme reference application (Apex Universal Theme > Reference > Color and status modifiers). There are a number of predefined classes for block/text/background/border that can be used. These are upgrade proof and it is strongly advised to use these over home brewn solutions

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文