on 01-20-2006 10:40 AM
Hello *,
does anybody have a short example for dynamic programming the layout?
I don't have any idea how to create and arrange this.
//IWDUIElementContainer.createLayout(GridLayout.class)
//IWDUIElement.createLayoutData(???)
How can I edit this, e.g. the number of cols?
How do I set a childUIElement into a special column?
Thanks in advance,
Regards Mario
Mario,
in wdDoMidifyView:
final IWDUIElementContainer c
= (IWDUIElementContainer)view.getElement("<some-id>");
final IWDGridLayout layout
= (IWDGridLayout)c.createLayout(IWDGridLayout.class);
/* 3 columns */
layout.setColCount(3)
/* rows are defined only by content */
final String[] texts
= {"A", "B", "C", "D", "E", "F", "G", "H", "I" };
final WDCellBackgroundDesign[] bckg
= {WDCellBackgroundDesign.PLAIN, WDCellBackgroundDesign.FILL2};
for (int i = 0; i < texts.length; i++)
{
final IWDTextView tv = (IWDTextView)view.createElement(IWDTextView.class, null);
tv.setText(texts[ i ]);
final IWDGridData cell
= (IWDGridData)tv.createLayoutData(IWDGridData.class);
cell.setCellBackgroundDesign(bckg[ i % 2 ]);
c.addElement( tv );
}
Valery Silaev
EPAM Systems
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mario,
Try out this code this should solve ur problem:
<b>For dynamic creation of Layouts:</b>
IWDTransparentContainer container = (IWDTransparentContainer)view.getElement("RootUIElementContainer");
IWDGroup group = (IWDGroup)view.createElement(IWDGroup.class,"NewGroup");
IWDLayout layout = (IWDLayout)group.createLayout(IWDGridLayout.class);
container.addChild(group);
<b>For inserting child inside this layout try out this:</b>
IWDTextView travel1 = (IWDTextView)view.createElement(IWDTextView.class,"Textview1");
travel1.setText(" Travel Expenditure :");
IWDLayoutData data1 = (IWDLayoutData)travel1.createLayoutData(IWDGridLayout.class);
travel1.setDesign(WDTextViewDesign.HEADER2);
group.addChild(travel1);
Hope this helps u,
Regards,
Nagarajan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.