on 04-12-2005 8:34 AM
Hi everyone,
I have a little problem to capture what the user selected.
Here is the code.
public void wdDoInit()
{
//@@begin wdDoInit()
String[] letters = new String []{"A", "B", "C", "D"};
// Create context elements for the node "X"
List nodeElements = new ArrayList();
for (int i = 0; i <letters.length; ++i)
{
IPrivateTestComponentView.IXElement xElement = wdContext.createXElement();
xElement.setY(letters<i>);
nodeElements.add(xElement);
}
// Bind node element list to the node
wdContext.nodeX().bind(nodeElements);
// Set nodes lead selection which determines the selected item
wdContext.nodeX().setLeadSelection(0);
//@@end
}
1) What must I do to know what the user selected.
2) What is the difference with DropDownByKey ?
Thanks a lot for your precious help.
Hi,
1. You can the selected value by using
wdContext.currentXElement().getY().
2.
DropDown by Index
-
A DropDownByIndex UI element provides the user with a dropdown list box. You cannot select more than one entry from the selection list. The UI element consists of a text field, a button, and a selection list. An already selected list entry is displayed in the text field. When selecting the button, a list with all possible values is displayed
DropDown By Key
-
A DropDownByKey UI element provides the user with a selection list from which the user can select no more than one entry. The UI element consists of a text field, a button, and a selection list. An already selected list entry is displayed in the text field. When selecting the button, a list with all possible values is displayed.
The dropdown list box UI elements do not differ from each other when displayed on the screen.
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Take a look on the forum this question has already been posted.
But I'm a kind person...
1/create a context attribute "text" as string, read-onlu true, calcutaled true.
2/ in <b>implementation</b>, search the function java.lang.String <b>getText</b>(IPrivateMain.IContextElement element). the name "getText" come from CalculateAttributeGetter
3/ add the following code
String attributeName = IPrivateMain.IContextElement.COLOR;
IWDAttributeInfo attributeInfo =
element.node().getNodeInfo().getAttribute(attributeName);
ISimpleType simpleType = attributeInfo.getSimpleType();
ISimpleValueSet valueset = simpleType.getSVServices().getValues();
Object key = element.getAttributeValue(attributeName);
try {
simpleType.checkValid(key);
return valueset.getText(key);
} catch (DdCheckException e) {
return "";
}
4/ create a new TextView and link it to the context "text".
5/ don't forget to define an action (name it select) and link this action to the UI dropDownByKey (Event OnSelect = select). leave the code of onActionSelect empty in the implementation.
6/ test it
7/ enjoy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
wdThis Generated private interface of the view's controller provided by Web Dynpro
wdContext Generated interface of the view's context
More Info:-
For every Web Dynpro controller class different sets of interfaces are generated by the Web Dynpro
Generation Framework. Their names start with IPrivate, IPublic .
These interfaces specify the level of information/access a controller class exposes to another user.
The private access to the generated Web Dynpro Interface of type IPrivate for a controller class is
provided by the member varibale wdThis (it provides access to its own
Example: View Controller: MainView.java -->IPrivateMainView.java
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.