on 01-09-2008 7:29 PM
Hello,
I am displaying a Grid (e.g for n Products), for that I have buttons for each product to navigate to productDetails view, which will show details of that particular product. As I have several products and several buttons, which I dont know till run time, I am using For Loop for this.
When it navigates to productDetails view, I cannot show product details for whatever the user selected. I tried a lot to distinguish which button the user has pressed. But I couldnt achive it. For all buttons I can only show the first product.
Is it limitation of Web Dynpro. If anybody have any ideas, please let me know. Any workaround or clues are appreciated.
Also I want to know whats the client side parameter for Button in Dynamic Programming?.
If possible, use a RowRepeater UI element or a Table. Then you can identify the row (represented by a node element) using parameter mapping. Map the implicit event parameter "nodeElement" (IWDNodeElement) to a corresponding action parameter and you will get the node element inside the action handler.
If you are creating all grid elements individually, you can add a fixed parameter, say "index" of type integer, to each button to be able to identify the "row" in the action handler.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>>If you are creating all grid elements individually, you can add a fixed parameter, say "index" of type >>integer, to each button to be able to identify the "row" in the action handler.
Armin,
I tried this method by creating a index parameter. But how do I pass the client side 'integer' value to this parameter for the button?. Atleast if I can pass buttonID, I will know which button the user is pressed.
Thanks,
Sunita.
Hi,
Create a parameter for the button action handler
Map the ID parameter of the button to this parameter
In the wdDoModify of your view you can use the followin code to acheive this
"id" will be the name of the parameter created above
if(firstTime)
{
IWDButton button = view,getElement("<Your Button>"); // Handle to your button
button.mappingOfOn<Action>().addParameter("ID", "id");
}
Regards
Ayyapparaj
If available, use the "Parameter Mapping" editor and attach fixed integer values for the "onAction" of each button.
If not, you can use code like this:
wdDoModifyView(...)
{
if (<create_grid>)
{
int n = /* number of grid cells */
for (int i = 0; i < n; ++i)
{
/* Assume buttons are named "Button0", "Button1" etc. */
IWDButton button = (IWDButton) view.getElement("Button" + i);
button.mappingOfOnAction().setInt("index", i);
/* or in earlier releases: */
button.mappingOfOnAction().addParameter("index", i);
}
}
}
Armin
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.