on 08-26-2005 11:20 AM
Hi,
I have created an application in which i have 3 input fields. For each input field i need to keep some validation. Say i need to have validations like limit of 8 chars for a particular field, no special characters, should not be blank. How do i go about achieving this in Dynpro. Could you please let me know the details of the same.
thanks
Hi Sunil,
I hope the below link will be helpful to you.
Regards,
Sirisha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sunil,
Have you created the plugs?
Try this link...It'll guide you in creating your application https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/tu... on creating your first web dynpro application - 1.htm
If you have already created the plugs write these lines of code in your event handler method of the button.
if(wdContext.currentContextElement().get<your_att_name>().equals("first page or something")
wdThis.wdFire<Plug1_name>()
else
wdThis.wdFire<Plug2_name>()
Hope this helps,
Best Regards,
Nibu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sunil,
If your requirement is to navigate to different views from a view depending on some user input, you needn't use the controller mapping.
1) Create the source views & embedd them into the same window.
2) Open up the window Diagram view & define plugs from the source view to the target views.
3) In the event handler for the submit button, read the user input from the context attribute and depending on the user input fire the corresponding plug.
Hope this helps,
Best Regards,
Nibu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sunil,
1) you have to create an attribute of your simple type. In case you are not familiar with creating attributes, this is the way to proceed :
In your view, go to your context tab, right click on 'Context' create a new Value attribute. Right click on the created attribute, select 'properties'. Click on the 'type' property of the attribute, click on the small button displayed at the right most end, from 'Local Dictionary' naviage to your simple type and select that.
2) create the UI element, go to it's properties. For the 'text' property , select the attribute you created.
Hope this helps,
Best Regards,
Nibu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nibu,
Creation of type and linking with an attribute is done.
But i am facing a problem in step 2)
i am validating an 'input field' and i am unable to find a property called 'text' in which i can select the attribute i created. There is only the 'value' property where i bind it with the context of the view controller.Please help...
thanks
Hi all,
This is how far i have reached.
1. I have created the context for the 2 input fields and kept the attributes for these as the 2 simple types i have created.
2. I have mapped these contexts to my comp controller and bound the view context to the UI elements(input fields).
3. I have created an action 'Submit' which takes me to a new view.
Now what condition should I give in the 'Submit' event as the validation is not takin place right at this moment. When i click the button it takes me to the 2nd view no matter what input i give
thanks
Hi Sunil,
To create the simple type :
1)In your project go to Dictionary->Local Dictionary -> Data types -> simple types. Right click and create a new type. The new type will open up with the default 'Definition' tab view. There you can find the options for defining the data type, length etc...
Hi Maksim,
You are absolutely right. We cannot restrict special characters through this method.
Best Regards,
Nibu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sunil,
The best way to do this is to create a simple type say 'mytype' in the local dictionary with all the restrictions you want to. Then make attributes of this type and map the 'text' property of the input fields to them.
Hope this helps,
Best Regards,
Nibu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nibu,
Could you please ellaborate on the steps you just told me.
1.How do i place th erestrictions in 'mytype'?
2.What do you mean by make attributes to the type?
Sorry if they are silly Qs but im new to Web Dyn and never used the local dictionary before. So a liitle extra help is needed to get me through this
thanks
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.