我有一个带有三个选项卡的选项卡容器。他们在其上有精选的列表和复选框,其中以SQL查询为源。用户可以在列表中选择条目或编辑选中框,然后单击按钮将其保存到数据库中。此按钮还可以在保存后使用数据库中的当前数据重新填写选择列表和复选框。
我的问题是:当用户在选择列表中选择条目或编辑复选框并导航到Antoher选项卡时,而无需单击“保存”按钮时,当导航回到选项卡时,数据就会停留在此处。我想确保列表和复选框中所描绘的内容始终是当前数据,就像数据库中的表中的表格一样。
因此,我试图将onclick事件放在TabScontainer的标签上:
我没有工作,因为这些元素没有ID,我也无法为他们在顶点(至少我想是这样)。无论如何,有没有办法在Apex中执行此操作?
这是标签元素之一:
I've got a tabs container with three tabs. They have select lists and checkboxes on them which have sql queries as source. Users can select entries in the lists or edit the checked boxes and save this to the database by clicking a button. This button also re-fills the select lists and checkboxes with the current data from the database after saving it.
My problem is: When a user selects an entry in a select list or edits a check box and navigates to antoher tab without clicking on the "save" button, the data stays there when navigating back to the tab. I want to assure that what is depicted in the lists and check boxes is always the current data like it is in the tables in the database.
Therefore, I tried to put an onclick event on the tabs of the tabscontainer like this one:

I didn't get it to work, becuase these elements do not have an ID and I can not set an ID for them in APEX (at least I guess so). Is there a way to do this in APEX anyway?
This is one of the tab elements:

发布评论
评论(3)
以防万一其他任何人都遇到同样的问题:我通过在选项卡容器上进行自定义动态动作来解决它:
每当用户在Tabs和Ehrefore之间切换并为我工作时,这会触发。:-)
有关更多信息,请查看本文:
Just in case anyone else is experiencing the same problem: I solved it by putting an custom dynamic action on the tabs container:
This fires whenever the user switches between the tabs and ehrefore worked for me :-)
For more information check this article: https://medium.com/@pierre.yotti/tabs-region-javascript-api-in-oracle-apex-37e20bc9f68f
您可以将静态ID放在标签区域(例如#Some_Static_ID),然后使用jQuery选择器选择元素:
You can put a static ID to your tab region (for example #SOME_STATIC_ID) and then select the elements with a jQuery selector:
您还可以在选项卡的文本上定义单击“侦听器”:
它可能不是最干净的解决方案,但它有效。
You could also define an on click listener on text of the tab:
It might not be the cleanest solution but it works.