I have a repeatable subform which has 5 fields. I have simple code in the intialize event of the page that the subform is in to hide the 2nd field, but it only occurs in the first instance but code does not work for instances other then the first one. If the subform repeats 4-5 times the field is only hidden in the first instance. I have simple code and even used instancemanager.count & occur but doesnt work here is simple code below
Apps.Fields.DateT.presence='hidden'; //adding this in Initalize event only hides first occurance of field DateT but all other occurances field shows up
if (Apps.Fields.instanceManger.count>=1) // Same result as previous, only hides field in first occurance
{
Apps.Fields.DateT.presence='hidden';
}
Views
Replies
Total Likes
In the initialize event of your subform 'Fields' put DateT.presence="hidden"
Kyle
Views
Replies
Total Likes
I will be using this template for multiple fields and sometimes I will need to show the DateT field and sometimes I won't so I cannot permentaly make it hidden.
Views
Replies
Total Likes
i meant ...template for multiple reports* and sometimes etc....
Views
Replies
Total Likes
How exactly do you want it to work?
Kyle
Views
Replies
Total Likes
Ok lets get a little bit more in detail:
Views
Replies
Total Likes
Hi,
to hide all instances of an object or an objects child element you can use FormCalc with a wildcard.
if (Apps._Fields.count ge 1) then
Apps.Fields[*].DateT.presence = "hidden"
endif
Hope this helps.
Views
Replies
Total Likes
Thank you radzmar for your reply and it works perfectly when using this FormCalc script but I have to add the scrpt to an existing object that already contains Javascript code so I need a javascript version to do the samething. Luckly my co-worker helped me out and the javascript code below works:
// To get Fields node length
var nodeLength = Apps.Fields.nodes.length;
// For each rows in Fields
for (var CountInt = 0; CountInt < nodeLength; CountInt++)
{ //Hide all rows of DateT
Apps.resolveNode("Fields(" + CountInt + "].DateT").presence = "hidden";
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies