Related valuelist in Find Mode

Hi:

I have 2 combobox. The 1st combo uses a valuelist which shows all values from a table. The 2nd combo uses another valuelist. This valuelist shows related values and the relation depends on the value of the 1st valuelist. It’s ok: I select a value in the first combo and the second combo shows its related values.

But… I doesn’t work in find mode. In find mode, I select a value in the 1st combo, but nothing shows in the second combo :cry: :cry:

Any solution or suggestion?

Log-out
Bogota - Colombia

you may form a SQL query based on the value selected in the first combo and then use databaseManager.getDataSetByQuery() to get the dataset. Now you can use application.setValueListItems(“2nd combo valuelist name”, dataset);

but I hope servoy will fix the related valuelist in the find mode so that we will not have more hassles

faheemhameed:
you may form a SQL query based on the value selected…

Ok, this is another way to create a valuelist, but it doesn’t work in find mode because no method triggers in find mode :cry:

Log-Out
Bogota - Colombia

you can trigger methods in find mode…

In order that to work, the triggered method must contain the following script:

if (false) {
controller.search();
}

I don’t understand how to do this…

I have a method FillTheValueList with a databaseManager.getDataSetByQuery() and a application.setValueListItems() to fill the valuelist of the second combo. This method is triggered with the OnDataChange event of the first combo… but there is no OnDataChange in find mode, so the method is not triggered.

Thanks,

Log-Out
Bogota - Colombia

Sorry I just came to know that the only event could be triggered in find mode is onAction of a button also provided that the triggered method includes the following pseudo code.

if (false) {
controller.search();
}

I want servoy to allow all the (possible) triggers of browse mode to work in the find mode.

A weird workaround for your issue would be to have a transparent button (same size as the second combo) above the second combo and in the onAction of transparent button you can call the FillTheValueList (include the psuedo above in this method)

Thanks for the code, I’ll try it.

faheemhameed:
I want servoy to allow all the (possible) triggers of browse mode to work in the find mode.

It would be a great feature!

I wrote this “dummy” method:

if(false)
{
      controller.search();
}
plugins.dialogs.showInfoDialog( '',  'Hello World',  'ok');

and I put it in the onAction of a button… but in find mode the method is not triggered, because the info dialog doesn’t show :cry: :cry:

Log-Out
Bogota - Colombia

The same code worked for me in find mode.

I use the following version of servoy. What version you use?

Servoy Developer
Version 3.0-build 371
Java version 1.5.0_07-b03 (Windows XP)