cancel
Showing results for 
Search instead for 
Did you mean: 

Screen refresh after error message

Former Member
0 Kudos

Hi experts,

I have a problem with refreshing the screen when an error message is returned.

For example, ticking checkbox A will disable inputfield B to read only, and vice versa.

In the mean time, I have inputfield C which is a NUMC field.

The problem lies with the following process:

1. Incorrectly entered inputfield C with alphabets instead of numbers.

2. Tick checkbox A (this will trigger onToggle)

3. Error is returned that inputfield C is only numeric.

4. Inputfield B is not disabled due to the error message returned.

Now we have a vulnerability where inputfield B can be entered with values even though checkbox A is ticked, which violates my requirement.

I need to disable inputfield B even when the error message is returned.

Please advise on how I can solve this. Thank you very much!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I just tested your scenario....i did following....i have a check box...which controls one of my input field ( a char20 field)....and i have another input field which is numc4 field...so a numeric field.....a button to which takes me to the next view...which does not have anything just the entries from the first view.....

my check box has an on toggle action method....which disables my char field....

i did following to simulate your case....i checked my check box....so my char field is disabled....

now i put in characters in numeric field....and then pressed the btn to go to next view....i got an error that "the entered value can only contain numerical characters"

but my check box is still checked and my char field is still disable... now if i enter the numeric values...i am able to go to my next view....and no issues....

can you pls clarify how you are controlling the enable/disable property of the input field which you are controlling through the check box...i have a context attribute of type wdy_boolean and i am setting this if I check/uncheck the check box...inside my toggle action method....

Thanks...

AS....

Former Member
0 Kudos

Hi J Are,

For my case, the flow is as follows:

1. Enter alphabets in the numeric field first

2. Tick the checkbox. This should then disable another inputfield.

However, an error message is returned for the mistake in step #1.

Because of this, it does not refresh the screen to disable inputfield.

Btw, my codes to disable the field is written in WDDOMODIFYVIEW.

I have an empty ONACTION for the checkbox to just trigger WDDOMODIFYVIEW.

Former Member
0 Kudos

Hi,

[

Btw, my codes to disable the field is written in WDDOMODIFYVIEW ]

well you can solve your issue by moving this code to WDDOBEFOREACTION....also copy the same code under the onaction method....it is better programming...since wddomodyview runs all the time on any change you do on the screen....

what is happening is that when we put in the char values into numc field...there is a hard error coming from system...which is halting the program flow....and your code in wddomodifyview is not running...

since wddodeforeaction method runs before this system error pops up...it will work for you...i just tested this and it is working for me....

thanks...

AS....

Former Member
0 Kudos

Thanks J Are, works just nice for me. Problem solved!

Answers (1)

Answers (1)

Former Member
0 Kudos

hi ,

in ur OnToggle for checkbox A

set the context attribute which is binded to the Inputfield B , to ' ' ( blank)

this attribute is of type WDY_BOOLEAN


DATA lo_nd_cn_node TYPE REF TO if_wd_context_node.
    DATA lo_el_cn_node TYPE REF TO if_wd_context_element.
    DATA ls_cn_node TYPE wd_this->element_cn_node .
    DATA lv_attr  LIKE ls_city-ca_attr.
*   navigate from <CONTEXT> to <CN_VISIBLE> via lead selection
    lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_ca_attr).
 
*   get element via lead selection
    lo_el_cn_node = lo_nd_cn_node->get_element(  ).
 
*   set single attribute
    lo_el_cn_node->set_attribute(
      EXPORTING
        name =  `CA_ATTR`
      IMPORTING
        value = ' '  ).

regards,

amit

Former Member
0 Kudos

Hi amit,

Sorry but can you please elaborate? Not sure how this will overcome the problem. Thanks!

Former Member
0 Kudos

Hi, In the onToggle method ofyour checkbox A, read the contents of your numeric input field C. Thenk check if it Contains Any (CA) characters, If yes disable your input field B if it is enabled. Hope this helps! Radhika.