cancel
Showing results for 
Search instead for 
Did you mean: 

checkbox to open 2 fields in webdynpro

Former Member
0 Kudos

Dear

i need to make one checkbox when i checked it open new small page or session have 2 fields first hard code second field value ( main work center )

when i write main work center i need to update this value on iw32 .

please Answer me

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

amy_king
Active Contributor
0 Kudos

Hi Eman,

This is a very wide-open question so it's difficult to provide an answer. You may want to check out these tutorials for getting started with Web Dynpro ABAP...

You may also find the tutorial series Introduction to Web Dynpro ABAP by Thomas Jung to be helpful...

And for demonstration of using popup-windows...

Cheers,

Amy

Former Member
0 Kudos

i make check box and two fields but if checkbox not checked the cell will be editable !!

amy_king
Active Contributor
0 Kudos

Hi Eman,

The InputField UI element has a boolean property called readOnly. Bind this property to a context attribute of type WDY_BOOLEAN. The Checkbox UI element has an event called onToggle. Create an event handler for this onToggle event, and in the event handler code, set the value of the WDY_BOOLEAN context attribute to true or false. This will toggle the InputField to read-only or editable depending on the value of the bound WDY_BOOLEAN context attribute.

Cheers,

Amy

Former Member
0 Kudos

Dear Amy

this is screen shot for my web dynpro please check and till me .

method ONACTIONGROUNDCALLCHECKBOX .
   DATA lo_nd_ground_calls TYPE REF TO if_wd_context_node.
   DATA lo_el_ground_calls TYPE REF TO if_wd_context_element.
   DATA ls_ground_calls TYPE wd_this->element_ground_calls.
   DATA lv_checkbox LIKE ls_ground_calls-checkbox.
     DATA lv_textview LIKE ls_ground_calls-textview.
     DATA lv_gewrk LIKE ls_ground_calls-gewrk.
     DATA lo_el_context TYPE REF TO if_wd_context_element.
     DATA ls_context TYPE wd_this->element_context.
     DATA lv_enabling LIKE ls_context-enabling.

    lo_el_context = wd_context->get_element(  ).

*   lo_el_context->get_attribute( EXPORTING name =  `ENABLING` IMPORTING value = lv_enabling ).


   lo_nd_ground_calls = wd_context->get_child_node( name = wd_this->wdctx_ground_calls ).
   lo_el_ground_calls = lo_nd_ground_calls->get_element(  ).

   lo_el_ground_calls->get_attribute( EXPORTING name =  `GEWRK` IMPORTING value = lv_gewrk ).
   lo_el_ground_calls->get_attribute( EXPORTING name =  `CHECKBOX` IMPORTING value = lv_checkbox ).
   lo_el_ground_calls->set_attribute( name =  `TEXTVIEW` value = lv_textview ).

IF lv_checkbox = 'X'.
lo_el_ground_calls->set_attribute( name =  `TEXTVIEW` value = '     مركز الخدمة المعتمد  ' ).
lo_el_ground_calls->set_attribute( name =  `ENABLING` value = 'X' ).

ELSE.
   lo_el_ground_calls->set_attribute( name =  `ENABLING` value = '' ).
   lo_el_ground_calls->set_attribute( name =  `TEXTVIEW` value = '' ).

ENDIF.

endmethod.

my code but this not working

i need if i checked for كولات أرضيه open 2 fields : first hard code name (main work center) second editable filed (work center) .

Thanks waiting for ur answer Amy.


ramakrishnappa
Active Contributor
0 Kudos

Hi,

The property 'ENABLED"  of attribute WC_INPUTFIELD should be bound to context attribute

"ENABLING".

Please look into the below pic.

Hope this helps you.

Regards,

Rama

Former Member
0 Kudos
ramakrishnappa
Active Contributor
0 Kudos

Hi,

The dump is because of the attribute "ENABLING" is not inside the node "GROUND_CALLS".

The code written below results in dump.

