Hi All
I have designed a form where you can add additional subforms by the click of a button. What I want is for an object's presence on the initial subform to remain invisible all the time but all subsequent repeating subforms the object's presence to be visible. Is this possible?
Thanks
Darren
Views
Replies
Total Likes
I do not see why you cannot do this ....but I have to ask why? Why woudl you want to have an invisible first row? Why not start with 0 instances and then add them accordingly?
Paul
Views
Replies
Total Likes
Hi Paul
It is not a row I want to be invisible it is a button which will delete additional subforms if one is added, hence why I don want to show on the 1st one.
Views
Replies
Total Likes
Ok then that is much easier ......you can have the button invisible to start and when the user clicks the addInstance button you can check the count of sublforms with this command:
Repeating subform Name.instanceManager.count
If the count is greater than 1 then display the button if it is 1 then there is only one instance and you should make the button invisible again.
Paul
Views
Replies
Total Likes
Hi Paul
I already did this but the problem was that it also displayed it in the
original subform. I would like the object presence to only display in
repeating instances and not the original subform.
Now I am thinking about it a bit more I think it would be sensible for me to
put the delete button outside of this repeating subform but then how would I
get it to display when there is a repeating instance of a subform and
disappear when there is only the original. Is there an event that would do
this?
Thanks
Darren
Views
Replies
Total Likes
I woudl leave it in the repeating subform and on the initialize event of the button you could put code like this:
if (this.parent.index != 0){
this.presence = "visible"
} else {
this.presence = "invisible"
}
Paul
Views
Replies
Total Likes
This brilliant Paul, worked a treat.
Had been banging my head about that one.
Best wishes
Darren
Views
Replies
Total Likes