cancel
Showing results for 
Search instead for 
Did you mean: 

Limitation of Web Dynpro Dynamic programing? or any clues?

Former Member
0 Kudos

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?.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

>>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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Ayyappa,

Thank you for help. Whats ID?.

Armin,

What is index?.

Thanks,

sunita.

Former Member
0 Kudos

"index" is the name of the action parameter that shall contain the fixed value. You can use any name you want for such parameters.

Do not use addSourceMapping() as proposed by the other poster, this works only for predefined event parameters.

Armin

Answers (0)