cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Error 'Could not find attribute' during show/Hide

Former Member
0 Kudos

Hi All,

I have created 3 select options.

I have created 2 radio buttons show and Hide. On the Hide button all the select option should get hidden.

When I click on Hide Radio button, the error is 'Could not find attribute - Shipping' . Where 'Shipping' is an UI of type 'viewcontainerUIElement' type element.

I guess it might be due the UI element is not bind. But in UI 'viewcontainerUIElement' there is no Binding concept only.

Thanks in advance.

Thanks and Regards

Rajender Patyal

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Rajender,

For hiding any UI element try the following steps.

1. Declare a context attribute of type WDUI_VISIBILITY

2. Bind the attribute with the visibility property of the UI elements which you want to hide or show.

3. in the coding set this attribute value to 2 or 1 for hiding or showing the particular UI element.

Former Member
0 Kudos

Hi,

Thanks for the reply.

I had already tried this but tried it once again. Still getting the same error.

Thanks.

Former Member
0 Kudos

Hi

Below is the piece of code I have written.

Where

Lo_el_radio_node_1 - type -   if_wd_context_element

Attribute Name - 'Agent_1' is  UI 'viewcontainerUIElement'.           

Former Member
0 Kudos

Follow the instructions provided by Nihar.  Bind the visibility property for ViewContainerUIElement to the context attribute "VISIBILITY" ( of type WDUI_VISIBILITY). 

On the OnSelect action of Radio button, set the value of above context attribute.

DATA : lv_visibility TYPE wdui_visibility.

**if radio button for Hide Selected **

   lv_visibility = '01'.  "Hide.

**if radio button for Show Selected **

   lv_visibility = '02'.  "Show.


   wd_context->set_attribute(
     EXPORTING
       value  = lv_visibility
       name   = 'VISIBILITY' ). 

Regards, Vinod

Former Member
0 Kudos

Hi Rajendar,

Rajender Patyal wrote:

Hi

Below is the piece of code I have written.

Where

Lo_el_radio_node_1 - type -   if_wd_context_element

Attribute Name - 'Agent_1' is  UI 'viewcontainerUIElement'.           

    Is your attribute 'AGENT_1' present inside the context structure or this is the UI element name u r passing.

The error which you have mentioned generally comes when at run time any attribute is niot found inside a context structure.

Take a attribute inside your node of type 'WDY_BOOLEAN' and bind it with 'Visibility' property of your view container. Set the value of this attribute from any action

& method as suggested by Vinod .

Regards,

Monishankar Chatterjee

Former Member
0 Kudos

Hi Vinod,

Thanks for the reply. Problem is solved. But I am facing problem while enabling and disabling select options

I have created 2 select options and 2 Radio buttons.

Radio button

1.

2.

select option

A.

B.

The requirement is if I select radio button 1 A should be enable and B disabled. and vice versa.

I have created a an attribute ENA with Wdy_Boolean and bind  to the enale properties of the select options to the Node.

I have written the below code on the action of the button lv_enable = 2 or 1

    lv_enable = 02.

  wd_context->set_attribute(
   EXPORTING
      name = 'ENA'
     Value = lv_enable
    ).

Thanks.

Former Member
0 Kudos

Since your requirement is to show/hide specific select-options, this solution will not work as select-options are created using re-usable component WDR_SELECT_OPTIONS.    You may have to toggle between remove_selection_screen_item/add_selection_field methods of interface if_wd_select_options.

Read for reference.

Regards, Vinod

Answers (0)