Skip to main content
Answer

Adding a dialog box in a cusomization disables javascript from another dialog box.

  • November 30, 2023
  • 7 replies
  • 177 views

hello,

I added a dialog box in one of my customization's and noticed that Address Lookup stops working. I'm not sure what I’m doing wrong.

Normal.

Adding a Dialog

 

This is the result

 

Any help is appreciated. Thank you,

Best answer by darylbowman

This should solve your problem:

public OpportunityMaint_Extension : PXGraphExtension<OpportunityMaint>
{
public override void Initialize()
{
base.Initialize();

// Add the Page_Load event handler
var page = System.Web.HttpContext.Current?.Handler as PX.Web.UI.PXPage;
if (page is object)
page.Load += Page_Load;
}

// Executes the PXAddressLookup script which is broken by the page customization
private void Page_Load(object sender, EventArgs e)
{
var page = (PX.Web.UI.PXPage)sender;
PX.Objects.CS.PXAddressLookup.RegisterClientScript(page, Base);
}
}

 

7 replies

  • Author
  • Freshman II
  • December 1, 2023

I narrowed down the problem. I noticed that the server side code snippet disappears when I add a dialog box.

<%
PX.Objects.CS.PXAddressLookup.RegisterClientScript(this, ds.DataGraph);
%>

I tried adding this back to the code from within the customization editor but it keeps disappearing.


sgaspar72
Jr Varsity II
Forum|alt.badge.img+1
  • Jr Varsity II
  • December 5, 2023

We see the same thing with our clients. Seems to work on some screens but not on others. No clue why. Seems to be a non-functional feature for most. 
 

 


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • December 21, 2023

Hi @MarcoL45 were you able to find a solution? Thank you!


  • Author
  • Freshman II
  • December 21, 2023

Not yet.


sgaspar72
Jr Varsity II
Forum|alt.badge.img+1
  • Jr Varsity II
  • December 21, 2023

Anyone figured out a solution for this yet? 


darylbowman
Captain II
Forum|alt.badge.img+15

Related question here.


darylbowman
Captain II
Forum|alt.badge.img+15

This should solve your problem:

public OpportunityMaint_Extension : PXGraphExtension<OpportunityMaint>
{
public override void Initialize()
{
base.Initialize();

// Add the Page_Load event handler
var page = System.Web.HttpContext.Current?.Handler as PX.Web.UI.PXPage;
if (page is object)
page.Load += Page_Load;
}

// Executes the PXAddressLookup script which is broken by the page customization
private void Page_Load(object sender, EventArgs e)
{
var page = (PX.Web.UI.PXPage)sender;
PX.Objects.CS.PXAddressLookup.RegisterClientScript(page, Base);
}
}