Filemaker 中的动态布局

发布于 2024-12-11 06:55:06 字数 196 浏览 6 评论 0原文

首先,我是 FM 新手,但我对基础知识有很好的掌握。我需要做的是 - 在联系人信息类型布局中,我希望能够根据特定字段更改布局。前任。当记录被调出时,布局的背景将为客户改变颜色,为供应商改变另一个颜色,等等。

我尝试根据字段更改标签,但没有成功。我的猜测是布局是静态的,只有数据字段发生变化。

我们使用 FM Pro。

谢谢, 标记

First off I am new to FM but I have a good handle on the basics. What I need to do is this - in a contact information type layout I want to be able to alter the layout based on a specific field. Ex. When the record is brought up, the background of the layout will change colors for a client, another for vendor, etc.

I tried to change a label based on a field, with no success. My guess is that the layout is static and only the data fields change.

We use FM Pro.

Thanks,
Mark

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

深爱不及久伴 2024-12-18 06:55:06

FileMaker 布局是静态的,但您仍然可以执行一些操作来根据字段值更改布局:

计算字段

如果您希望更改区域中显示的数据,可以使用计算字段。一个典型的例子是状态字段。为此,您需要向表中添加一个新字段,并在该字段上输入计算,例如:

Case (
     IsEmpty(myTable::myField) ; "Please enter a value for myField." ;
     myTable::myField = "wrong value" ; "Please enter a correct value for myField." ;
     "Everything seems okay."
 )

条件格式

要进行诸如背景颜色更改之类的操作,您可以使用条件格式字段。我通常会添加一个空的数字字段(在本例中,我们将其称为emptyField)并对其进行设置,以便在修改期间无法对其进行编辑。

如果您将emptyField 放置在布局上所有其他字段的下方,并且不允许用户在浏览或查找模式下输入该字段,则您可以使用条件格式来更改该字段的颜色。

门户隐藏

当您希望 UI 中的某些元素在不需要时消失时,可以使用此技术。例如,如果您希望仅在字段上的所有记录都填写完毕后才显示“提交”按钮。

要使用此技术,我通常会在原始表上创建一个名为 ReadyForSubmit 的计算数字字段,并为其进行逻辑计算,例如:(

not IsEmpty(field1) and ... and not IsEmpty(fieldN)

请注意,上述函数的值将为 1 或 0)

然后我将创建一个新的支持在我的数据库中添加一个字段 One,并将计算值设置为 1。

然后,我将在 myTable::readyForSubmit 和 Support::One 之间建立关系。

在布局上,创建一个具有一行的门户。将“提交”按钮放入该布局中。现在,当readyForSubmit 计算为1 时,按钮就会出现。当计算为 0 时按钮将被隐藏。

隐藏选项卡浏览器

最后,您可以使用选项卡浏览器,将标题字体大小设置为 1 磅、隐藏边框并以编程方式控制浏览器。您可以使用它对不同类型的记录进行不同的字段安排。为此,您首先需要为选项卡浏览器的每个选项卡指定一个对象名称,例如 Tab1、Tab2、Tab3。

然后,您将添加一个脚本 goToTab,其中包含何时要转到每个选项卡的逻辑。说:

If (myTable::myField = "corn")
    Go to Object (Tab1)
Else If (myTable::myField = "squash")
    Go To Object (Tab2)
End If

然后,您将使用脚本触发器在记录加载时运行 goToTab。

FileMaker layouts are static, but there are still some things you can do to alter the layout based on the values of fields:

Calculation Fields

If you want the data shown in an area to change, you can use a Calculation field. A typical example of this would be a status field. To do this you would add a new field to your table and use enter a calculation on that field like:

Case (
     IsEmpty(myTable::myField) ; "Please enter a value for myField." ;
     myTable::myField = "wrong value" ; "Please enter a correct value for myField." ;
     "Everything seems okay."
 )

Conditional Formatting

To make things like background color change you can use a conditionally formatted field. I will typically add an empty numeric field (for this example we'll call it emptyField) and set it so that it can't be edited during modification.

If you place emptyField on your layout, below all the other fields and disallow the user to enter the field in either Browse or Find mode, you can then use conditional formatting to change the field's color.

Portal Hiding

You can use this technique when you want some elements of your UI to disappear when they aren't needed. For example, if you want a "submit" button to appear only when all of the records on a field are filled out.

To use this technique I will usually create a Calculated number field, called ReadyForSubmit, on the original table and give it a logical calculation like:

not IsEmpty(field1) and ... and not IsEmpty(fieldN)

(Note that the value of the above function would be 1 or 0)

I will then create a new Support table in my database and add to it a field One with a calculated value set to 1.

I will then make a relationship between myTable::readyForSubmit and Support::One.

On the layout, create a portal with one row. Put your Submit button in that layout. Now, when readyForSubmit calculates to 1 the button will appear. When it calculates to 0 the button will be hidden.

Hidden Tab Browser

Finally, you can use a tab browser where you set the title font size to 1 point, hide the border, and control the browser programmatically. You can use this for having different field arrangements for different types of records. To do this you would first give an Object name to each tab of the tab browser, say Tab1, Tab2, Tab3.

Then you would add a script, goToTab, with the logic for when you want to go to each tab. Say:

If (myTable::myField = "corn")
    Go to Object (Tab1)
Else If (myTable::myField = "squash")
    Go To Object (Tab2)
End If

You would then use Script Triggers to run goToTab when On Record Load.

别闹i 2024-12-18 06:55:06

随着 filemaker 13 的发布,可能会有另一种方法来做到这一点。您可以使用滑动控件,在控件中命名面板,然后根据记录类型有条件地切换到正确的面板。

您可以在每个面板中删除记录类型的适当字段。

http://help.filemaker.com/app/answers/detail/a_id/12012/~/using-slide-controls-and-slide-panels-in-filemaker-pro

With the release of filemaker 13 there may be another way to do this. You could use a slide control, name the panels in the control, and conditionally switch to the correct panel based on the record type.

you would drop the appropriate fields for the record type in each panel.

http://help.filemaker.com/app/answers/detail/a_id/12012/~/using-slide-controls-and-slide-panels-in-filemaker-pro

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文