cancel
Showing results for 
Search instead for 
Did you mean: 

Textview UI Element

former_member205842
Participant
0 Kudos

HI ,

         

  In my screen am using textview UI element for displaying question (I am happy. . ..<<Project Name>>) , i want to replace <<project name >> with my existing project name dynamically, how to it

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

hi,

1) create a node - Node_project ( 0 -1 cardinality )  -->  with attribute Project ( type char 100).

2) create a text view UI element ->  go to TEXT property - bind with attribute Project.

3) go to wddomodify method of the view. use wizard choose attribute and select set  radio button.

method WDDOMODIFYVIEW .

      DATA  : lo_nd_node_project TYPE REF TO if_wd_context_node,
                  lo_el_node_project TYPE REF TO if_wd_context_element,
                  ls_node_project TYPE wd_this->element_node_project,
                  lv_project TYPE wd_this->element_node_project-project.

*   navigate from <CONTEXT> to <NODE_PROJECT> via lead selection
     lo_nd_node_project = wd_context->get_child_node( name = wd_this->wdctx_node_project ).
 
*   get element via lead selection
     lo_el_node_project = lo_nd_node_project->get_element( ).

*   @TODO fill attribute

data : lv_prj type char100.   <<<< create a variable

CONCATENATE 'I am happy and proud to be resident at' 'Nice Homes' INTO lv_prj SEPARATED BY space.


* (  keep whatever project name you want by declaring a variable and assign the value and concatenate  )



     lv_project = lv_prj.

*   set single attribute
     lo_el_node_project->set_attribute(
       name `PROJECT`
       value = lv_project ).

endmethod.

let me know if you have any issues.

Thanks

RK v

ramakrishnappa
Active Contributor
0 Kudos

Hi Syed,

  • Create an attribute MY_PROJECT in context node XYZ
  • Now, create one more text ui element beside your text view ui element TEXT_VIEW_QUESTION

      i.e. ( TEXT_VIEW_QUESTION + TEXT_VIEW_MY_PROJECT

  • Set the property TEXT of text view ui element TEXT_VIEW_MY_PROJECT with context attribute MY_PROJECT
  • Now, set the value of MY_PROJECT as per your requirement as below

          lo_context_element->set_attribute(

               exporting

                         name = 'MY_PROJECT'

                        value = 'Nice_homes' ). " your project name here

Now,

     text view ui elements contain values as below

   

text_view_question : I am happy and proud to be resident at

text_view_my_project: Nice_homes

Result:  I am happy and proud to be resident at Nice homes.

Hope this helps you

Regards,

Rama

Former Member
0 Kudos

Create an attribute or node with attribute of type string and bind that attribute with text property of text view and dynamically set the value in that attribute.