find search in formInDialog

Hi,

I’m showing a form in dialog to conduct searches.
The method is:

forms.dlg_company_search.controller.find();
application.showFormInDialog(forms.dlg_company_search);

On the dialog there are two buttons “Execute” “Add” and “Cancel”, to trigger the search, add a request (“or” search) and cancel it respectively. The problem is that when showing a form in dialog onAction events of buttons will not fire.

I guess this is expected behaviour because I’ve read about methods being disable during finds. Could someone confirm if this is so?

My aim is to do cumulative searches. This is why I would like not to use globals. Are there any work arounds or alternatives?

Txs,
Miguel

I use searches in formInDialog too, try this:

  • Open formindialog
  • in the onShow method of the search form enter Find-Mode
  • disable all form events except onSearch
  • leave the standard controller visible (custom controller forms won’t work)

Your users automatically enter find mode when the form is opened and permorm the search when F3 or ENTER is hit, if they need additional find requests they can use the menu functions or key shortcuts CTRL-N, etc. and use the standard controller to navigate trough requests.
You can then use the onHide event to cancel the search if they close the formInDialog.
I know it’s not so UI appealing but it works pretty well and for now it’s the only game in town if you want to use multiple find requests.

ngervasi:
I know it’s not so UI appealing but it works pretty well and for now it’s the only game in town if you want to use multiple find requests.

Hi Nicola,

That’s precisely what I’m trying to avoid - users having to remember stuff like Ctrl+N, F3, Enter.

As an alternative I thougth of using globals and storing requests as an Array of Arrays (each sub-array corresponding to a record). I was trying to find if there was an alternative to this convoluted approach and the time it will take. Frankly I really don’t see why methods can’t run in find mode. But will have to make my way around it.

Txs,
Miguel

power users want to use shortcut keys…
That is how i work in the things i do daily.

We are thinking of relaxing the button can’t execute a script a bit because we do need it in 3.0 for the webclient. Then we only test if “controller.search()” is called in that script and if that is th case then the script can be executed even if we are in find mode.

jcompagner:
Then we only test if “controller.search()” is called in that script and if that is th case then the script can be executed even if we are in find mode.

Sounds good to me, at least we could put a few buttons on the custom controller of the Search Form.

jcompagner:
Then we only test if “controller.search()” is called in that script and if that is th case then the script can be executed even if we are in find mode.

Status( CurrentMode ) == 1 // Find Mode

Disregarding the Syntax, the concept holds! Basically Servoy uses the concepts of Modes (Edit, Find), so “all” there is to it is testing the current mode.

Looks wonderful to me.
Gives a lot more power in find mode!

Miguel