Imagine I have a Parent BO and it OWNS Many Child BO.
On the Parent form I have a Child Grid.
I have a Panel Operation for Add New Child Reference on the bottom Panel of the Child Reference Grid.
In the Parent I have an Attribute... ChildLimit.... Assume it is set to 2
Hence, the user can add 2 Child records but as soon as 2 records have been added, I want the Add New Child Reference button to disappear.
I have Child count in the parent and use a visibility condition on the button but cannot get it to disappear dynamically. Only tests the button visibility when the form is opened.
Any ideas?
Limit References Added to Reference Grid
-
- Posts: 2405
- Joined: Mon Jul 02, 2012 12:24 am
- Location: Ulaanbaatar, Mongolia
Limit References Added to Reference Grid
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Re: Limit References Added to Reference Grid
Not sure how the Aware visibility conditions work but I imagine it´s only CSS based which means you can use JS to manipulate it yourself and when you manipulate the DOM and CSS it is dynamic i.e it happens when you do the change with no form refresh etc. required. Adding and removing CSS classes via jQuery is one way and something I have used in Aware apps before:eagles9999 wrote:Imagine I have a Parent BO and it OWNS Many Child BO.
On the Parent form I have a Child Grid.
I have a Panel Operation for Add New Child Reference on the bottom Panel of the Child Reference Grid.
In the Parent I have an Attribute... ChildLimit.... Assume it is set to 2
Hence, the user can add 2 Child records but as soon as 2 records have been added, I want the Add New Child Reference button to disappear.
I have Child count in the parent and use a visibility condition on the button but cannot get it to disappear dynamically. Only tests the button visibility when the form is opened.
Any ideas?
https://api.jquery.com/addClass/
https://api.jquery.com/removeClass/
Henrik (V8 Developer Ed. - Windows)
Re: Limit References Added to Reference Grid
Hi Mark,
Try this..
- Create a new attribute in Parent call MaxChildRow [Number].
- Update this attribute value when a new child row added.
- Put condition on the Add New Child Button If MaxChildRow < 2
- You can create another attribute to make more dynamic CurrentTotalRows..
Let me know if this help
Try this..
- Create a new attribute in Parent call MaxChildRow [Number].
- Update this attribute value when a new child row added.
- Put condition on the Add New Child Button If MaxChildRow < 2
- You can create another attribute to make more dynamic CurrentTotalRows..
Let me know if this help
From,
Himanshu Jain
AwareIM Consultant (since version 4.0)
OS: Windows 10.0, Mac
DB: MYSQL, MSSQL
Himanshu Jain
AwareIM Consultant (since version 4.0)
OS: Windows 10.0, Mac
DB: MYSQL, MSSQL
Re: Limit References Added to Reference Grid
I have a VP with a form of RegularUser named "Filter Students". The form auto-refreshes on changes to RegularUser as well as some processes also.
This is part of the filter: "Clear Filters" is an HTML cell on the "Filter Students" form:
<div style="background: #ffff00;"><a href="#" onclick="AwareApp.startProcess ('Totals__Filters_Clear','main')" title="Click to set filters to: All" ><<LoggedInRegularUser.Selected_Filter>></a></div>
These two rules work together to make the "Clear filters" link appear and disappear:
If RegularUser.Selected_Grade<>'All' OR RegularUser.Selected_School IS DEFINED OR RegularUser.Selected_FeederYN<>'All' OR RegularUser.Selected_PSD_Intent<>'All' OR RegularUser.Selected_TestedYN<>'All' OR RegularUser.Selected_Admitted<>'All' OR RegularUser.Selected_ShadowYN<>'All' OR RegularUser.Selected_HA_InvYN<>'All' OR RegularUser.Selected_ClevelandYN<>'All' OR RegularUser.Selected_T_500_Reenroll_Status<>'All' OR RegularUser.Selected_AppliedYN<>'All' Then
RegularUser.Selected_Filter='Clear Filters'
Else
RegularUser.Selected_Filter=UNDEFINED
If RegularUser.Selected_Filter<>'Clear Filters' Then
READ PROTECT RegularUser.Selected_Filter FROM ALL
This is part of the filter: "Clear Filters" is an HTML cell on the "Filter Students" form:
<div style="background: #ffff00;"><a href="#" onclick="AwareApp.startProcess ('Totals__Filters_Clear','main')" title="Click to set filters to: All" ><<LoggedInRegularUser.Selected_Filter>></a></div>
These two rules work together to make the "Clear filters" link appear and disappear:
If RegularUser.Selected_Grade<>'All' OR RegularUser.Selected_School IS DEFINED OR RegularUser.Selected_FeederYN<>'All' OR RegularUser.Selected_PSD_Intent<>'All' OR RegularUser.Selected_TestedYN<>'All' OR RegularUser.Selected_Admitted<>'All' OR RegularUser.Selected_ShadowYN<>'All' OR RegularUser.Selected_HA_InvYN<>'All' OR RegularUser.Selected_ClevelandYN<>'All' OR RegularUser.Selected_T_500_Reenroll_Status<>'All' OR RegularUser.Selected_AppliedYN<>'All' Then
RegularUser.Selected_Filter='Clear Filters'
Else
RegularUser.Selected_Filter=UNDEFINED
If RegularUser.Selected_Filter<>'Clear Filters' Then
READ PROTECT RegularUser.Selected_Filter FROM ALL
Tom - V8.8 build 3137 - MySql / PostGres