on 04-28-2008 5:14 PM
Hi,
I'm trying to validate a field, for example first Name in BP (component IUICMD) , but I don't know wich method I should use to read the specific attributes of the context node on the event EH_ONSAVE, somebody knows how to get the value?
Thanks n' Best regards,
Luis
Edited by: Luis pérez on Apr 29, 2008 9:16 AM
Hi Luis,
you access the data from the UI layer via the context nodes. So you need to identify which context node of your view the relevant attribute belongs to, most likely something like Detail, BuilHeader or so. Attrbute should be FIRST_NAME for the first name field.
Tip: At runtime, put the cursor into the field and press the F2 key. A popup will show up with component name, view name, context node and attribute.
To access the attribute value in the coding you need to go access the the context node via the TYPED_CONTEXT attribute of the view. From the context node you could either access the attribute value via a getter (you may need to generate a specific one) or by accessing the current entity and go from there.
So e.g.
me->typed_context-><your_context_node_name>->get_<your_attribute>( ) for the getter access
or
lr_ent = me->typed_context--><your_context_node_name>->collection_wrapper->get_current( ). lv_val = lr_ent->get_property( '<your_attribute>').
Best regards
Peter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Actually I am facing Problem regarding my current object. When this line of code runs
current = collectio_wrapper->get_current(). of my defined ATTRIBUTE, it shows null so my field property does not get set. So i am not able to save it..
What can be the issue like.................!
Could you please help me out.............!
Harkesh Dang
Hi, I finally found the method to get te value of the attribute in the context node,
Example:
L_PERSON is the instance of the one node context.
L_back is a string.
CALL METHOD L_PERSON->IF_BSP_MODEL_BINDING~GET_ATTRIBUTE
EXPORTING
ATTRIBUTE_REF =
ATTRIBUTE_PATH = 'STRUCT.LASTNAME' "<- For example
INDEX =
COMPONENT =
NO_CONVERSION_EXIT = 0
RECEIVING
VALUE = l_back.
I hope this will help!
Thanks N' Best Regards.
Luí
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.