Both in web applications accessed from desktop systems and mobile apps, it is necessary to use tab style menu for effective real-estate. TipoTapp supports multiple ways of showing information in tabs. Sections of a single object can be
shown in tabs or a completely different tipo data can be shown in a tab.
In this article lets describes how to show data from another Tipo. In order to explain that, lets consider each staff member is allocated some applications to evaluate to decide if the application is accepted or rejected.
When you go into the Staff tipo from the main menu or from the department perspective, you'd like to see the list of applications assigned to that staff member in a tap view as shown below:
Once you click on
Applications you will see the list of applicaitons assigned to
Cacherine Bose in the above example, as shown below:
TipoTapp offers a very simple solution to do this. Similar to how you model a field you just have to add a normal field with field type as desired Tipo and set the
Show In Tabunder display section for the field to
true and done.
Lets apply this for Staff tipo. Edit
Staff tipo and choose add a new field
Applicationsand choose type
Expand the field by clicking the far right arrow to access the field properties and select the
Display Settings and set the
Show in Tab to
Yes as shown below.
Wait, there is more. By doing this, we will fetch all the applications independent of who the managing staff is. You can test this by accessing the
Staff tipo from home.
So, we still have to restrict data by supplying relationship filter as below:
When fetching applications from server to show in the context of a particular staff, this filter will be supplied. $tipo_root.tipo_id will be replaced by the staff ID in that particular user context. For example, if the user is looking staff member 'Catherine' with tipo_id 1234567890, then the query sent to fetch all applications from the
Application tipo where managing_staff:1234567890
It is tricky to form this filter, the best way to do this is to start with fields of tipo being queried, then values from the form you are in. So, in this case, we are fetching applications, so start your expression with the
Application tipo fields first and then values from the current student form.
Now let’s save the
Staff Tipo and access the
Applications tab for a few staff members and see if the Applications are narrowed down to the staff member.
Looks like we did it! Building complex functionality with TipoTapp is that easy.