javascript - How to dynamically change title an Oracle Apex Page Modal? - Stack Overflow

I have a single modal page for creating, editing and deleting products.When P2_TYPE = 'UPD'

I have a single modal page for creating, editing and deleting products.

When P2_TYPE = 'UPD' the update button is displayed, when P2_TYPE = 'DEL' the delete button is displayed, when P2_TYPE = 'ADD' the new button is displayed.

I have created a dynamic action when the page loads using javascript.

function cambiarTitulo(){
var type; 
type = apex.item( "P2_TYPE" ).getValue();

if ((type == 'UPD' ) || (type == 'DEL' )){
apex.util.getTopApex().jQuery(".ui-dialog-content").dialog("option", "title", "Details")
}else{
apex.util.getTopApex().jQuery(".ui-dialog-content").dialog("option", "title", "New")
} 
}

But it is not working, it does not change the title

I have a single modal page for creating, editing and deleting products.

When P2_TYPE = 'UPD' the update button is displayed, when P2_TYPE = 'DEL' the delete button is displayed, when P2_TYPE = 'ADD' the new button is displayed.

I have created a dynamic action when the page loads using javascript.

function cambiarTitulo(){
var type; 
type = apex.item( "P2_TYPE" ).getValue();

if ((type == 'UPD' ) || (type == 'DEL' )){
apex.util.getTopApex().jQuery(".ui-dialog-content").dialog("option", "title", "Details")
}else{
apex.util.getTopApex().jQuery(".ui-dialog-content").dialog("option", "title", "New")
} 
}

But it is not working, it does not change the title

Share Improve this question asked Sep 10, 2022 at 5:31 HenriquezHenriquez 471 silver badge5 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4

Try this snippet in "Execute when page loads":

var type = apex.item( "P2_TYPE" ).getValue();
var title = (
  pgitem === 'UPD' ? 'Details' : // if 
  pgitem === 'DEL' ? 'Details' : // else if 
  'NEW' // else 
);
$('.ui-dialog-title',parent ? parent.document : document).text( title);

Use a new page item i.e P2_TITLE and set the value of it when you open the modal from the main page. Then in the modal page's page attributes, set title to:

&P2_TITLE.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744799406a4594401.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信