This topic is locked
[SOLVED]

 Lookup wizard - custom version

10/5/2011 7:48:18 AM
PHPRunner General questions
M
marimach77 author

Hello,
I have a table TABLE123 with field UserLogin. User login can be:

TP1\PLUSERAAA

TP1\PLUSERBBB

TP1\PLUSERCCC
There is also second table Users with fields UserLogin, DisplayName with values:

TP1\PLUSERAAA, USER AAA

TP1\PLUSERBBB, USER BBB

TP1\PLUSERCCC, USER CCC
Both tables are linked by UserLogin field. Configuration of UserLogin field (type: Lookup Wizard) on Add/Edit page:

Table: Users

Linked field: UserLogin

Display field: DisplayName

Edit box with AJAX popup
Now, I have a few questions:

  1. AJAX popup try to search the field DisplayName with condition begins with. How to change it to condition contains- it will allow me to type any part of user name.
  2. How to change the select query for AJAX popup to have some other field displayed also in popup, something like in this example:


3. How to add on add/edit page the label which will display Userlogin near the main field which displays DisplayNamevalue - like in example below:


Thanks in advance.

Brgds

Mariusz
Update: point no 1 is fixed. I change manualy LIKE in lookupsuggest.php file.

C
cgphp 10/5/2011

To fix point no 2 set the "Display field" as Custom expression. Check this article for more info: http://xlinesoft.com/phprunner/docs/lookup_wizard.htm
To fix point no 3 use Autofill. More info here: http://xlinesoft.com/phprunner/docs/lookup_wizard.htm

M
marimach77 author 10/5/2011



To fix point no 2 set the "Display field" as Custom expression.



I did it, it works but in that case I get the DisplayName + UserLogin string in text field. My aim was to have DisplayName in the text field and DisplayName + UserLoginstring in AJAX popup search result for this text field. In this example:


DisplayName + UserLogin is Nowak Piotr (TP1\PLNOWAKP) displayed in AJAX popup. When I choose it, only DisplayName (Nowak Piotr) should be displayed in text field and UserLoginshould be displayed as a non-editable label next to the text field.

C
cgphp 10/5/2011

I think that to fix point no 2 you have to change manually the lookupsuggest.php file
Did you try Autofil to fix point no 3 ?

M
marimach77 author 10/5/2011



I think that to fix point no 2 you have to change manually the lookupsuggest.php file



Not good solution for me <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=61241&image=1&table=forumreplies' class='bbc_emoticon' alt=':angry:' />, I'm not PHP guru. But anyway, if I do any manual change in php files, it will replaced by new file in case of I do build of project again. So, each time, I have to remember, that I should modify this file after each project build. Am I right?



Did you try Autofil to fix point no 3 ?



I'm looking on it but I'm not sure if I understand the logic of the Autofill option in that case. In Autofill settings window I have two tables:

left table is my master table Desktop (target field)

right table is linked table Users (source field)
I don't see UserLogin field in table Desktop which is linked filed to table Users.