Capt JB Posted May 13, 2013 Posted May 13, 2013 Guys, The old guy trying to learn new tricks.. I am trying to devise a little help for a friend. The problem : A layout with a map pasted on it. On this map I need to set buttons with names, and want to see related record windows popup when I click the button. The layout is in the same database the record I am looking to visualize. I tried several way, but I only get the first record in the list.. I may not be smart enough for the task..! New to FMP 12, and not really familiar with triggers capabilities...!! However I am wondering how could I do to have the button name taken into consideration by FM and popup the window the correct record. Thanks in advance
Fitch Posted May 13, 2013 Posted May 13, 2013 For some reason, buttons don't pass information about themselves when clicked, e.g. you can't pass a script parameter of "Self" and get the button's object name. What you can do is assign each button a script parameter, which could be the search criteria, which I'm guessing might be a city name. Your script could then go to the appropriate layout, enter Find mode, and Set Field[ Get(ScriptParameter) ]. Etc.
Capt JB Posted May 14, 2013 Author Posted May 14, 2013 Thanks, Interesting approach, I´ll work on it and keep you posted. On other hand, someone should convince those guys to have that capability added in the next upgrade; it would be a great advance in FMP.
bruceR Posted May 14, 2013 Posted May 14, 2013 Remember that an object in a portal knows what record it is attached to.
Capt JB Posted May 15, 2013 Author Posted May 15, 2013 Thanks, Of course, but the case is that the background is a map, and on the map are objects (buttons). In that case how can I define button through the relationship . Using fields instead of buttons..?? Another lead to follow, I like this.. As I said, someone need to convince FMP fellows to add the "self" parameter (or similar) to a button, which certainly would expand FMP capabilities. rgds
bruceR Posted May 15, 2013 Posted May 15, 2013 You put a portal on the layout and put the button inside the portal. Portals do not have to be large; and they do not have to be multi-row.
bruceR Posted May 15, 2013 Posted May 15, 2013 See attached. All the buttons are inside single row portals and all the button scripts are the same. They just pass the contents of the field as a parameter. The only difference is that each portal has a simple filter to limit its contents. For purposes of the example, the SE portal has been made transparent by setting line to none and fill to none. PortalMapButton.fmp12.zip
Capt JB Posted May 15, 2013 Author Posted May 15, 2013 Whoaa, Effectively, that is a good "turn around" of the problem, Thanks a lot guys, very much appreciated
bruceR Posted May 15, 2013 Posted May 15, 2013 UPDATE: two approaches demonstrated. On the NE/SE portals, the field contents are passed as parameters as in the first example. On the NW/SW portals, no parameter is passed. The script captures the contents of the field directly. PortalMapButton.fmp12.zip
Recommended Posts
This topic is 4602 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