# Dialog property question

**URL:** <https://forum.opentap.io/t/dialog-property-question/2225>\
**Category:** General\
**Created:** [November 26, 2024, 3:48pm UTC](https://forum.opentap.io/t/dialog-property-question/2225 "2024-11-26T15:48:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![wittrock](https://avatars.discourse-cdn.com/v4/letter/w/e8c25b/32.png) [@wittrock](https://forum.opentap.io/u/wittrock)\
**Post date:** [November 26, 2024, 3:48pm UTC](https://forum.opentap.io/t/dialog-property-question/2225/1 "2024-11-26T15:48:07Z")

</div>

I think this question is specific to EditorX since I don’t see the same problem in TUI.

I have a dialog that requests the user to select a model number and enter a serial number.  
I also allow both items to be populated automatically from a scanned QR code if it matches a specific pattern.

This all works, but the problem I see is if the user mistakenly enters or scans the wrong value into the SerialNumber field and attempts to delete it an re-enter or scan.

The SerialNumber ‘set’ is only be called the first time the user enters it. If they attempt to modify it, the ‘set’ method is never called again and they must cancel the operation and restart the test plan to be able to re-enter the proper serial number.

As mentioned, this works in TUI though it is very different because of its implementation of IDisplayAnnotation. I am not currently set up on Windows to try Editor instead of EditorX.

Is this expected behavior?

```csharp
class DutSelectDialog: IDisplayAnnotation
{
    public enum DialogResult
    {
        Cancel = 2, Ok = 1
    }

    public DutSelectDialog(List<string> partNumbers)
    {
        PartNumbers = partNumbers;            
    }

    public List<string> PartNumbers {get; private set;}

    private string _serialNumber;

    [Display("Serial Number", Order:100)]
    public string SerialNumber 
    {
        get => _serialNumber;
        set {
            // Specific QR pattern that allows setting both the serial number and part number
            var match = new Regex(@"\A(\d{8}).*(\d\.\d)(\d{11})\Z").Match(value);
            if (match.Success && (match.Groups.Count == 4))
            {
                _serialNumber = match.Groups[3].Value;
                string partnumber = match.Groups[1].Value + "REV-" + match.Groups[2].Value;
                foreach(var pn in PartNumbers)
                {
                    if (pn.StartsWith(partnumber))
                    {
                        PartNumber = pn;
                        break;
                    }
                }
            }
            else
            {
                _serialNumber = value;
            }
        }
    }

    [AvailableValues(nameof(PartNumbers))]
    [Display("Part Number", Order:102)]
    public string PartNumber {get; set;}

    [Layout(LayoutMode.FloatBottom | LayoutMode.FullRow)]
    [Submit]
    public DialogResult Response { get; set; }

    public string Name { get => "Scan Board QR Code"; }
    string IDisplayAnnotation.Description => string.Empty;
    string[] IDisplayAnnotation.Group => Array.Empty<string>();
    double IDisplayAnnotation.Order => -10000;
    bool IDisplayAnnotation.Collapsed => false;
}

```

Thanks,  
Wittrock

---

<div class="post-metadata">

**Author:** ![khang-yong](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opentap.io/khang-yong/32/322_2.png) [@khang-yong](https://forum.opentap.io/u/khang-yong)\
**Post date:** [December 4, 2024, 8:46am UTC](https://forum.opentap.io/t/dialog-property-question/2225/2 "2024-12-04T08:46:32Z")

</div>

Hi @wittrock,

The behavior that you’re seeing is definitely a bug, but currently I do not have the capacity to look into it. Sorry about that.

FYI, we’re going to release a cross platform version of Editor (it will also work with Community License) in the near future. In the meantime, we have a preview version that will work on Ubuntu 22. Will you be interested to give it a try?

Regards,  
Khang

---

<div class="post-metadata">

**Author:** ![wittrock](https://avatars.discourse-cdn.com/v4/letter/w/e8c25b/32.png) [@wittrock](https://forum.opentap.io/u/wittrock)\
**Post date:** [December 4, 2024, 12:54pm UTC](https://forum.opentap.io/t/dialog-property-question/2225/3 "2024-12-04T12:54:22Z")

</div>

Hello @khang-yong ,

Thanks for confirming this isn’t expected.

That’s great that you are working on a cross platform Editor.  
I would love to give it a try even if it is an early preview.

I started a cross platform operator GUI using Avalonia, but I must admit I didn’t get very far before I had to move on to other things.

Having an Editor that is common among the supported platforms would be a great move.

Thanks,  
Wittrock

---

<div class="post-metadata">

**Author:** ![khang-yong](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opentap.io/khang-yong/32/322_2.png) [@khang-yong](https://forum.opentap.io/u/khang-yong)\
**Post date:** [December 10, 2024, 8:13am UTC](https://forum.opentap.io/t/dialog-property-question/2225/4 "2024-12-10T08:13:54Z")

</div>

Hi @wittrock,

Do you have a cloud storage where I can upload the preview installer to you? It’s a pretty huge file (214MB, not optimized). You can email me at [khang-yong.ng@keysight.com](mailto:khang-yong.ng@keysight.com) the link to upload the file to.

Regards  
Khang

---

<div class="post-metadata">

**Author:** ![wittrock](https://avatars.discourse-cdn.com/v4/letter/w/e8c25b/32.png) [@wittrock](https://forum.opentap.io/u/wittrock)\
**Post date:** [December 10, 2024, 1:25pm UTC](https://forum.opentap.io/t/dialog-property-question/2225/5 "2024-12-10T13:25:16Z")

</div>

Thanks @khang-yong ,

I have sent you a link.

-Wittrock
