on 07-14-2008 7:47 AM
Hi all,
i hv created an appl where all the attributes hv been created dynamically..
wdContext.getNodeInfo().addAttribute("From","ddic:com.sap.dictionary.string");
wdContext.getNodeInfo().addAttribute("To","ddic:com.sap.dictionary.string");
wdContext.getNodeInfo().addAttribute("Subject","ddic:com.sap.dictionary.string");
wdContext.getNodeInfo().addAttribute("Message","ddic:com.sap.dictionary.string");
bt nw i am nt able to retrieve those.
For ex: if i hv to set the from field to null ,hw to do so?
( As we used to get it:
wdcontext.currentContextElement().setFrom(" ");
)
Plz help.
Thanks and Regards,
Ankita
Edited by: Ankita Padhi on Jul 14, 2008 8:48 AM
hi
Sample code for dynamic generation code
IWDInputField inputfield = (IWDInputField)view.
createElement(IWDInputField.class,"InputField1");
IWDAttributeInfo test =wdContext.getNodeInfo().
addAttribute("AttributeA","ddic:com.sap.dictionary.string");
wdContext.currentContextElement().setAttributeValue("AttributeA", "Hello World!!!");// set the value of attribute
inputfield.bindValue(test);//bind the newly created attribute to inputfield
try like this and let me know
thanks,
Tulasi.Palnati
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you have to set value as
wdContext.currentContextElement().setAttributeValue("From", ""); you can set blank like this.
not like wdContext.currentContextElement().setFrom(" "); it wont be like this.
you are doing it in button Action? it is also dynamic? if yes, you have to create Action in design time that is manually you can not create it dynamically and do following code in runtime
// Creating a button
IWDButton objButton = (IWDButton)view.createElement(IWDButton.class, u201CbutSubmit");
// Setting tooltip and text to the button
objButton.setTooltip(op.getTooltip());
objButton.setText(op.getDisplayText());
// Create an action and assign the same to the button.
IWDAction theAction = wdThis.wdCreateAction(IPrivateDynamicView.WDActionEventHandler
.GENERIC_ACTION,""); // here GENERIC_ACTION is the action created manually
objButton.setOnAction(theAction);
am I right?\
\
regards,
Pradeep
Hi,
Here is the right flow...
//Creating an attribute
wdContext.getNodeInfo().
addAttribute("nameValue","ddic:com.sap.dictionary.string");
//Creating Input Field or any other UI element
IWDInputField ifName =
(IWDInputField)view.createElement(IWDInputField.class,"ifName");
//Binding the attribute with InputField
ifName.bindValue("nameValue");
regards,
Pradeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
here i m giving code for your reference of a dynamic checkbox:
IWDCheckBox checkBox =
(IWDCheckBox) view.createElement(IWDCheckBox.class,
"checkBox" + count);
IWDMatrixHeadData checkHeadData =
(IWDMatrixHeadData) checkBox.createLayoutData(
IWDMatrixHeadData.class);
IWDAttributeInfo attrInfo;
info= wdContext.nodeCheckBox().getNodeInfo().addAttribute(
"Check" + count, "ddic:com.sap.dictionary.boolean");
checkHeadData.setVAlign(WDCellVAlign.TOP);
checkHeadData.setWidth("6%");
checkHeadData.setColSpan(1);
this line used to bind the context to the element:-
checkBox.bindChecked(info);
checkBox.setEnabled(true);
TitleRow.addChild(checkBox);
Hope this may help you.
Regards,
Deepak
Edited by: Deepak Arora on Jul 14, 2008 9:09 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.