cancel
Showing results for 
Search instead for 
Did you mean: 

how highlight mandatory fields check of different tab ?

Former Member
0 Kudos

Hi All ,

   In my view I have a tabstrip where I have 3 tabs. Now all the tabs contains different input fields & some of them are mandatory.

i have use  ' CL_WD_DYNAMIC_TOOL=>CHECK_MANDATORY_ATTR_ON_VIEW ' to check this fields in a button action which is outside of the tab strip.

Now by this check if any field left blank will automatically be highlighted. Here I am having a issue when checking this if the fields remains in a different tab

then I am getting error message properly but user need to go the particular tab to view the highlighted fields.

Like I am in tab 2 . I have filled all the mandatory fields for TAB 2 butI  forgot to fill one mandatory field of TAB 1. Now

user requirement is that while checking ( Button Action outside the tab )  the selected tab should automatically changed to TAB 1 & highlight the particular field.

Any response how to achieve this ?

Thanks & regards,

Monishankar C

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks Kiran ..

Thanks Amy...

 

In case there is  GE two tabs containing unfilled mandatory fiels then any of them can be highlighted.

I am using the above mentioned method which returns me like below

Now there is 1 thing I can do like I know particular tabs for the above attributes, there for by checking attribute name I cam make any tab selected. But I want avoid that procedure & I want to know if there is any method by which I can get their position in layout ( to get the respective tab ).

I am not displaying any message in my method. Inside the above method ( CHECK_MANDATORY_ATTR_ON_VIEW )  system is using message manager for displaying error message. Please let me know whether calling the above check I will be able to update my context attribute linked to selected tab property.

@Amy  can you let me know how U have highlighted the tabs after mandatory check ?

Thanks & regards,

Monishankar C

amy_king
Active Contributor
0 Kudos

Hi Monishankar,

If I understand your question, you would like to easily determine which tab has an error by looking at the MESSAGES table returned by CL_WD_DYNAMIC_TOOL=>CHECK_MANDATORY_ATTR_ON_VIEW( ). One possibility is to use a different context node for each tab, that way  you can know which tab has an error by looking at the MESSAGES-CONTEXT_ELEMENT field. Keep in mind though you will have difficulty changing the selectedTab property by setting a value in the context if CL_WD_DYNAMIC_TOOL=>CHECK_MANDATORY_ATTR_ON_VIEW( ) has already issued error messages. Try calling the method twice-- first without issuing messages just to determine if errors exist, then change the selectedTab as needed, and lastly validate again with messages.

Since we cannot change the context after issuing messages, I similarly split my validations into three steps in order to be able to set the tab icons according to whether errors exist. [1] Validate the contents of each tab without issuing error messages and make a note of which tabs have errors. [2] Set the icon on each tab (by setting bound context attributes). [3] Validate again, this time issuing messages.

Cheers,
Amy

amy_king
Active Contributor
0 Kudos

Hi Monishankar,

You can change tabs programmatically by binding the Tabstrip's selectedTab property to a context attribute and then setting the value of the bound attribute. Be aware though that you cannot change the context AFTER issuing a message with the Message Manager-- you will get inconsistent messaging behavior if you do. So you need to detect whether an error exists, set the bound attribute for selectedTab, then issue your message. The previous poster has a good point though-- what to do when errors exist on multiple tabs? I solved this issue in one of my WDA applications by having a status icon on each tab (green, yellow or red LED) to indicate if errors exist on each tab.

Cheers,

Amy

former_member184578
Active Contributor
0 Kudos

Hi,

This is not solution just one input. Check whether in onNaviagte Action of message area you can handle or not.  check the standard component WDR_TEST_MSG_AREA.

Also if you forgot filling mandatory field in both tab1 and tab3 then which tab should be highlited.?

I feel to keep a navigation at message and on clicking of navigation go to the corresponding tab and highlight the input field.

Regards,

Kiran