on 05-09-2007 7:21 AM
Hi all,
I need to get weather a tab exist by this name or not .. my scenario is
I will have a properties file with a list of field properties along with information to which tab this field belong ...?
At runtime I need to create a tabstrip...
Then i need to get 1st field's tabname, check weather a tab exist with this name or not..
if it exist create & add this field to that tab and context, else create new tab and then add.
add the tab to the tab strip. so on to all fields
finally tab strip to the rootcontainer
He ineed how to get a tab by name,
how to create a value attribute under a value node for the view context..
Thanks in advance .
Sai.k.k
Thanks Armin, for all your help.
I could solve it,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
wdDoModifyView()
{
IWDViewElement e = view.getElement("TabID");
if (e instanceof IWDTab)
{
/* There exists a tab named "TabID" */
}
}
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Armin,
I am using below code
IPrivateview1.IparentElement ele= wdContext.parentElement();
wdContext.nodeparent().addElement(ele);
IWDAttributeInfo attrinfo=wdContext.getChildNode("parent",0).getNodeInfo().addAttribute(resourceHandler.getString("FIELD"i"_FIELDNAME"),"ddic:com.sap.dictionary."resourceHandler.getString("FIELD"i+"_DATATYPE"));
I am getting an error :
com.sap.dictionary.runtime.DdException: Dictionary Type com.sap.dictionary.String does notExist
Here in addAttribute(string,string)
I used "string" & "ddic:com.sap.dictionary.string" too still getting the same error
Can you tell me what might be the error, how to resolve this.
Regards,
Sai.k.k
Hi Armin,
yes it is working, It was "String" in the properties file and hence the error.
Finally regarding the Tab,
I could create New tab, add labels and textboxs to it, but may be due to that it was in flowlayout, I could not see any of them but just a text box.
I am using gridlayout like the below, but getting an classcastexception
IWDTransparentContainer tcont = (IWDTransparentContainer)view.getElement(resourceHandler.getString("FIELD"i"_TAB"));
IWDGridLayout layout =(IWDGridLayout)tcont.createLayout(IWDGridLayout.class);
layout.setColCount(3);
Thanks,
Sai.k.k
Hi Armin,
Have a look at this code
<pre>
for(int i=1;i<=fieldscount;i++)
{
IWDAttributeInfo child = parent.addAttribute(resourceHandler.getString("FIELD"i"_FIELDNAME"),"com.sap.dictionary."resourceHandler.getString("FIELD"i+"_DATATYPE"));
IWDInputField field = (IWDInputField) view.createElement(IWDInputField.class,"Field_"+i);
field.bindValue(child);
IWDLabel label = (IWDLabel)view.createElement(IWDLabel.class,"Label_"+i);
label.setText(resourceHandler.getString("FIELD"i"_LABEL"));
label.setLabelFor("Field_"+i);
IWDViewElement Ele = view.getElement(resourceHandler.getString("FIELD"i"_TAB"));
if(Ele instanceof IWDTab)
{
IWDTab existtab = (IWDTab)view.getElement(resourceHandler.getString("FIELD"i"_TAB"));
existtab.setContent(label);
existtab.setContent(field);
}
else
{
<b>IWDTab tab1 = (IWDTab)view.createElement(IWDTab.class,resourceHandler.getString("FIELD"i"_TAB"));</b>
IWDCaption header1 = (IWDCaption) view.createElement(IWDCaption.class,resourceHandler.getString("FIELD"i"_FIELDNAME"));
header1.setText(resourceHandler.getString("FIELD"i"_TAB"));
tab1.setHeader(header1);
IWDTransparentContainer tcont = (IWDTransparentContainer)view.getElement(resourceHandler.getString("FIELD"i"_TAB"));
IWDGridLayout layout =(IWDGridLayout)tcont.createLayout(IWDGridLayout.class);
layout.setColCount(3);
tab1.setContent(label);
tab1.setContent(field);
ts.addTab(tab1);
// count++;
}
}
theActionContainer.addChild(ts);
</pre>
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.