on 01-21-2008 10:49 AM
Hi all,
I've created a context in my Custom Controller like as follow:
Person -> Value Node
IdPerson -> Attribute (java.lang.Long)
Name -> Atrribute (string)
In my view, i've defined the State of InputField to required, when i run the Application, the field appears with *, but when i call a action, the required isn't verified.
The action isn't with the "Without validation" option selected.
Does anybody knows what can i do to enable the required validation automatically?
Thanks
Hi Isaias,
Setting the property to required only gives the red * next to the field but doesnot validate automatically.
You need to write the code for validation yourself.
Hope that helps,
Thanks,
Rajit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dynpro framework validates numeric fields as mandatory anyways, so the inputfield can't be empty or contain non-numeric chars , you can still validate for a valid ID tho :).
If you are referring to your <Name> inputfield, well you can validate the same way i explained here:
[Dynamic validation regardless UI element|;
Regards.
Julio Herrera
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Isaias,
Check this PDF: [Validations|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/837d9290-0201-0010-1381-e633fe17cb14]
Regards, Suresh KB
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Isaias,
You can proceed in this way
e.g. if language is the required field, then
try
{
if(wdContext.nodeLanguage_Key_Node().currentLanguage_Key_NodeElement().getCtx_language_key_node().trim().equals(""))
{ wdComponentAPI.getMessageManager().reportException("Enter Language", true);
}
}
catch(Exception e1)
{
wdComponentAPI.getMessageManager().reportException("Enter Language", true); }
and then you call this function whenever you want.
if you want to put asterik mark dynamically , you can create a context variable ( lets say ctx_State) of the type state and then assign it to the state proprty of the input field.
and then write the code as:
wdContext.currentContextElement().setCtx_State(WDState.REQUIRED);
Hope this helps,
Thanks & Regards,
Namrta Mahajan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.