on 07-11-2005 11:01 AM
Hi,
I create a CheckBoxGroup in the Layout View.
In the context, I created a node Root and an attribut a.
I inserted data in the node.
I bound this context to the attribut "texts" of the CheckBoxGroup.
Now the CheckBoxGroup display the data correctly.
How do i get what I selected in this CheckBoxGroup ?
Thanks.
Sorry David , i misunderstood your Question.I guess piyush has addressed your problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi everyone,
Thanks Piyush for the answer.
Don't worry Baskaran. I sure you could have aswered my question.
About those lines added in the wdDoModifyView method.
I do not understand what are there here to ?
And how can someone guess those trics ? Even if you read the doc, you do not find what to do in order to create a listener for this CheckBoxGroup.
Thanks.
Generally, UI element event parameters are described in the Javadoc of the <uielement>.mappingOf<eventName>() method, for example see IWDCheckBox.mappingOfOnToggle().
In newer releases, we added an interface for those event parameter names to the UI element interface such that you don't have to use string literals for event parameter names anymore.
Additionally, newer NWDS versions have declarative support for event-parameter-to-action-parameter mapping (PM).
In NW04 you have to write some lines of code in method wdDoModifyView() because this is the only place where you can/should access UI element references:
- <uielement>.mappingOf<eventName>().addSourceMapping(<event parameter name>, <action parameter name>)
Maps existing event parameter to action parameter, such that event parameter value may be received in action handler.
- <uielement>.mappingOf<eventName>().addParameter(<action parameter name>, <value>)
Sets value for action parameter, may be used to identify the event source if different event sources are handled by the same action handler.
See also Chris Whealy: "Inside Web Dynpro for Java" for examples on how/why to use PM.
Armin
hi,
I am not sure if i understand your requirements right.
If you want to know the context value at runtime,you may declare that context attribute as calculated(See in properties of the context node) and decide to use getter and setter methods.By doing this you can get and set the context attribute value at runtime.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hello David,
u have to create an event and map it to the onToggle of the check box. the parameters of the event should be "boolean SelectedCheck", "int Position".
now in doModify() write this code:
IWDCheckBoxGroup checkGroup = (IWDCheckBoxGroup) view.getElement("CheckBoxGroup");
checkGroup.mappingOfOnToggle().addSourceMapping("checked","SelectedCheck");
checkGroup.mappingOfOnToggle().addSourceMapping("index","Position");
hope this will help u.
regards,
Piyush.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
...or better read the Javadoc:
/**
Web Dynpro CheckBoxGroup API.
*
CheckBoxGroup represents a multiple selection visualized
by a group of check boxes.
<p>
<strong>Data binding:</strong>
<br>
The context must provide a node <code>X</code> with <code>X.cardinality = 0..n</code>
and <code>X.selection = 0..n</code> with an attribute <code>y</code>. The type of <code>y</code> must be a simple type like <code>String</code>.
The number of check boxes is the number of node elements, their texts are the values of attribute <code>y</code>,
<b>and the selection of the check boxes is determined by the (multiple) selection of the node.</b>
<p>
The property <code>texts</code> must be bound to the attribute <code>y</code>.
*/
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.