on 05-26-2009 12:27 PM
I've successfully implemented a table including a master column, which is bound to a context tree node. The table has property selectionMode: none
Next to the master column I have a couple of columns, one containing a button. This button has property onAction: ShowInfo.
In the corresponding method 'onActionShowInfo' I want to show a dialog containing information belong to the row of the pressed button. How can I obtain some kind of reference to the corresponding row of the clicked button?
Grtz,
Chris
@ Charan,
I tried all three references, none work. I've put it back to the most obvious, which is the private one, as that one is used for the master column
@ Armin,
I created a new action, including the correct parameter. No warnings so far. As soon as I set the onAction attribute to this new action, I get these warnings.
Should I not set the onAction attribute in design time?
grtz,
Chris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, I see. I thought the warning occurs only after mapping the event parameter. However, forget the warning, it is completely useless. You should use the IDE to assign the action and also the Parameter Mapping editor (if available in your version, check context menu in Outline view).
The action parameter should either be of type IWDNodeElement (and you can cast it yourself inside the action handler) or of type IPrivate<ViewController>.I<Node>Element.
Armin
Armin & Charan,
Thanks for your time and input! I have got it working now, thanks to your help.
The last problem was I had a typo (towards another button) in the view.getElement call.... whoops.
Anyway, I've got it working now, though it is a bit of a shame of the warnings (I tend to minimize warnings in order to detect useful warnings more easily)
Again, thanks! Points are on their way
Grtz,
Chris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Charan,
That is exactly what I did, but I still get the same error. I'm probably missing something trivial.
As soon as I add the parameter 'element' to the action, I get the two warnings.
I'm assuming that the type of element can somehow not be resolved. When I search for the treeNodeElement I find 3 references. One private, one from the originating custom controller and some other controller. I tried both the private one and the originating.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Charan
Thanks for your quick reply.
Unfortunately I get a warnings in developer studio and a null pointer as resulting element in runtime. The warnings are:
UIElementEventBinding onAction: Parameter element(iTestValuesNodeElement) cannot be supplied
Button ButtonShowInfo [onAction]: Action and event are not compatible
What am I missing here?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
How did you select the parameter to the onActionShowInfo action.
Check you followed the below procedure exactly.
1. Go to the actions tab in your view
2. select the onActionShowInfo
3. Go to the parameters secion and select new
4. Enter the name as "element" && Select the lookup beside type
5. Select Java native type radio button.
6. Select browse
7. Now search for ITestValuesNodeElement and select this one
Note: The name of this parameter must be "element" only. Because we have mapped the element with this name in wdModifyView() method.
Regards,
Charan
Hi,
Do the source mapping in wdDoModifyView as below to the button UI element you created in second column.
IWDButton button = (IWDButton) view.getElement("Button");
button.mappingOfOnAction().addSourceMapping("nodeElement", "element");
Note: Here "Button" is the Id of the Button UI element.
After this for example you binded "TestValuesNode" to the table (which is having master column) then for 'onActionShowInfo' action add that node element as arguement with arguement name as "element" (this is must - bcause we did the source mapping with the name "element" ) as below.
public void onActionShowInfo (com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, IPrivateTestView.ITestValuesNodeElement element )
{
//@@begin onActionViewProposalDetails(ServerEvent)
wdComponentAPI.getMessageManager().reportSuccess(element.getValue());
//@@end
}
Regards,
Charan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
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.