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 badges2 Answers
Reset to default 4Try 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条)