cancel
Showing results for 
Search instead for 
Did you mean: 

Binding

manubhutani
Active Contributor
0 Kudos

Hi Grur's

Can anybody tell me the difference b/w data binding and context binding.

please dont provide with the links..

just the basic concept..

and how to bind a text view..

i am ablle to create binding of a table but nort of a text view

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi gaurav,

Context binding is the one where you bind nodes of component controller and context.

data binding i s the one where you bind your UI elements with the nodes in your context of that view.

if you want to bind text view with a node, then you have to create an attribute of type <b>string</b> inside a node and then bind that attribute with the text view.

-


regards,

alex b justin

Answers (3)

Answers (3)

manubhutani
Active Contributor
0 Kudos

hI

ya thanks 4 d reply..

i have done that

but the textview is not being displayed..

please help me out

Former Member
0 Kudos

Hi Gaurav,

There could be several reasons for the TextView not being displayed.

Firstly, check whether there is some 'text' in the attribute to which you have bound the UI Element. You need to create some elements under your node to have the attributes populated with values (Try using a supply function or simply add values in wddoinit).

Secondly, check whether your view is embedded inside the window of your application and is set as the default view.

Thirdly, make sure that the TextView's 'visible' property is not set to false.

Hope this helps.

Regards,

Neha

manubhutani
Active Contributor
0 Kudos

Hi

I have taken an input field,

It is being displayed,but when i fill some value in this inputfield.

and click the button for further processing

i am getting an error saying lower level node view1.text1 does not exist

text1 is the name of the input field and view1 is the name of the view

I have done the binding.ie layout with context

and visible property of inputfield is visible

Can u please tell me the reason for this eror???

Former Member
0 Kudos

Hello Gaurav,

You should not specify the name of your UI Elements while processing. You need to specify the name of the node and attributes.

Regards,

Neha

Former Member
0 Kudos

Hi Gaurav,

The UI elements need to be bound to the context nodes. Your context will hold the data, and when you bind a UI element to a context attribute, the value in the attribute will be displayed automatically in the UI element.

Since text1 is your UI element name and not the node name you are getting this error. What is the attribute name that holds the value to be displayed in the text view? that should be bound. Use the button to the right of the text property.

Regards

Nithya

Former Member
0 Kudos

hi gaurauv.......

the attribute' text1' might be inside a node.... eg: 'node1'. in that case you should give it as 'node1.text1'. do not mention your view nome. just give it as it is. it will take into account your view name by default. also make sure that you give your attribute name and not your input field name.

---regards,

alex b justin

manubhutani
Active Contributor
0 Kudos

Hi

i have not taken this name view1.text

after binding

it is displayed in the value row of its properties

manubhutani
Active Contributor
0 Kudos

this is the code

method ONACTIONSEARCH .

data: inputt type ref to if_wd_context_node,

table type ref to if_wd_context_node.

data: CARR type STRING.

data: begin of str,

connid type S_CONN_ID,

fldate type S_DATE,

price type S_PRICE,

currency type S_CURRCODE,

end of str.

data: int_tab type standard table of str.

inputt = wd_context->get_child_node('TEXT1').

inputt->get_attribute( exporting Name = 'TEXT1'

importing Value = CARR ).

select connid fldate price currency from sflight into table int_tab where carrid = CARR.

table = wd_context->get_child_node('SFLIGHT').

table->bind_elements( int_tab ).

endmethod.

now can u please tell me what name i shud give instead of text1 which is the name of inputfield?

Former Member
0 Kudos

What is the name of your context node? In your view, in the context tab, is there a node that corresponds to SFLIGHT structure? If you dont have it already, right click on your context, create node, give dictionary structure as SFLIGHT. Then click on 'Add attributes' and select whatever attributes you want.

Now, in your UI element, click on the button next to the text property of the textview. An input help will show up containing your node name. Double click on the CARRID attribute, I assume thats what you are trying to bind.

Regards

Nithya

Former Member
0 Kudos

hi gaurauv.........

just give the name of the attribute to which you have bound your input field 'TEXT1'. it will work fine.

---regards,

alex b justin

Former Member
0 Kudos

Data binding and context binding are one and the same. Your context holds the data, and the context nodes are "bound" to UI elements. So doesnt matter what you call it.

For a textview, you cannot right click and create a binding. Instead, in the properties tab you can create a binding. Click on the button next to the 'Text' property and using the input help select the appropriate context attribute to which you need to bind the text view.

Regards

Nithya

Former Member
0 Kudos

hi,

when you want to bind a value to a textview,

go to the attribute text of the element, on the right side there is a button (without text)

click on it and you will see the context of your view, select in there an attribute

and the text in that attribute will be shown on screen

grtz,

Koen