0

I have created a PXGraphExtension on POLandedCostDocEntry. I have added a PXAction button. When the button is pressed I want to show a popup panel to ask the user for a landed cost code.

When I press the button, I see a dialog window appear but the control is not rendered. If I click OK then the first Landed Cost Code found by the PXSelect is used but I never had a chance to select a different code. The dialog looks like this:

What it looks like

Here is the ASPX for the dialog in question.

<px:PXSmartPanel runat="server" ID="PanelAskForLCCode" LoadOnDemand="True" Caption="Select LC Code" CaptionVisible="True" Key="LandedCostCodeSelection" AutoRepaint="True" Width="960px">
    <px:PXFormView runat="server" ID="CstFormView5" DataMember="LandedCostCodeSelection" DataSourceID="ds" Width="100%" Height="200px" CaptionVisible="False" Caption="LC Selection" SkinID="Transparent">
      <Template>
        <px:PXLayoutRule runat="server" ID="CstPXLayoutRule6" StartColumn="True" DataMember="landedCostCodeSelection" ControlSize="M" LabelsWidth="S" />
        <px:PXSelector runat="server" ID="CstPXSelector8" DataField="LandedCostCodeID" CommitChanges="True" /></Template></px:PXFormView>
    <px:PXPanel runat="server" ID="CstPanel2">
      <px:PXButton runat="server" ID="CstButton3" Text="Add" DialogResult="OK" />
      <px:PXButton runat="server" ID="CstButton4" Text="Cancel" DialogResult="Cancel" /></px:PXPanel></px:PXSmartPanel>
            

The code for the view that I'm trying to reference in the dialog is:

public PXSelect<LandedCostCode> LandedCostCodeSelection;
        

The code that I'm using to call the dialog is:

   if (LandedCostCodeSelection.AskExt() == WebDialogResult.OK)
        {
          //rest of code here
        }

Edit 1: I've gone over the aspx, trying to compare the properties with other dialogs. I also tried adding a "Hello World" table - that and, too, is not visible.

  <px:PXSmartPanel runat="server" ID="PanelAskForLCCode" LoadOnDemand="True" AutoRepaint="True" Key="LandedCostCodeSelection" CaptionVisible="True" Caption="Select Landed Cost Code" AcceptButtonID="CstButton4" CancelButtonID="CstButton5">
    <px:PXFormView runat="server" ID="CstFormView2" DataMember="LandedCostCodeSelection" DataSourceID="ds" SkinID="Transparent" Width="100%" Height="100px">
      <Template>
        <px:PXLayoutRule runat="server" ID="CstPXLayoutRule6" StartColumn="True" ControlSize="XM" LabelsWidth="S" DataMember="LandedCostCodeSelection" />
        <px:PXSelector runat="server" ID="CstPXSelector7" DataField="LandedCostCodeID" CommitChanges="True" DataSourceID="ds" />
        <px:PXLabel runat="server" ID="CstLabel8" Text="Hello World" />
      </Template></px:PXFormView>
    <px:PXPanel runat="server" ID="CstPanel3" SkinID="Buttons">
      <px:PXButton runat="server" ID="CstButton4" DialogResult="OK" Text="OK" />
      <px:PXButton runat="server" ID="CstButton5" DialogResult="Cancel" Text="Cancel" /></px:PXPanel></px:PXSmartPanel>

Edit 2: So I changed the controls that I was using. The Form, as a top level control, didn't seem to work.

I changed it up to add a Panel, then a Form and then the control. And now the selector appears.

Here is the .aspx for future me who will forget about all of this.

WARNING: At this point my Selector always shows the first record in the View and immediately ignores whatever I select with the Selector or what I type in. That problem is next and, I think, a different question.

<px:PXSmartPanel runat="server" ID="PanelAskForLCCode" LoadOnDemand="True" AutoRepaint="True" Key="LandedCostCodeSelection" CaptionVisible="True" Caption="Select Landed Cost Code" AcceptButtonID="CstButton4" CancelButtonID="CstButton5">
    <px:PXPanel runat="server" ID="CstPanel9" DataMember="LandedCostCodeSelection">
      <px:PXFormView runat="server" ID="CstFormView10" DataMember="LandedCostCodeSelection" SkinID="Transparent" Width="100%">
        <Template>
          <px:PXSelector runat="server" ID="CstPXSelector11" DataField="LandedCostCodeID" CommitChanges="True" DataMember="LandedCostCodeSelection" /></Template></px:PXFormView></px:PXPanel>
    <px:PXPanel runat="server" ID="LandedCostCodeSelectionButtons" SkinID="Buttons">
      <px:PXButton runat="server" ID="CstButton4" DialogResult="OK" Text="OK" />
      <px:PXButton runat="server" ID="CstButton5" DialogResult="Cancel" Text="Cancel" /></px:PXPanel></px:PXSmartPanel>

enter image description here

Customizer
  • 61
  • 10

1 Answers1

0

Try this aspx instead:

<px:PXSmartPanel runat="server" ID="PanelAskForLCCode" LoadOnDemand="True" Caption="Select LC Code" CaptionVisible="True" Key="LandedCostCodeSelection" AutoRepaint="True" Width="960px">
    <px:PXFormView runat="server" ID="CstFormView5" DataMember="LandedCostCodeSelection" DataSourceID="ds" Width="100%" Height="200px" CaptionVisible="False" Caption="LC Selection" SkinID="Transparent">
        <Template>
            <px:PXLayoutRule runat="server" ID="CstPXLayoutRule6" StartColumn="True" DataMember="landedCostCodeSelection" ControlSize="M" LabelsWidth="S" />
            <px:PXSelector runat="server" ID="CstPXSelector8" DataField="LandedCostCodeID" CommitChanges="True" />
            <px:PXPanel runat="server" ID="CstPanel2">
                <px:PXButton runat="server" ID="CstButton3" Text="Add" DialogResult="OK" />
                <px:PXButton runat="server" ID="CstButton4" Text="Cancel" DialogResult="Cancel" />
            </px:PXPanel>
        </Template>
    </px:PXFormView>
</px:PXSmartPanel>

Unless you messed it up pasting it here, I believe your controls should all be part of the Template node.

Deetz
  • 329
  • 1
  • 16
  • Thank you for looking. Alas, that doesn't seem to be the issue. I noticed that in your PXLayoutRule you set the DataMember to landedCostCodeSelection with a lower case L. I tried both combinations. I decided to try adding a label control and the label did not appear, either. It's almost like the controls aren't being rendered vs not being present. – Customizer Dec 11 '20 at 20:34