cancel
Showing results for 
Search instead for 
Did you mean: 

How to work on click event (not action) while selecting through mouse

Former Member
0 Kudos

Hi,

I have a dropdown which contains integer from 1-10 (default value 1).The moment I select some different value in the dropdown say 5,the effect should be reflected in the same page instantly.The effect should be reflected on selection(not by any action).

For Example:-

Against the dropdown value(say 1),the first column name of my table is there.

similarly,the moment I select 5 from the dropdown,instanly the effect should get reflected and the 5th column name of the table should be reflected against the dropdown section 5.

Please suggest how to do this.

Regards

-Sandip

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I don't understand exactly what you mean. If you mean to get an event when some entry in the drop-down list is selected without closing the drop-down list, then this is not supported. You can only assign an action to the onSelect-event of the drop-down list which is triggered as soon as an item is selected and the drop-down list is closed.

Armin

Answers (3)

Answers (3)

Former Member
0 Kudos

thank you Manoj Kumar for giving correct answer.

Marks given to u.

Regards

-Sandip

Former Member
0 Kudos

Hi Armin,

My problem is:-

I have created the dropdown UI Elements(48 dropdown) dynamically and they are inside the for loop.

IWDAction Actn=wdThis.wdCreateAction(IPrivateDynamicProgrammingView.WDActionEventHandler.CLICK,"");

-


IWDDropDownByKey theDropDown =null;

for(int j=1;j<48j++){

theDropDown = (IWDDropDownByKey) view.createElementIWDDropDownByKey.class, null);

IWDMatrixHeadData tableData = (IWDMatrixHeadData) theDropDown.createLayoutData(IWDMatrixHeadData.class);

nodeInfirmation.addAttribute("posAttribute","com.zurich.fscd.simpletype.column_Position");

theDropDown.bindSelectedKey"calculation_col."+"posAttribute");

theTabContainer1.addChild(theDropDown);

-


Now I have only one theDropDown object inside the loop.But I want to assign 48 different actions(setOnSelect) for these dropdowns.

How I should pass the parameter in the

theDropDown.setOnSelect(Actn) so that in each loop this action will work for each different dropdown.

I tried putting theDropDown.setOnSelect(Actn) inside the loop,but its throughing exception.

Please send me some sample code.

Your help will be highly appriciated.

Regards

-Sandip

Former Member
0 Kudos

You are sure that you really want to put 48 (in fact your code creates only 47) drop-down lists onto a single view?

But anyway: You can just create one single common action "ItemSelected" at design-time. Add a parameter "listIndex" of type integer to this action.

In your code, do this:


wdDoModifyView(...)
{
  for (int j = 0; j < 48; ++j)
  {
    ...
    theDropDown.setOnSelect(wdThis.wdGetItemSelectedAction());
    theDropDown.mappingOfOnSelect().addParameter("listIndex", j);
  }
}

Then, you can determine in the action handler which drop-down list was selected by just using the "listIndex" parameter.

But the question remains: Why do you need 48 drop-down lists and/or why don't you use a table with 48 rows?

Armin

Former Member
0 Kudos

Hi Armmin,

Thank you for the reply.

I mean Exacly the same,

I want to assign an action to the onSelect-event of the drop-down list which should triggered as soon as an item is selected and the drop-down list is closed.

The drop-down UI element and the the table are Dynamic in my application.

Please suggest hot to proceed.

Regards

-Sandip

Former Member
0 Kudos

Hi,

Then whats the problem. You already have action for dropdowns as onSelect. Create an action for this and inside this method do whatever you want to do.

thanks & regards,

Manoj

Former Member
0 Kudos

What's the problem still? Create an action "ItemSelected" and assign it to the "onSelect" event after the code that creates the drop-down list:


wdDoModifyView(...)
{
  IWDDropDownByIndex ddList = (IWDDropDownByIndex) view.createElement(IWDDropDownByIndex.class, null);
  ddList.setOnSelect(wdThis.wdGetItemSelectedAction());
  ...
}

Armin