cancel
Showing results for 
Search instead for 
Did you mean: 

view refrence

Former Member
0 Kudos

Hi,

in order to use this method it is necessary to pass a view.

How can I pass a the current valid view to this method.

Please note I dont intend to call this method within WDDOMODIFYVIEW.

Regards

ertas

lo_inputfield = cl_wd_input_field=>new_input_field(
         bind_value             = l_binding_string
         enabled                = abap_true
         id                     = 'VH_INPUT'
         length                 = '40'
         read_only              = abap_true
         view                   = view
    ).

Accepted Solutions (1)

Accepted Solutions (1)

former_member230839
Participant
0 Kudos

Hi Ertas,

As a optional parameter you can ignore while calling this method

CL_WD_INPUT_FIELD=>NEW_INPUT_FIELD.

or other wise if you want the view also to be passed, since the VIEW cannot be accessible from any of the methods other tha WDDOMODIFYVIEW, create a view level attribute like CURR_VIEW of type ref to IF_WD_VIEW. And please assign the view value directly to this CURR_VIEW in WDDOMODIFYVIEW when the FIRST_TIME EQ 'X'. So that the View will be stored in the View level attribute CURR_VIEW.

It can be accessible from any of the methods in the View by simply like the following

VIEW = WD_THIS->CURR_VIEW

Regards,

Anil kumar G

Former Member
0 Kudos

its not working in Button onaction event.

Please let me know how can i get the current view object reference in button on action

here is my code:

data: lr_container type ref to cl_wd_uielement_container.

data: lr_inp type ref to cl_wd_uielement.

data: view type ref to if_wd_view.

lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).

lr_inp = lr_container->get_child(

id = 'INPUT_FIELD1'

  • index = index

).

lr_inp->set_enabled( value = abap_false ).

im getting error like " Null object reference...'

Regards,

Kumar K

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>its not working in Button onaction event.

Please let me know how can i get the current view object reference in button on action

As stated a couple of times; you should absolutely only call these methods in WDDOMODIFYVIEW. This is important enough that it is worth reiterating. These methods are only safe and only promised to work in the WDDOMODIFYVIEW. Calling them elsewhere can/will disrupt the phase model, delta handling and eventing model of the Web Dynpro framework and will probably only result in short dumps or missing functionality.

If you need to trigger htis from an action handler, just set a flag in a controller attribute and then check for that flag in the WDDOMODIFYVIEW.

Answers (1)

Answers (1)

Former Member
0 Kudos

Adding or deleteing or updateing any UI element should be done in WDDOMODIFYVIEW method.

You cannot add the new input field in any method other than in WDDOMODIFYVIEW.

Former Member
0 Kudos

i am trying to use the method BIND_VALUE from class CL_WD_INPUT_FIELD to change the bind value of the input field lo_inputfield which is defined and created within wddomodify

Former Member
0 Kudos

view parameter is optional and therefore you can chose to not pass anything there. You can code it this way.

lo_inputfield = cl_wd_input_field=>new_input_field(

bind_value = l_binding_string

enabled = abap_true

id = 'VH_INPUT'

length = '40'

read_only = abap_true

).

Edited by: Pooja Patodia on May 22, 2009 1:24 PM