• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 19. Web Publishing with FileMaker 5.5 > Switching Layouts with a Script

Switching Layouts with a Script

IWP now allows users to switch between layouts. Before, you had to use regular Web publishing methods and write your own HTML code to do this simple task. Now you can create a script that allows the user to choose a different layout with the click of a button.

To switch layouts with a script (without HTML):

1.
In the database to be hosted, choose Scripts > Scriptmaker.

2.
When the Define Scripts dialog box appears, type Go To Table for the script name and click Create.

3.
In the Script Definition dialog box, click Clear All to delete the default steps.

4.
In the step list on the left, double-click Go to Layout.

5.
In Options, choose the layout to be used for the Table View from the Specify drop-down list.

6.
In the step list on the left, scroll down to the Windows section and double-click View As .

7.
In Options, choose View as Table from the Specify drop-down list (Figure 19.23). Click OK.

Figure 19.23. For layouts that will display as tables, the View As option must be set to Table.


8.
In the Define Scripts dialog box, click once on the Go To Table script. Click Duplicate. Change the name to Go To Form. Click Rename (Figure 19.24).

Figure 19.24. Since the step order is the same for both Go To Table and Go To Form, it is easier to duplicate and rename the first script than to create it from scratch.


9.
Double-click the Go To Form script. When the Script Definition dialog box appears, click on the Go to Layout step in the script assembly section on the right.

10.
In Options, choose Form from the Specify drop-down list.

11.
Click the View As step in the script assembly section. In Options, choose View as Form from the Specify drop-down list (Figure 19.25). Click OK and then Done.

Figure 19.25. Set the View As option to match the way the layout will be displayed.


12.
Go to the Form layout. Choose View > Layout Mode.

13.
Create a new button. When the Specify Button dialog box appears, click Perform Script.

14.
n Options in the Specify drop-down list, choose Go To Table (Figure 19.26). Click OK. Label the button Table.

Figure 19.26. The Table button switches the user to the Table layout with a single click.


15.
Go to the Table layout. Choose View > Layout Mode.

16.
Create a new button. When the Specify Button dialog box appears, click Perform Script. In Options in the Specify drop-down list, choose Go To Form (Figure 19.27). Click OK. Label the button Form.

Figure 19.27. The Form button on the Table layout switches the user to the Form layout.


17.
Click OK and then Done.

Your layout in the Web browser will offer the Form option when viewed in Table View, and the Table option when viewed in Form View. In Table View, you can click on a column header to change the sort criteria, just as you would in a regular FileMaker file (Figure 19.28).

Figure 19.28. In a Table layout, the user can click on a column header to sort by that field.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint