Joe Sharples
Posts: 0
Joined: Mon Aug 18, 2014 1:31 pm

Uncaught Error: cannot call methods on checkboxradio prior to initialization; attempted to call method 'refresh'

I'm receiving this error:

Uncaught Error: cannot call methods on checkboxradio prior to initialization; attempted to call method 'refresh'

I have a radio button with 3 buttons. description/ ticketguestlist/ posts.

on value change run JS:

var type = Apperyio('nightRadio').find('input[type="radio"]:checked').val();

var cP1 = Apperyio('callPromoter').text();
var cP2 = Apperyio('callPromoter2').text();
var cP3 = Apperyio('callPromoter3').text();
var cP4 = Apperyio('callPromoter4').text();

if (type == "description"){
Apperyio("TicketsGuestlistGrid").hide();
Apperyio('callPromoter').hide();
Apperyio('callPromoter2').hide();
Apperyio('callPromoter3').hide();
Apperyio('callPromoter4').hide();

Code: Select all

 Apperyio('postList_429').hide(); 
 Apperyio("noPosts_grid").hide(); 

 Apperyio("MainInfo_grid").show(); 
 Apperyio("DescriptionGrid").show(); 
 Apperyio("VenueDescriptionGrid").show(); 
 Apperyio("collapsible_infoUpdate").show(); 

 Apperyio('loader_grid_390').hide(); 

}

if (type == "ticketguestlist"){
Apperyio("MainInfo_grid").hide();
Apperyio("DescriptionGrid").hide();
Apperyio("VenueDescriptionGrid").hide();
Apperyio("collapsible_infoUpdate").hide();
Apperyio("TicketsGuestlistGrid").hide();

Code: Select all

 Apperyio("noPosts_grid").hide(); 
 Apperyio('postList_429').hide(); 
 Apperyio('loader_grid_390').hide(); 

     if (cP1 == "undefined"){ 
  Apperyio('callPromoter').hide(); 
  } 

if (cP1 != "undefined"){
Apperyio('callPromoter').show();
Apperyio('TicketsGuestlistGrid').hide();
}

if (cP2 == "undefined"){
Apperyio('callPromoter2').hide();
}
if (cP2 != "undefined"){
Apperyio('callPromoter2').show();
Apperyio('TicketsGuestlistGrid').hide();
}

if (cP3 == "undefined"){
Apperyio('callPromoter3').hide();
}
if (cP3 != "undefined"){
Apperyio('callPromoter3').show();
Apperyio('TicketsGuestlistGrid').hide();
}

if (cP4 == "undefined"){
Apperyio('callPromoter4').hide();
}
if (cP4 != "undefined"){
Apperyio('callPromoter4').show();
Apperyio('TicketsGuestlistGrid').hide();
}

Code: Select all

 if (cP1 == "undefined" && cP2 == "undefined" && cP3 == "undefined" && cP4 == "undefined"){ 

Apperyio('TicketsGuestlistGrid').show();
}
}

if (type == "posts"){
Apperyio("MainInfo_grid").hide();
Apperyio("DescriptionGrid").hide();
Apperyio("VenueDescriptionGrid").hide();
Apperyio("collapsible_infoUpdate").hide();
Apperyio("TicketsGuestlistGrid").hide();

Code: Select all

 Apperyio("TicketsGuestlistGrid").hide(); 
 Apperyio('callPromoter').hide(); 
 Apperyio('callPromoter2').hide(); 
 Apperyio('callPromoter3').hide(); 
 Apperyio('callPromoter4').hide(); 

 Apperyio('loader_grid_390').show(); 
 NightPosts.execute(); 

}

This has been working fine for the past few months but now the error occurs and the radio doesnt work properly.
For example by default the 'description' is selected. If i click 'ticketguestlist', the javascript code if (type == "ticketguestlist"){ //code} /code runs correctly. But the radio button still shows 'description' as selected.

Joe Sharples
Posts: 0
Joined: Mon Aug 18, 2014 1:31 pm

Uncaught Error: cannot call methods on checkboxradio prior to initialization; attempted to call method 'refresh'

Image

as you can see the 'Post' button is selected.
I clicked 'Description' and the correct Js ran:

pre if (type == "description"){
Apperyio("TicketsGuestlistGrid").hide();
Apperyio('callPromoter').hide();
Apperyio('callPromoter2').hide();
Apperyio('callPromoter3').hide();
Apperyio('callPromoter4').hide();

Apperyio('postList_429').hide();
Apperyio("noPosts_grid").hide();

Apperyio("MainInfo_grid").show();
Apperyio("DescriptionGrid").show();
Apperyio("VenueDescriptionGrid").show();
Apperyio("collapsible_infoUpdate").show();

Apperyio('loader_grid_390').hide();
} /pre

this code worked but the 'Post' button is still selected when it should be the 'Description' button

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Uncaught Error: cannot call methods on checkboxradio prior to initialization; attempted to call method 'refresh'

Hi Joe -

We are very sorry for the radio silence here!
Is it possible to share it with us as an app public link, so we can test this more precisely?

Joe Sharples
Posts: 0
Joined: Mon Aug 18, 2014 1:31 pm

Uncaught Error: cannot call methods on checkboxradio prior to initialization; attempted to call method 'refresh'

Hi,

I replaced the radio button and the problem no longer occurs.
I'll post back here if i experience it again.

Return to “Issues”