on 12-16-2014 3:08 PM
Hi All,
I got a requirement to add new field in CRMCMP_CCS_EML component..in view Mailbody...when I looked at the component it does not have any context nodes..all the fields are added using BSP code..So I thought of doing same for my New field&Button ..
I have placed below BSP code in MailBody.htm page..Now my new field is coming with F4 help and button is also coming and it's triggering the event when I clicked on the button..every thing works fine..
I added my new field as shown below..
<thtmlb:inputField id = "UNAME"
description = "Forward To "
helpId = "USER_ADDR"
helpOutputFields="UNAME=BNAME;"/>
<thtmlb:button id = "Go"
text = "Go"
tooltip = "<%= otr(CRM_IC_APPL/check) %>"
enabled = "X"
onClick = "ITEMFORWARD" />
My Issue is it's keep on getting refreshed every time when we enter hit or if you do any thing on the CRM UI screen..Could you please let me know how to resolve this Issue..
And How do I read new field value in my class...
I appreciate your help on this.
Thanks,
Sara.
Hi Sara,
Step 1. Make a attribute in implementation class of your view. For eg 'GV_HTM_VALUE'
Step 2. You have to add attribute 'value'.
<thtmlb:inputField id = "UNAME"
description = "Forward To "
value = "<%= controller->GV_HTM_VALUE %>"
helpId = "USER_ADDR"
helpOutputFields="UNAME=BNAME;"/>
Step 3. Redefine 'DO_HANDLE_DATA' method of impl clss of your view. Write the below code.
CALL METHOD super->do_handle_data
EXPORTING
form_fields = form_fields
global_messages = global_messages.
DATA: wa_form_fields TYPE ihttpnvp.
READ TABLE form_fields INTO wa_form_fields WITH KEY name = 'uname'.
IF sy-subrc = 0.
me->gv_htm_value = wa_form_fields-value.
ENDIF.
Now your value will not get lost.
Regards,
Ritu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Ritu..
It solved my Issue..
I need one more thing..
I need to populate another field value based on the value that is selected from F4..like if we select the user id on F4 i need to display corresponding name in another field..
For this if I have written select in DO_PREPARE_DATA..? But it trigger multiple times and it will not effect performance right..
Could you please let me know how I can achieve this without effecting performance..?
Thanks,
Sara.
Hi Sara,
Write the below code on DO_HANDLE_DATA method only. The below code will set the value in 'abc' field when you select the value in 'uname' field. abc is the field in context node.
DATA: wa_form_fields TYPE ihttpnvp,
lt_form_fields TYPE tihttpnvp.
lt_form_fields = form_fields.
READ TABLE form_fields INTO wa_form_fields WITH KEY name = 'uname'.
IF sy-subrc = 0.
me->gv_htm_value = wa_form_fields-value.
wa_form_fields-name = 'dummy_abc'. ""dummy is context node name, abc is fieldname
wa_form_fields-value = 'info'.
INSERT wa_form_fields INTO TABLE lt_form_fields.
ENDIF.
CALL METHOD super->do_handle_data
EXPORTING
form_fields = lt_form_fields
global_messages = global_messages.
Now the setter method of 'abc' field will be triggered and the value will be set.
If you want to set the value in the field which is made from htm page then you just need to set the attibute of impl class as you did for uname,
Let me know in case of any queries.
Thanks,
Ritu
Hi Sara,
input field must have a attribute value.
THis is one example from same view
<thtmlb:inputField id = "fromAddress"
value = "<%= gv_from %>"
width = "100%"
disabled = "true" />
In this case gv_form is your page attribute, and you can set this from set_models method of your controller.
You can also choose to add a public attribute in controller and access the attribute like
<%= controller->zttr %> .
Hope this helps.
Regards
Anirudha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Anirudha for the response..I need some more information..
These are the steps I have done..
1)Create page attribute GV_FORWARD_AGENT in BSP page
2) Added that attribute in the code as shown below..
<thtmlb:label text = "Forward To " />
<thtmlb:inputField id = "UNAME"
value = "<%= gv_forward_agent %>"
description = "Forward To "
helpId = "USER_ADDR"
helpOutputFields="UNAME=BNAME;"/>
My question is for setting value using SET_MODELS method.
Do I need to write the code in controller..class..? which method..? I have both standard and custom controller also..Which one do I need to enhance it..?
I have set_models method in View class as well..Shall I write the code over there..?
I really appreciate your help on this.
Thanks,
Sara.
User | Count |
---|---|
5 | |
1 | |
1 | |
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.