This topic is locked

Edit Box / Text Field with Search

12/4/2023 11:09:57 AM
PHPRunner General questions
aalekizoglou author

Trying to implement a free input lookup edit box or text field on a linked field with search functionality, PHPR provides only a list page with search for lookup fields.
My initial approach would be to have the text field, that has onchange event to populate other fields based on input, and add a search custom button that would use Runner.displayPopup() to display a custom list page with a simple_search text.
With appropriate javascript I will make the key field clickable on every row that would return back the key that was clicked.

I am missing some bits here:

  1. how would I call Runner.displayPopup() to popup a custom list page with no menu, no insert/delete buttonsvar popup = Runner.displayPopup( {
    url: "employee_list.php?page=listsearch", //Custom list page needed here
    header: 'Employee Search',
    afterCreate: function(win) {

Any thoughts here would be helpfull

Sergey Kornilov 12/4/2023

Create an additional List page of Employee table in the Page Designer and on that page you can remove buttons, menu etc. You can show this additional page in a popup to achieve what you looking for.

fhumanes 12/5/2023


I think this example that I have done fits your needs:

Also, you could use the Select2 AJAX plugin.


aalekizoglou author 12/5/2023


that is the way to go. I inserted a search button next to the 'iEmployeeID' text field

img alt

I have created an 'onchange' event on the 'iEmployeeID' text field that runs queries when the user enters the employee code directly to the field.

img alt

Then created a new list page called 'listsearch' on the employee table, where I removed buttons, menu, and other unwanted elements

img alt

On listpage event 'After record proccessed' added some code

img alt

Then on search button 'OnBefore' added the following code

img alt

The button is working fine.

I am wondering, is there a way I could create an edit pluggin utilizing this functionality with custom properties for popup form?

aalekizoglou author 12/5/2023

Fernando hi,

Thanks for the response. What I need in fact is a text box that the user enters the employee code for quick data entry. This employee code is often used in inline adding/editing.
When the code is not know the user needs search functionality that pop up a customized listbox. In the employee listbox I have sort / filters / include into all search enabled so the user can find the employee needed.
I have managed to implement the required functionality with the custom list page.


aalekizoglou author 12/13/2023

Here is the outcome... pressing the search button on the textbox pops up the list to select

img alt

Davor GeciDevClub member 12/13/2023

This would be great if it could be build into the PHPRunner as we now have Listpage, dropdown,...
Because in big systems we work with ID-s (or codes) and users need to quickly add new records without fidling with mouse all the time.
I have something similar in my old ERP that I created in Visual Basic 6, 20 years ago and it is outdated but still works and would love to move it to PHPRunner.

It is having a Textbox and a Lookup button and a view Textbox, so that when we type the ID (or code of the employee) on validate event if the record is found in lookup table in the view textbox it displays the lookup value. If the user doesn't know the ID (or code) it clicks the button (or I have also added the abbility to use the F12 button if the focus is in the TextBox for faster entry) and it opens the listpage.

Here are some screenshots, if guys from PHPRunner would consider to add something like this in future versions.

img alt

Whole Listpage:

img alt

aalekizoglou author 12/19/2023

That's exactly the functionality I am trying to re-produce. We have also build an ERP system, Win32 / Delphi / MySQL. Delphi's VCL is outstanding giving the dev team the opportunity to build whatever component they want, if it does not exist.
I've been working with PHPR for almost 14 years and I can say that PHPR's custom plugins are outstanding as well. Almost like Delphi's VCL you can build whatever "component" you like.

The lookup wizard's funcionality was very close to what I was looking after, but it lacks a combination of "edit box" and "listbox with search".
Anyway I managed to make it up, thought have not coded a pluging to that matter.