on 07-09-2007 11:03 AM
Hi All,
I have created dynamic button and setting a text by context attribute(means bind text as context attribute)....But it is not worked...
Here is the code..
String button = wdContext.currentContextElement().getPrintPreviewText();
IWDButton btn_pr =
(IWDButton) view.createElement(IWDButton.class, null);
btn_pr.setEnabled(true);
btn_pr.setText(button);
btn_pr.setOnAction(wdThis.wdGetPrintPreviewAction());
cont.addChild(btn_pr);
Please Tel me....
Thanks & regards
Mathi s
Thanks For all i solved myself...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
IWDAttributeInfo param= wdContext.getNodeInfo.getAttribute ("<context attr name in the root context>");
IWDButton but = (IWDButton)view.createElement(IWDButton.class,"kalyan");
but.bindText( param);
Regards
Kalyan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mati
1.Create a button in wdModify method using view param
2.take the attributeInfo of the context attr that you want to bind with the text property of the button
3.With the help of the button ref see the methods like bindingOfText like that
and pass the IWDAttributeInfo ref of the context attr as aparameter to that method.
4.Make the button enable and add to the Transparent container.
Regards
Kalyan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Please see the sample code for your question
public static void wdDoModifyView(IPrivateDynamicProgrammingView wdThis, IPrivateDynamicProgrammingView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
{
//@@begin wdDoModifyView
if(firstTime){
IWDTransparentContainer con=(IWDTransparentContainer)view.getElement("RootUIElementContainer");
IWDButton but11=(IWDButton)view.createElement(IWDButton.class,"but11");
IWDAction act=wdThis.wdCreateAction(IPrivateDynamicProgrammingView.WDActionEventHandler.CLICK,"");
but11.setOnAction(act);
but11.setText("Click");
con.addChild(but11);
}
//@@end
}
Hope this helps,
Regards,
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mathi,
Is the button getting created on the view? Also check whether the string Button is getting populated properly.
Regards,
Shyam.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
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.