on 01-21-2014 12:57 PM
Hi,
I want to validate some inputfields with the checkAndReportRequiredFields method. Everything works fine with "normal" inputfields.
IWDNode node = null;
v.checkAndReportRequiredFields(node, IMessageConfigureAngebot.EMPTY_NUMERIC_FIELD, new Object[]{"test"});
But the inputfields within a table ( Cardinality 0..n ) are not validated. How can I achieve this?
Thanks ahead.
Bernd
hi Bernard ,
In the link you provided please see this .
If the parameter 'node' is given, the check is restricted to UI Elements bound to attributes of this node's sub tree. If null
is set for parameter node the complete WD Context starting from root node is considered. The method considers Personalization. The method doesn't consider UI elements in Table like UI elements. (IWDTable
, IWDRowRepeater
).
it doesnot support Table UI elements
Regards
Govardan Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bernd,
As for validating each rows in the table values, i suggest you do the following steps:
Step 1;Write a checkMandatoryValues function returning TRUE or FALSE in your component controller
which will check for null values and return false in case it is null along with the Error in ReportException in Message Manager.
Step 2:In the view where in you want to validate the table values
-create a method named for eg:m_ValTable1()
Step 3:In this method:
Use the following logic:
declare two boolean flags named l_flag1=true and l_flag2=false
As correctly specified by Tobias-
Iterate through the context node bound to the table
for(........)
{
Check For column 1
l_flag2=m_checkMandatoryValues(Column1);
l_flag1=l_flag2 && l_flag1;
Check for Column 2
l_flag2=m_checkMandatoryValues(Column2);
l_flag1=l_flag2 && l_flag1;
....
-Do the above for all the columns
}
Note the purpose of the usage of two boolean flags is it would return all the error messages of the columns with wrongly provided input hence making the validation very easy.
Call this method on the button of save or validate or which ever action before which it needs to be performed.
Check this link to get a broader perspective:
Kindly try and let me know.
Regards,
Nimisha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would go the way mentioned by Tobias:
Loop through your context node, do the necessary validation manually with the currentNodeXYElement.... and afterwareds report non-valid fields using the Message Managers reportContextAttributeMessage-Method
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bernd,
you could loop over the node and check those fields manualy in wdDoBeforeAction. Then report validation errors:
validation.reportValidationError(yourAttributePointer, yourMessage, new Object[] {"Your params"});
By the way. Where do you get the "checkAndReportRequiredFields" method from? Is that a WD4J standard method? Never used it before.
Regards,
Tobais
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The method is from the
com.sap.tc.webdynpro.progmodel.api.WDViewController Interface
It works perfectly well except for tables.
I'm struggling to find a solution to the same issue. Did you manage to resolve this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.