Find in showFormInDialog

Hi,

Sorry if this quesion has been already posted. Cannot find a solution.

Scenario:

In my solution I do the keyword search in the same form using global on the header.

But when the user clicks the Advanced find, a new window should be opened in the find mode and pause for the user input. But my main form should still remain in the browse mode itself

The user will enter the criteria and he will click a button called “Perform Search”. This has to complete the find and the form closes. The found recods in the form (which I used for find) should now be displayed on my main form

I’m struggling to find a way for this…

Qn:

  1. How to enter the find mode in the new window without affecting my current view?

  2. How to pause in find mode so that user enters his search criteria

  3. How to resume the search?

  4. How to display the foundset in the find form to my main form

Awaiting for your kind help on this

Thanks
Ahmad
Hong Kong

try something like:

forms['mymainform'].controller.find()
forms['mymainform'].columna = global.columna
forms['mymainform'].columnb = global.columnb
forms['mymainform'].controller.search()

and in the dialogform fill the globals

  1. How to enter the find mode in the new window without affecting my current view?

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

If you use the same table for the search and main form. Then the searchform must use a seperate foundset (see the form property in the designer)

  1. How to pause in find mode so that user enters his search criteria

You don’t need to pause in find mode. You are in find mode until the user does F3/Enter or presses a button where you do a search.

  1. How to resume the search?

What do you exactly mean with resuming a search?
That an user can add search criteria’s?

  1. How to display the foundset in the find form to my main form

set the foundset of the searchform in the main form

Ahmad,

I have been struggling with this also.
You might be wondering why a find instruction after the showForminDialog will not work.
This is because all the instructions after the showFormInDialog will not be executed unless the Dialog is closed.
Have a look at:
http://forum.servoy.com/viewtopic.php?t=2114

If you want want to do a controller.find after the Dialog has been opened, from your main_form, you have to trigger the find method onShow (in your find_form).
But I should do it Johan’s way.

HTH

Ron

Ron:
Have a look at:
http://forum.servoy.com/viewtopic.php?t=2114

Thanks Ron,

The link gives me good understanding about the formInDialog. I too will follow Johan’s way. I will try working on this and get back to you if I have any problems.

Cheers

This is because all the instructions after the showFormInDialog will not be executed unless the Dialog is closed.

Hmm, I now realize that I cannot request focus to a field as soon as the Dialog pops up. :cry:
Am I right?

Ron:

This is because all the instructions after the showFormInDialog will not be executed unless the Dialog is closed.

Hmm, I now realize that I cannot request focus to a field as soon as the Dialog pops up. :cry:
Am I right?

Yes that is possible, but you have to do it on the onShow event of the popup-form!

Thanks Harjo.
I found out myself just a minute ago.

Ron