prissypan Posted February 27, 2004 Share Posted February 27, 2004 Hi people... Does FM provide this function whereby i can hide a button, then after the button has been clicked, the page will refresh then show another button which is initially being hidden? Looking forward to your replies! Regards, Pris Link to comment Share on other sites More sharing options...
EddyB Posted February 27, 2004 Share Posted February 27, 2004 Hi Pris, This effect can be created using a portal with a relationship. I have attached an example, the file itself is very basic, but it shows you the functionality of it. If you've got any questions about it just ask, but it's pretty self explanatory. Hope this helps Ed buttons.zip Link to comment Share on other sites More sharing options...
Ted S Posted February 27, 2004 Share Posted February 27, 2004 You could also do it with a second layout that was nearly identical to the first. The only differences between the layouts would be up to you. Link to comment Share on other sites More sharing options...
John Caballero Posted February 27, 2004 Share Posted February 27, 2004 Yeah, but having multiple layouts that mirror each other creates a lot of extra work in the long run - if you make a change to one layout you have to make sure you reflect that change in its mirror. Eddy's suggestion requires only one layout and is a pretty common and accepted practice for maing things either show or hide on a layout based on some change in a value. Link to comment Share on other sites More sharing options...
EddyB Posted February 27, 2004 Share Posted February 27, 2004 Yes John is right. Before I was shown this trick I used multiple layouts just to show/hide buttons. When the time came to do some serious upgrade work on the DB is was an absolute nightmare trying to keep all the layouts the same - if I changed 1 I had to change about 4! This method is a lot cleaner and a better effect than switching to another layout. Ed Link to comment Share on other sites More sharing options...
Jarvis Posted February 27, 2004 Share Posted February 27, 2004 Ed, I understand how the IFstatement in the SET GLOBAL script changes the value from 1 to 0 and vice versa but I cannot figure out what you did to make button 2 magically appear. It sure does look handy. Would you mind a lending a little explication here for us un-erudites? Jarvis Link to comment Share on other sites More sharing options...
EddyB Posted February 27, 2004 Share Posted February 27, 2004 Hi Jarvis, Sorry I should have been a bit clearer in the original post. OK Button2 is inside a poral, if you click just around the egde of Button 2, you will find the portal. This portal is based on a relationship. The relationship is between the global field and the constant field. When the global field and the constant field match, the portal will show it's contents (the button). When the fields do not match the portal is hidden (you no longer see the button) Just a quick note, I messed up a little in the demo file. Button 2 is set so that the pointer changes to a finger when you go over the button. You might want to stop this from happening (format -> button). This is because, even when the button is hidden, your mouse pointer will still change to a finger pointer when you go over the place where the button appears even when it is not showing. I hope this is a bit clearer for you. Anymore questions, just give us a shout. Once you get used to using this method, it can be very useful. Best regards Ed. PS, if you have a look for a date calculations example I posted in the samples forum, you will see an adaptation of this method, when a field contents is empty, nothing will show, but then when you enter some data into the field, other fields magically appear - this also can be useful in some databases. Link to comment Share on other sites More sharing options...
Jarvis Posted February 27, 2004 Share Posted February 27, 2004 Ed, Thanks for the update. I can learn about one thing a day and this looks like one worth staring at. Jarvis Link to comment Share on other sites More sharing options...
prissypan Posted March 1, 2004 Author Share Posted March 1, 2004 Wow.. Impressive.. Thank you guys. Link to comment Share on other sites More sharing options...
Batfastad Posted May 13, 2004 Share Posted May 13, 2004 ******* that's cool!! You can use that to show/hide any layout objects!!! Really easy to implement also - well done!!! Thanks Link to comment Share on other sites More sharing options...
Philland Posted May 13, 2004 Share Posted May 13, 2004 Question; What is the value in using a portal over using a container field? Just Curious. Phil Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 7281 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