Highlighted

Validation of text inputs and showing an error message

Community Beginner ,
Jan 09, 2020

Copy link to clipboard

Copied

Hello,

 

in the SDK docs of the LrView there is this function mentioned:

 

validate : (Read-Only)A function called to validate the value. (function, default: nil) The function takes this form:

myValidate( view, value )

Parameters:

  1. view (LrView) This control.
  2. value (any) The value to validate.

Returns three values:

  1. result (Boolean) True if value was valid.
  2. value (any) The new value.
  3. message (string) If result is false, an error message.

First supported in version 1.3 of the Lightroom SDK.

 

This works fine, but I am wondering where the error message can be shown? I have no glue what I need to do to show the message to the user.

 

Thanks in advance

Thorsten

 

Correct answer by thorque73 | Community Beginner

Already resoved by me 🙂 If I lost the focus of the input field I get a message box with the error message.

Topics

SDK

Views

102

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Validation of text inputs and showing an error message

Community Beginner ,
Jan 09, 2020

Copy link to clipboard

Copied

Hello,

 

in the SDK docs of the LrView there is this function mentioned:

 

validate : (Read-Only)A function called to validate the value. (function, default: nil) The function takes this form:

myValidate( view, value )

Parameters:

  1. view (LrView) This control.
  2. value (any) The value to validate.

Returns three values:

  1. result (Boolean) True if value was valid.
  2. value (any) The new value.
  3. message (string) If result is false, an error message.

First supported in version 1.3 of the Lightroom SDK.

 

This works fine, but I am wondering where the error message can be shown? I have no glue what I need to do to show the message to the user.

 

Thanks in advance

Thorsten

 

Correct answer by thorque73 | Community Beginner

Already resoved by me 🙂 If I lost the focus of the input field I get a message box with the error message.

Topics

SDK

Views

103

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Community Beginner ,
Jan 09, 2020

Copy link to clipboard

Copied

Already resoved by me 🙂 If I lost the focus of the input field I get a message box with the error message.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...