on 08-01-2007 4:01 AM
I have an application in which I'm retrieving data using a BAPI and displaying it in a table. I'm using two of the returned fields to display a stacked bar chart using a BusinessGraphics UI element. When the table loads initially the graph displays the values in the first row correctly. However, when I select other rows in the table the graph doesn't update.
I would really appreciate it if anyone can tell me how to get the graph to update when the row selection changes.
Thanks in advance,
Ross
Hi Ross,
Go to the Table property and crate a onLeadSelect Event Action(say populateGraph).
public void onActionpopulateGraph(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
int n = wdContext.nodeTable().size();
int leadSelected = wdContext. nodeTable().getLeadSelection();
for (int i = 0; i < n; i++) {
if (leadSelected == i) {
<b> Write the logic here to show the graph.</b>
}
}
}
Regards,
Mithu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, I've tried similar to that. I created a value node (graph) with two value attributes that represent the values for the graph (series1 and series2). I added two series to the BusinessGraphics element and bound them to the two attributes.
I then created an action and assigned to the onLeadSelect of the table. In the method I added this code:
wdContext.currentGraphElement()
.setSeries1(wdContext.currentModelElement().getSeatsAv()); wdContext.currentGraphElement()
.setSeries2(wdContext.currentModelElement().getSeatsOc());
SeatsAv and SeatsOc are bound to columns in the table.
I've used the message manager to print series1 and series2 so I know they are set to the correct values. However, the graph shows nothing.
If I bind the two series in the BusinessGraphics element to SeatsAv and SeatsOc then the graph shows the first row in the table when the table is filled but does not change when I change the lead selection. I'm baffled. Is there a way to force the graph to refresh itself.
Ross
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
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.