Live TextEntry value

Pretty basic question. If I have a TextEntry box I want to evaluate the value.  Something along the lines of

DLSYS.Read(Dsp.TextEntry1)

The  idea here is a popup form that you use TextEntry1 to type in the name of a module.. Then a script will take that text entry and open a corresponding faceplate.  

Thanks in advance

1 Reply

  • You will have to have interaction logic on the TextEntry1 OnWrite and OnEnter interactions to update a variable to use and open the Faceplate Display.

    For Example (EnteredTag is a display variable of string type):

    TextEntry1.OnWrite(newValue: string): string
    {
    Dsp.EnteredTag = String(newValue);
    return Dsp.EnteredTag;
    }

    TextEntry1.OnEnter(): void
    {
    let TagOK = await DLSYS.ExistsAsync(Dsp.EnteredTag + "/BAD_ACTIVE.CV");
    if (TagOK == true) {
    //Find Position of TextEntry1 to Open FP near
    let region = DL.GetDisplayElementRegion(Dsp.TextEntry1);
    let pos = new Types.Placement({
        Option: Constants.PlacementOption.NearRegion,
        Region: region,
        UseCachedPosition: false
    });
        DL.OpenFaceplateAsync(Dsp.EnteredTag,[pos]);
    }
    else {
        //Tag entered doesn't exist
        
    DL.MessageBoxAsync('Tag ' + Dsp.EnteredTag + ' does not exist','Error', Constants.MessageBoxButtonType.MB_OK, 30 )
    }
    }