lo_el_ground_calls->set_attribute( name =  `ENABLING` value = 'X' ).

Solution1:

1. Move the attribute "ENABLING" inside the node "GROUND_CALLS".

2. Then bind the attribute to ENABLED property

Solution 2:

1. Change the above line of code as below

wd_context->set_attribute( name =  `ENABLING` value = 'X' ).

Former Member
0 Kudos

when i checked checkbox open 2 fields but field no. 2 not editable .. why ??

ramakrishnappa
Active Contributor
0 Kudos

Hi Eman,

Did you bind the attribute "ENABLING" to view element WC_INPUTFIELD ? If so it should work.

Could you give me your current code as well.

Regards,

Rama

Former Member
0 Kudos

method ONACTIONGROUNDCALLCHECKBOX .
   DATA lo_nd_ground_calls TYPE REF TO if_wd_context_node.
   DATA lo_el_ground_calls TYPE REF TO if_wd_context_element.
   DATA ls_ground_calls TYPE wd_this->element_ground_calls.
   DATA lv_checkbox LIKE ls_ground_calls-checkbox.
     DATA lv_textview LIKE ls_ground_calls-textview.
     DATA lv_gewrk LIKE ls_ground_calls-gewrk.
     DATA lo_el_context TYPE REF TO if_wd_context_element.
     DATA ls_context TYPE wd_this->element_context.
     DATA lv_enabling LIKE ls_context-enabling.

    lo_el_context = wd_context->get_element(  ).

   lo_nd_ground_calls = wd_context->get_child_node( name = wd_this->wdctx_ground_calls ).
   lo_el_ground_calls = lo_nd_ground_calls->get_element(  ).

   lo_el_ground_calls->get_attribute( EXPORTING name =  `GEWRK` IMPORTING value = lv_gewrk ).
   lo_el_ground_calls->get_attribute( EXPORTING name =  `CHECKBOX` IMPORTING value = lv_checkbox ).



   lo_el_ground_calls->set_attribute( name =  `TEXTVIEW` value = lv_textview ).

IF lv_checkbox = 'X'.
lo_el_ground_calls->set_attribute( name =  `TEXTVIEW` value = '     مركز الخدمة المعتمد  ' ).
wd_context->set_attribute( name =  `ENABLING` value = 'X' ).

ELSE.
   wd_context->set_attribute( name =  `ENABLING` value = '' ).
   lo_el_ground_calls->set_attribute( name =  `TEXTVIEW` value = '' ).

ENDIF.

ramakrishnappa
Active Contributor
0 Kudos

Hi,

Please replace

wd_context->set_attribute( name =  `ENABLING` value = 'X' ).

with

lo_el_context->set_attribute( name =  `ENABLING` value = 'X' ).

Former Member
0 Kudos

i replaced .. but the same error not editable .

ramakrishnappa
Active Contributor
0 Kudos

hi

can you check binding of property READONLY of field wc_inputfield. if it is checked .. un check the readonly checkbox.

As per your last snap.. enabling is working but problem with read only property.

regards

Rama

Former Member
0 Kudos

i can't found the problem the field not editable why i don't know ??

ramakrishnappa
Active Contributor
0 Kudos

Hi Eman,

I think some binding issue with view element WC_INPUTFIELD

Please do as below

  1. Remove the binding of property "ENABLED" of the field and tick the check box
  2. Bind the context attribute "ENABLING" to the property "READONLY" of field as below

Hope this solves your problem.

Regards,

Rama

Former Member
0 Kudos

i remove the binding of property "ENABLED" of the field and tick the check box and Bind the context attribute "ENABLING" to the property "READONLY" of field as below

but NOT Working  whyyy ??

ramakrishnappa
Active Contributor
0 Kudos

Can you send me the snap shot of field property binding and result screen.

Former Member
0 Kudos
Former Member
0 Kudos

Dear Rama,

the issue was solved , by the context was binding read only

Thanks for ur help

Eman.

Former Member
0 Kudos

please tell me what can i do ASAP .