Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Element validation #66

Closed
catkbm opened this issue Sep 10, 2017 · 5 comments
Closed

Custom Element validation #66

catkbm opened this issue Sep 10, 2017 · 5 comments

Comments

@catkbm
Copy link

catkbm commented Sep 10, 2017

How can i set filed required validator for My custom element which is created by ownself.

Kindly let me know, thanks in advance

@dkharrat
Copy link
Owner

Which class does your custom element inherit? If it's LabeledFieldController, you just need to provide the validators to the super class. If you can describe in more detail what your custom element does, I can point you in the right direction.

@catkbm
Copy link
Author

catkbm commented Sep 17, 2017 via email

@catkbm
Copy link
Author

catkbm commented Sep 17, 2017 via email

@dkharrat
Copy link
Owner

In this case, pass a set of validators to the LabeledFieldController:

    public CustomEditTextElement(Context ctx, String name, String textPlaceholder, ShopDetailResponse.Result element, Set<InputValidator> validators) {
        super(ctx, name, null, validators);
        mCtx = ctx;
        mHint = textPlaceholder;
        this.element = element;
    }

For an example, on how to pass validators, see the 'samples' project included in the repo.

@catkbm
Copy link
Author

catkbm commented Sep 18, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants