cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Label

Former Member
0 Kudos

All,

I have created the Label at runtime. How can i make the label Bold at runtime?

Thanks..

BM

Accepted Solutions (1)

Accepted Solutions (1)

former_member751941
Active Contributor
0 Kudos

Hi Bharthi,

Inside "wdDoModifyView" use this code.Check the "id" for the label from properties and put it instead of <Label_ID>

IWDLabel label = (IWDLabel)view.getElement("<Label_ID>");

label.setText("Main Program Page");

label.setDesign(WDLabelDesign.EMPHASIZED);

Regards,

Mithu

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Bharati,

Using Armin's solution you can set n number of labels in your application to your desired design.

Former Member
0 Kudos

Do not use wdDoModifyView(). Just <b>bind</b> the "design" property to a context attribute of <b>DDIC type</b> "LabelDesign". In the controller, set the attribute value to WDLabelDesign.EMPHASIZED.

Armin

Former Member
0 Kudos

Hai,

//@@begin wdDoModifyView

IWDLabel label=(IWDLabel)view.createElement(IWDLabel.class,"Label1");

label.setDesign(WDLabelDesign.EMPHASIZED);

label.setText("Label name");

IWDTransparentContainer container=(IWDTransparentContainer)view.getRootElement();

container.addChild(label);

//@@end

Regards,

Naga

Former Member
0 Kudos

Hi,

if(firstTime)

{

IWDTransparentContainer tcont=(IWDTransparentContainer)view.getRootElement();

tcont.createLayout(IWDMatrixLayout.class);

IWDNodeInfo info1=wdContext.getChildNode("person",0).getNodeInfo();

for(Iterator it=info1.iterateAttributes();it.hasNext();)

{

IWDAttributeInfo attr=(IWDAttributeInfo)it.next();

IWDLabel lab=(IWDLabel)view.createElement(IWDLabel.class,attr.getName() +"Label");

lab.setText(attr.getName());

lab.createLayoutData(IWDMatrixHeadData.class);

lab.setDesign(WDLabelDesign.EMPHASIZED);

tcont.addChild(lab);

}

}

former_member182372
Active Contributor