2

I need a masking settings that can be dynamic. and I found SetInputMask In development guide, but I do not find a way to use it, whether here there who have been using these SetInputMask? how the example to use it?

Thank

Rozak
  • 33
  • 5

2 Answers2

3
    protected virtual void _(Events.RowSelected<FilterDAC> e)
    {
        if (e.Row != null)
        {
            FilterDAC row = e.Row as FilterDAC;
            PXDBStringAttribute.SetInputMask<FilterDAC.stringField>(e.Cache, e.Row, ">CCCC");
/*PXStringAttribute for non DB backed fields*/
        }
    }

If you are trying to change masking on a text box the control must be declared as a PXMaskEdit as shown below :

<px:PXMaskEdit runat="server" DataField="StringField" ID="edStringField" CommitChanges="True" AlreadyLocalized="False"></px:PXMaskEdit>
Joshua Van Hoesen
  • 1,684
  • 15
  • 30
1

May be this will be helpful. Thanks

public class APInvoiceEntry_Extension:PXGraphExtension<APInvoiceEntry>
{
    public override void Initialize()
    {
        PXDBStringAttribute.SetInputMask<APInvoice.docDesc>(Base.Document.Cache, ">CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC");
    }            
}
Gabriel
  • 3,733
  • 16
  • 29
Nayan Mansinha
  • 291
  • 2
  • 4
  • Are you sure it can be set from extension constructor? I looked at existing app usage and it's typically in _FieldSelecting handlers. – Gabriel May 17 '16 at 17:06