cancel
Showing results for 
Search instead for 
Did you mean: 

Input Validation

Former Member
0 Kudos

Hi all

I have a table with 2 columns. column1 is of text view and column2 is Input field.

The user should not be allowed to enter a value in the column2 ( input field) greater than the value populated in column1(textview).

So for Eg; if the column1 is populated with value 100, The user should not be able to enter a number greater than 100 in the column2 input field.

Please let me how this can be achieved.

I appreciate the help.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

You can have onEnter Event for the InputField to check this

use the following code to achive this

data: lr_element type ref to if_wd_context_element.

data: ls_node type <node_type>

lr_element = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).

lr_element->get_static_attributes( static_attributes = ls_node ).

if ls_node-col1 = 100 and ls_node-col2 > 100.

  • raise error

endif.

Abhi

Answers (2)

Answers (2)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

There is nothing that you are going to be able to do currently in WD clientside that will allow you to enforce this rule. You will have to code some validation logic that reads the context attributes and produces an attribute message when they have violated this view. I would probably place this logic in WDDOBEFOREACTION method of your view, this way it gets check before any actions fire. You could place an onEnter event handler on the input fields. Down the road, we will add an OnChange event handler to the inputField that would allow for you to check the values when losing focus on the field - but that is something that is still in development.

abhimanyu_lagishetti7
Active Contributor
0 Kudos

two duplicate posts.. some thing was wrong.

My previous post is duplicated here strange.

Edited by: Abhimanyu Lagishetti on Jul 14, 2008 12:37 PM

Edited by: Abhimanyu Lagishetti on Jul 14, 2008 12:39 PM