cancel
Showing results for 
Search instead for 
Did you mean: 

ItemlistBox - Property "TEXT" is not type-compatible with context element

ashish_shah
Contributor
0 Kudos

Hi Team,

I have created an Itemlistbox.

Bound its Datasource property to a Context node with cardinality 0:n.

Populated the context node's attribute with supply function.

Now when i try to bind Text property of Itemlistbox with any of the context attribute i get this error:

Property "TEXT" is not type-compatible with context element

I tried these attribute types : String , CHAR100 , numc5.

But none of these work.

Can anyone suggest which type of attribute can i bind to this Text property of Itemlistbox?

P.S. my server basis version is : SAP_BASIS 700 0021 SAPKB70021 SAP Basis Component

Regards,

Ashish Shah

Accepted Solutions (1)

Accepted Solutions (1)

gill367
Active Contributor
0 Kudos

This UI element has some problem.

If the data type is string at the sttribute level itself only then it will allow text property to bind to that attribute.

otherwise if you are using data element or table-field in the data type of the attribute.

it doesnot allow.

what you can do is either define the attribute type string at the context itself.

or use dynamic binding by writing the code in wddomodify.

for example if you want to bind text property to attribute A of node TAB then write the code as follows.



data itm type ref to cl_wd_item_list_box.
itm ?= view->get_element( 'ITM' ).                 " ITM is the id of the itemlistbox UI
itm->bind_text( 'TAB.A').

thanks

sarbjeet singh

ashish_shah
Contributor
0 Kudos

Hi Sarabjeet,

Thanks for your suggestion.

You are right , this UI element has many problems.

I used WDDOMODIFY code to get it working.

however i was not able to bind an attribute of Type String to Text property at design time.

So i guess for any type other than WDY_MD_TRANSLATABLE_TEXT , we have to bind using WDDOMODIFY.

Hi Baskaran,

Thanks to you too.

Your suggestion is also valid we can define an attribute of the type WDY_MD_TRANSLATABLE_TEXT and bind at design time.

Regards,

Ashish Shah

Former Member
0 Kudos

Thanks sarbjeet singh, this thread has been usefull.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

The text property should be binded to the attribute of type WDY_MD_TRANSLATABLE_TEXT

See the [http://help.sap.com/saphelp_nw70ehp1/helpdata/en/23/928b411fb4b05fe10000000a1550b0/content.htm|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/23/928b411fb4b05fe10000000a1550b0/content.htm]

See example in WDR_TEST_UI_ELEMENTS application.