cancel
Showing results for 
Search instead for 
Did you mean: 

Change Web Dynrpo Element attribute dynamically

former_member184386
Active Participant
0 Kudos

Hello experts,

I'm new to WDA, could you tell me how to accomplish this task:

I have a Dropdown element that should be enabled/disabled when another element - a checkbox is checked/unchecked. I already have everything in the layout, and I know to work on the method but I dont know how the element's attribute (dropdown) is changed inside the checkbox's method.

Thanks in advance.

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member184386
Active Participant
0 Kudos

Thanks Thomas, your sample helped a lot...

arjun_thakur
Active Contributor
0 Kudos

Hi Ricky,

Refer to this thread:

Regards

Arjun

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Just data bind a context attribute to the DDLB enabled property. Then from within the action handler of the checkbox you only need to change the context attribute value.

former_member184386
Active Participant
0 Kudos

Hi Thomas,

Thanks for the reply, but I didnt get the second part -

"Then from within the action handler of the checkbox you only need to change the context attribute value."

How is this done, how do I access the context attribute of the dropdown from the checkbox action handler?

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

It is just a normal context attribute. There is nothing special about it just becuase it is bound to the DDLB. Here is some sample code of setting a context attribute:

DATA lo_nd_meeting TYPE REF TO if_wd_context_node.
  DATA lo_el_meeting TYPE REF TO if_wd_context_element.
  DATA ls_meeting TYPE wd_this->element_meeting.
  DATA lv_meeting_id TYPE wd_this->element_meeting-meeting_id.

* navigate from <CONTEXT> to <MEETING> via lead selection
  lo_nd_meeting = wd_context->get_child_node( name = wd_this->wdctx_meeting ).

* get element via lead selection
  lo_el_meeting = lo_nd_meeting->get_element( ).
  lv_meeting_id = 1.
* set single attribute
  lo_el_meeting->set_attribute(
    name =  `MEETING_ID`
    value = lv_meeting_id ).

Here I am setting a meeting id attribute to 1, you would be setting your enabled attribute to true or false.

pranav_nagpal2
Contributor
0 Kudos

Hi Ricky,

Just bind the onToggle event of the check box with any action, say name of the action is onCheck, now when you check or uncheck the check box the code will automatically goes to onCheck action.... here you can write the code to enable and disable the drop down... the code has been given by Thomas....

you have to just set the enable property...

regards

Pranav