Skip to main content
Question

Issue with PXRichTextEdit and .SetEnable

  • 23 July 2024
  • 6 replies
  • 65 views

Help??

Have a screen that has a PXRichTextEdit that is bound to a child grid field.  So that as we edit the records in the grid, can edit line-level notes.  It is in a tab.

                                    <px:PXRichTextEdit AllowInsertPrevParameter="False" AllowInsertParameter="True" AllowLoadTemplate="True" AllowSourceMode="True" AllowSearch="True" AllowPlaceholders="True" AllowMacros="True" AllowAttached="True" textmode="MultiLine" Height="100%" Width="100%" runat="server" ID="edNoteHtml" DataField="NoteHtml" Style="border-width: 0px; border-top-width: 1px; width: 100%;">
 

In code, checking another field and enabling/disabling PXRichTextEdit field (noteHtml):
 

        protected void _(Events.RowSelected<SSPAgreementSection> e)
        {
            var row = (SSPAgreementSection)e.Row;
            if (row == null) return;

            if(row.Locked == true)
            {
                PXUIFieldAttribute.SetEnabled<SSPAgreementSection.noteHtml>(e.Cache, row, false);
            }
            else
            {
                PXUIFieldAttribute.SetEnabled<SSPAgreementSection.noteHtml>(e.Cache, row, true);
            }

        }

 

Works great, enables/disables the field.

Issue is that after going past a record that disables it, it then will not DISPLAY the values properly as you got back to an enabled line.  

 

Click on Row 4:  Shows record properly, enabled, can edit just fine.

 

Click on Row 5 (which should be disabled)...Headers from RichTextEditor go away, can’t edit the values in it.  Great.

 

 

Click Back on Row 4, editor headers re-appears, but the text is nowhere to be seen and the box is tiny and no way to get it to show again.

 

If you click the grid ‘Refresh’ icon, does anything change?


Unfortunately no, that just refreshes the grid.  Doesn’t do anything to the display of the html editor under the grid.  :(

I did notice that if I resize the form a couple times and click back and forth on enabled rows, it starts working again.  Until I go back through a disabled row.

Guess I probably need to log a bug with Acumatica and say “can’t do that”.  :(


You could experiment with AutoCallBack on the grid and see if you could refresh the textbox.


Hi  @JEFSMI ,

Could you please try it like this:

<Template>
            <px:PXRichTextEdit ID="edOutputJsonDisplayFields" runat="server" DataField="OutputJsonDisplay" Style="width: 100%; height: 120px" AllowAttached="true"
                            AllowSearch="true" AllowMacros="true" AllowLoadTemplate="false" AllowSourceMode="true" >
                <AutoSize Enabled="True" MinHeight="216" />
                
            </px:PXRichTextEdit>
        </Template>


Jini - thanks for the thought - it didn’t work.  I put your exact one in (just changing the DatField) and same issue.
FYI - apparently my HTML didn’t copy up above - I did have the AutoSize enabled, but tried yours as you have a couple other things slightly different.  No success.  :( 

 

My original full ASPX:

                                    <px:PXRichTextEdit AllowInsertPrevParameter="False" AllowInsertParameter="True" AllowLoadTemplate="True" AllowSourceMode="True" AllowSearch="True" AllowPlaceholders="True" AllowMacros="True" AllowAttached="True" textmode="MultiLine" Height="100%" Width="100%" runat="server" ID="edNoteHtml" DataField="NoteHtml" Style="border-width: 0px; border-top-width: 1px; width: 100%;">
                                        <AutoSize Enabled="True" MinHeight="216" />
                                        <LoadTemplate TextField="Note" Size="M" DataSourceID="ds" ValueField="SectionCode" ViewName="AgreeTemplate" DataMember="AgreeSectionRO" TypeName="SSS.SSP.SSPAgreementMaint"></LoadTemplate>
                                        <InsertDatafield TextField="Name" ValueField="Path" DataSourceID="ds" ImageField="Icon" DataMember="EntityItems"></InsertDatafield>
                                    </px:PXRichTextEdit>
 


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


Reply