# Reactive StringField on Gateway Settings

**URL:** <https://forum.inductiveautomation.com/t/reactive-stringfield-on-gateway-settings/83686>\
**Category:** Module Development\
**Created:** [January 2, 2024, 3:26pm UTC](https://forum.inductiveautomation.com/t/reactive-stringfield-on-gateway-settings/83686 "2024-01-02T15:26:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Subin\_Adhikari](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Subin\_Adhikari](https://forum.inductiveautomation.com/u/Subin_Adhikari)\
**Post date:** [January 2, 2024, 3:26pm UTC](https://forum.inductiveautomation.com/t/reactive-stringfield-on-gateway-settings/83686/1 "2024-01-02T15:26:42Z")

</div>

Hello Gurus,

Can someone guide me on overriding the EDIT mechanism in the Gateway Settings for my Module? What I want to achieve is the reactive Disabled StringField which is enabled by the click of a BooleanField only on EDIT. attached is the SS of what I am looking to achieve.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/9/193b2863e86ba33cd385f23ed559f15c37e924a8.png)

Regards

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 2, 2024, 5:36pm UTC](https://forum.inductiveautomation.com/t/reactive-stringfield-on-gateway-settings/83686/2 "2024-01-02T17:36:08Z")

</div>

In a static block in your persistent record implementation, set your password field's stored editor to use the [`PasswordEditorSource`](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.35/com/inductiveautomation/ignition/gateway/web/components/editors/PasswordEditorSource.html), e.g:

```auto
static {
    PasswordE.getFormMeta().setEditorSource(PasswordEditorSource.getSharedInstance());
}

```

---

<div class="post-metadata">

**Author:** ![Subin\_Adhikari](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Subin\_Adhikari](https://forum.inductiveautomation.com/u/Subin_Adhikari)\
**Post date:** [January 2, 2024, 8:45pm UTC](https://forum.inductiveautomation.com/t/reactive-stringfield-on-gateway-settings/83686/3 "2024-01-02T20:45:05Z")

</div>

@paul-griffith

How do I allocate Resources for this now? Instead of "Password" in those generated places, I want them to replace them with different name.

tried the below code all in vain.

> MY\_FIELD.getFormMeta().setEditorSource(PasswordEditorSource.getSharedInstance()).setFieldNameKey("MY\_NAME");

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/b/7bcbe0387f6a8961d929830f881a1b3991b1951c.png)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 2, 2024, 9:29pm UTC](https://forum.inductiveautomation.com/t/reactive-stringfield-on-gateway-settings/83686/4 "2024-01-02T21:29:20Z")

</div>

You'll have to implement your own editor source, which itself implements a custom editor that distinguishes between the "new" and "edit" case for the record edit form:

```java
    private static class ClientSecretEditorSource implements IEditorSource {

        private static final ClientSecretEditorSource INSTANCE = new ClientSecretEditorSource();

        @Override
        public Component newEditorComponent(String id,
                                            RecordEditMode editMode,
                                            SRecordInstance record,
                                            FormMeta formMeta) {
            if (editMode == RecordEditMode.EDIT) {
                return new ClientSecretChangeEditor(id, formMeta, editMode, record, false);
            } else {
                return new ClientSecretEditor(id, formMeta, editMode, record, false);
            }
        }

    }

```

```java
    private static class ClientSecretChangeEditor extends PasswordChangeEditor {

        private ClientSecretChangeEditor(String id,
                                         FormMeta formMeta,
                                         RecordEditMode editMode,
                                         SRecordInstance record,
                                         boolean md5) {
            super(id, formMeta, editMode, record, md5);
        }

        @Override
        protected String getChangePasswordLabelKey() {
            return "OAuth2ClientSettingsRecord.ClientSecret.Change";
        }

        @Override
        protected String getChangePasswordDescKey() {
            return "OAuth2ClientSettingsRecord.ClientSecret.Change.Desc";
        }

        @Override
        protected String getPasswordLabel1Key() {
            return "OAuth2ClientSettingsRecord.ClientSecret.Name";
        }

        @Override
        protected String getPasswordLabel2Key() {
            return "OAuth2ClientSettingsRecord.ClientSecret.Name";
        }

        @Override
        protected String getReTypeDescKey() {
            return "OAuth2ClientSettingsRecord.ClientSecret.RetypeDescription";
        }

        @Override
        protected String getPasswordMismatchErrorKey() {
            return "OAuth2ClientSettingsRecord.ClientSecret.Mismatch";
        }

    }

```

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 2, 2024, 9:32pm UTC](https://forum.inductiveautomation.com/t/reactive-stringfield-on-gateway-settings/83686/5 "2024-01-02T21:32:23Z")

</div>

You'll have to build against the 8.1.24 (or later) version of the SDK for those methods on the `PasswordChangeEditor` to be available to override.

---

<div class="post-metadata">

**Author:** ![Subin\_Adhikari](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Subin\_Adhikari](https://forum.inductiveautomation.com/u/Subin_Adhikari)\
**Post date:** [January 2, 2024, 9:32pm UTC](https://forum.inductiveautomation.com/t/reactive-stringfield-on-gateway-settings/83686/6 "2024-01-02T21:32:51Z")

</div>

Got it, appreciated. Thank you.

---

<div class="post-metadata">

**Author:** ![Subin\_Adhikari](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@Subin\_Adhikari](https://forum.inductiveautomation.com/u/Subin_Adhikari)\
**Post date:** [January 3, 2024, 6:22pm UTC](https://forum.inductiveautomation.com/t/reactive-stringfield-on-gateway-settings/83686/7 "2024-01-03T18:22:59Z")

</div>

@paul-griffith

I Don't see any methods to override those two (password1 and password2) validators in PasswordChangeEditor  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/2/6200d1f120b4bafadfc5cf125b7d4b02780d1522.png)

Am I missing something here ? I am using 8.1.24 SDK

Regards.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 3, 2024, 6:30pm UTC](https://forum.inductiveautomation.com/t/reactive-stringfield-on-gateway-settings/83686/8 "2024-01-03T18:30:34Z")

</div>

You can't change those. They're hardcoded to the Wicket component IDs used in the PasswordChangeEditor; the validation errors that come up are coming from Wicket.

You'd have to recreate PasswordChangeEditor in its entirety to change those, rather than overriding.
