How to Add Multiple Search Criterias

:oops: In our one of solution we tried to give multiple search criteria after calling controller.find(), using the controller.newRecord().
It was correctly working through the Smart Client & Web Client too. But when we try to run it on the ‘Servoy Client Launcher’
after exporting our solution, we are not allowed to add the second criteria after the method controller.newRecord(). As we understood controller.newRecord() method does not work after the method calling controller.find() in the ‘Servoy Client Launcher’.
How can I resolve this?

Regards
Chamil

Hi Chamil,

First of all what version of Java/Servoy are you using?

dacrawinath:
:oops: In our one of solution we tried to give multiple search criteria after calling controller.find(), using the controller.newRecord().
It was correctly working through the Smart Client & Web Client too.

You mean when launched via the Developer ?

dacrawinath:
But when we try to run it on the ‘Servoy Client Launcher’

The Servoy Client Launcher (page) gives you the Smart Client.

dacrawinath:
after exporting our solution, we are not allowed to add the second criteria after the method controller.newRecord(). As we understood controller.newRecord() method does not work after the method calling controller.find() in the ‘Servoy Client Launcher’.

When you add the following commented line of code in your ‘new search criteria’ method then the method will trigger in findmode.

// controller.search()

Hope this helps.

I have not included controller.search() in the new search criteria method. How my code works is as follows:

  1. Application displays all records
  2. User clicks find
  3. Application goes to controller.find() and shows user an empty record in list view.
  4. User can enter search criteria and clicks (+) button to add more search criteria.
  5. In that method application does controller.addNewRecord().
  6. User can see another empty record in list view. User can enter more search criteria into this record.
  7. User clicks Search.
  8. Application goes to controller.search().

This works in both web client and developer smart client. But when we run the application through server smart client, this doesn’t work.

dacrawinath:
I have not included controller.search() in the new search criteria method. How my code works is as follows:

  1. Application displays all records
  2. User clicks find
  3. Application goes to controller.find() and shows user an empty record in list view.
  4. User can enter search criteria and clicks (+) button to add more search criteria.
  5. In that method application does controller.addNewRecord().

Add here the following line: // controller.search()
Servoy doesn’t normally allow methods to trigger from a form in find mode (for obvious reasons) but since version 3 this can be worked around by adding controller.search() (commented out or not) in a method so Servoy will trigger it.

dacrawinath:
6. User can see another empty record in list view. User can enter more search criteria into this record.
7. User clicks Search.
8. Application goes to controller.search().

Again, what version of Servoy are you using ?

Thank you soooooo much. It’s really working.

Sorry again forgot. Version is 4.0.1 & JRE version is 1.5.
Thanks.

First trouble was OK.
I’m really sorry to tell you that again have same question with a Jasper Report too.
Report shows nicely through the ‘developer’ but not in the client launcher. Is there a special reason
for that also?

regards
Chamil

As Roclasi said earlier: Forget “launcher”, just call it client or smart client ;)

If you use Jasper Reports, you have to make sure that the jasper plugin is installed on the server.
You also need to make sure that the .jasper or .jrxml files are located in a directory that can be accessed from the server.
Finally you have to specify the path to that directory on the admin page under “server plugins”. (This last thing depends a little on your call to the plugin, perhaps you can post your script here, that would be easier for the readers :))

Those all are OK. I’ve installed the Jasper Plugging correctly and under the Servoy Admin page set the Directory.
Then placed the .jrxml file there(In the Directory). Gives the report then nicely, but not in the Client Launcher.

Make sure you don’t use "" in your directory path, use “/” instead.

Can you post the script you use to call the jasper plugin?

dacrawinath:
… but not in the Client Launcher.

Sorry but I could not resist… :D

Looks to me like there is a web at the end of the line - so it could be a web launcher as well as client launcher. One tool for both…

Hi,
This is the script I used to call the Jasper Plugging.
plugins.jasperPluginRMI.jasperReport(controller.getServerName(),‘planning_visibiliy_report.jrxml’,null,‘view’,_params);
planning_visibiliy_report.jrxml is my jrxml file which placed in the Report Directory.
_params is parameter passed to the Report.

And this is the line I used to set the Report Directory in Servoy Admin Page.
D:\servoy_workspace\planning_visibility\reports\

Regards
Chamil

Joas:
Make sure you don’t use "" in your directory path, use “/” instead.