cancel
Showing results for 
Search instead for 
Did you mean: 

changing context mapping of a label at runtime

Former Member
0 Kudos

Hi,

how can I change the context mapping of a label at runtime (by code)? I have a label and like to use it for displaying different "Model attributes" from different "Model Nodes" depending on some conditions.

Thanks a lot.

Regards,

Henning

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

In the IWDmodify view you can change the binding of any UI elements

IWDLabel lb1 = (IWDLabel) view.getElement("Label");

IWDAttributeInfo attrinfo = wdContext.getNodeInfo().getAttribute(IPrivateHelloWorldView.IContextElement.CA__SECOND);

lb1.bindText(attrinfo);

Former Member
0 Kudos

Hi Anoop,

sound like the solution I am looking for.

But how must I call the method out of my custom controller in detail?

I need to deliver some parameter values.

- IPrivateXSSPortalApplicationMainView wdThis

- IPrivateXSSPortalApplicationMainView.IContextNode wdContext

- com.sap.tc.webdynpro.progmodel.api.IWDView view

- boolean firstTime

But what must I pass to these varaiables in detail?

Thanks a lot.

regards,

Henning

Former Member
0 Kudos

ok, I just tried it again and now it works fine.

I gave you full points.

Henning

Answers (4)

Answers (4)

Former Member
0 Kudos

com.sap.tc.webdynpro.progmodel.api.IWDAttributeInfo is to be imported..

Regards

AM

Former Member
0 Kudos

com.sap.tc.webdynpro.clientserver.uielib.standrad.IWDLabel. is to be imported.

No particaular jar files to be added

you do one thing type IWD and after that press ctrl and space together...

you may get all the UI element type.

Regards

AM

Former Member
0 Kudos

> com.sap.tc.webdynpro.clientserver.uielib.standrad.IWDL

> abel. is to be imported.

strange....I do not have this.

Wich version of Development studio do you have?

I use Version: 7.0.07

Henning

Former Member
0 Kudos

ok....I just found it....but auto import organize dows not work...

Now I am looking for "IWDAttributeInfo"

I will try/search it now.

Henning

Former Member
0 Kudos

Hi,

Simply copy the code from Anoop post and past your WDModifyview() method

it showing some errors for that you can do simple ctrlshifto or right click the mouse there source->ogranizeImports might helps you.

there change your label name "Label" what u mention in the design of ur View.

thanks,

Lohi.

Message was edited by:

Lohitha M

Former Member
0 Kudos

doModify will be inviked after each and every action in the view..

Regards

AM

Former Member
0 Kudos

ok, that it is called on each action sounds good. Then there will be no need to call it from the controller.

But now I have another problem.

The type "IWDLabel" is unknown and can not be resolved. Even after trying to organize the imports.

Do I need to add a special import/external jar?

Thx.

Henning

Former Member
0 Kudos

do u mean that u have to invoke the doModify() from Custome controler.

is there any particular intension to do that...give me ur exact requirement.

Regards

AM