tmas73 Posted February 8, 2007 Posted February 8, 2007 How is it possible to add a option to the search field that when its empty and you press return or enter to show all records again? Also is the plug in the same as event script plug in? If so would it be possible to use the event script instead of the other one? Thanks TMAS Spotlight Link
Lee Smith Posted February 8, 2007 Posted February 8, 2007 Are you talking about the Modify / Cancel buttons?
tmas73 Posted February 8, 2007 Author Posted February 8, 2007 No I'm talking about the search field itself, that when its idle and empty it displays all records just like the real spotlight on max. Type a search text into the field hit enter it lists the results, I delete the search text in the search field hit enter all records are visible. TMAS
comment Posted February 8, 2007 Posted February 8, 2007 I suppose all you need is to modify your script to Show All Records when the field is empty. I cannot be sure without seeing the actual calculation auto-entered into the field, and the script itself. I believe any plugin that can trigger a script on field modification can be used.
tmas73 Posted February 9, 2007 Author Posted February 9, 2007 Thanks Just to make sure there is a file on the website link of the solution. TMAS
Lee Smith Posted February 9, 2007 Posted February 9, 2007 (edited) comment has nailed the problem. I down loaded the file and the script needs to be modified. # This is where the power of the technique lies # You can parse the data and break the search into # separate Find Requests, or you can simply search # against your Search Index field # Allow User Abort [ Off ] # You need ALL of the above steps, DO NOT REMOVE THEM Enter Find Mode [ ] Set Field [ Spotlight::Search Index; Globals::Search Entry ] Set Error Capture [ [color:red]On ] Perform Find [ ] [color:red]If [ Get ( LastError ) = 401 ] [color:red]Show Custom Dialog [ Title: "No Records Found"; Message: "There were no records that met your request"; Buttons: “OK”, “Cancel” ] [color:red]Show All Records End If Notice that the original script had the Error Capture OFF (it needs to be turned ON) The If to capture the Error of no records 401 was added I added a Custom Dialong (so the users will know that there no records found to meet the request. Added the Show All Records HTH Lee Edited February 9, 2007 by Guest
comment Posted February 9, 2007 Posted February 9, 2007 Just to make sure there is a file on the website link of the solution. Ah. I have only skimmed it. A lot of what he says there sounds - how should I put this politely - well, let's just say I don't get it. For example, I don't see why you need a special table with no records for the global field. As he says: ... go figure. This is how I would do this, I think. I haven't tested this very thoroughly, and I am not much into plugins. You might want to review the documentation that comes with EventScript regarding controlling unwanted triggering, and maybe come up with something better. Spotlight_.fp7.zip
tmas73 Posted February 16, 2007 Author Posted February 16, 2007 (edited) Thats a great solution, thanks so much. I do wonder if it would possible to have more fields beeing searched. Thomas Also can capitalization be ignored? Edited February 16, 2007 by Guest Added Question
comment Posted February 16, 2007 Posted February 16, 2007 I do wonder if it would possible to have more fields beeing searched. Yes, of course. Just make your script create a new find request for each field to be searched, e.g.: If [ IsEmpty ( Table::gSearchCriteria ) ] Show All Records Else Set Error Capture [ On ] Enter Find Mode [ ] Set Field [ Table::SomeField; Table::gSearchCriteria ] [color:red]# REPEAT AS REQUIRED New Record/Request Set Field [ Table::AnotherField; Table::gSearchCriteria ] Perform Find [ ] End If Also can capitalization be ignored? I believe it is, by default - unless you have chosen Unicode as the indexing language for the field.
tmas73 Posted February 27, 2007 Author Posted February 27, 2007 Hi there I advanced the solution and spotlight search now is not working anymore because of different tables. How would you change the script to use the spotlight throughout the solution. Also your example file for searching different fields, it mentions "New Record" Is this correct? Thanks iPassword_2_v008_2.fp7.zip
comment Posted February 27, 2007 Posted February 27, 2007 Sorry, I don't understand your first question. Your file seems to work fine - but the script performs a find, i.e. it modifies the FOUND set. It looks like you are more interested in changing what's shown in the portal - that is another matter. In Find mode, New Record/Request creates a new request.
tmas73 Posted February 27, 2007 Author Posted February 27, 2007 (edited) Sorry, Spotlight works fine with the version you made (right table) but now I have different sorted tables on the left and it seems the find function in the left portals wont work anymore maybe due to the relation ships. Hope that make sense. One other problem you might know is: if you see the portal row it highlights by script.If I apply the same script in the second portal in the second tab and I hit the script button it jumps back to the first tab to select the row. Thomas Edited February 27, 2007 by Guest Add a quesstion
comment Posted February 27, 2007 Posted February 27, 2007 I made a stab in the dark, but I am not really sure how it's supposed to work - it seems too complex to me, mixing found sets and relationships. iPassword_2_v008_2.fp7.zip
Recommended Posts
This topic is 6536 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now