Hawk
Posts: 0
Joined: Mon Aug 04, 2014 11:23 am

Show button

Hi,

I used to use the following js to display the button if the its default attribute (visible) not ticked.

preApperyio("mobileradiobutton_226_227").show();/pre

However, this does not work anymore. The button is located on a panel, and I run the above js on page load.

I also tried the following but it did not work either:

preApperyio("mobileradiobutton_242").find(".ui-btn").show(); /pre

I tested this on google chrome and FireFox.

Please advise!

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Show button

Hello!

Are there any errors in console?

Hawk
Posts: 0
Joined: Mon Aug 04, 2014 11:23 am

Show button

No, not at all.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Show button

Please try next:
pre
$("[name=mobileradiobutton_32]").show();/pre

Hawk
Posts: 0
Joined: Mon Aug 04, 2014 11:23 am

Show button

Hi Alena,

I tried that, same result.

Basically, this code run on page load:

pre if(month.toUpperCase() === "JAN"){
console.log(month.toUpperCase());

Code: Select all

         Apperyio("mobileradiobutton_242").find(".ui-btn").text("Jan 20"+year); 
         $("[name=mobileradiobutton_242]").show();   
         console.log('show mobileradiobutton_242'); 

}/pre

I can see from console the condition if is met, and hence statements inside should be executed.

This used to work just fine previously.

To replicate the problem:
link: http://appery.io/app/mobile-frame?src...

credentials: 11701980/JTI01980

Navigation: Login - NavBar (MyPoints) - you call pull out the panel from the button highlighted below. It is supposed to display one button on the panel (where the condition above is met) but it does not.

Image

Many thanks,

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Show button

Hello Hawk,

Currently we weren't be able to navigate to MyPoint page, because of the error
http://gyazo.com/5572ad6f20c240b3f707... - stack
http://gyazo.com/256cb336f86270543d70... - line of code causing it

Hawk
Posts: 0
Joined: Mon Aug 04, 2014 11:23 am

Show button

Hi Evgene,

I have checked, first time I got the error you showed me, then I refreshed and logged in and it worked. I am not sure what is the problem.

Now I can see the button is showing on FireFox but not on google chrome. I am not sure how much this is going to affect the App users

Many thanks,

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Show button

Hawk,

We tried to use the code and it works for us
http://gyazo.com/87956769088aea56fe58...
It seems that your condition doesn't match, thus line showing never been invoked

Hawk
Posts: 0
Joined: Mon Aug 04, 2014 11:23 am

Show button

I ignored this issue for a while, as it was not showing any consistent error. But it became really serious.

My code starts like this:
pre
for(var j = 0; j < 12; j++)
{
if(goalArray && goalArray[j] && goalArray[j]&#46;MPD_Month)
{
var month_array = goalArray[j]&#46;MPD_Month;
var year = month_array&#46;slice(-2)&#46;replace(/[0-9]/g,''); &#47;&#47;last two digits numbers only
var month = month_array&#46;substring(0, 3); &#47;&#47;first three characters
var lng_img = localStorage&#46;getItem("lang");
if(lng_img == "en"){

Code: Select all

     if(month&#46;toUpperCase() === "JAN"){ 
         Apperyio("mobileradiobutton_242")&#46;find("&#46;ui-btn")&#46;text("Jan 20"+year); 
         $("[name=mobileradiobutton_242]")&#46;show();   
         console&#46;log('show mobileradiobutton_242'); 
         month_counter = month_counter+1; 

}

else if (month&#46;toUpperCase() === "FEB"){
Apperyio("mobileradiobutton_226_227")&#46;find("&#46;ui-btn")&#46;text("Feb 20"+year);
$("[name=mobileradiobutton_226_227]")&#46;show();
console&#46;log('show mobileradiobutton_226_227');
month_counter = month_counter+1;
}

else if (month&#46;toUpperCase() === "MAR"){
Apperyio("mobileradiobutton_225_226")&#46;find("&#46;ui-btn")&#46;text("Mar 20"+year);
Apperyio("mobileradiobutton_225_226")&#46;show();
console&#46;log('show mobileradiobutton_225_226');
month_counter = month_counter+1;
}
&#47;&#47; check the rest of the months&#46;&#46;&#46;&#46;&#46;&#46;&#46;
/pre

So if the condition is met, it will show in the console logs
and I added this line at the end of the script:

prevar h = Apperyio("mobileradiobutton_225_226")&#46;is(":visible");
console&#46;log('is mobileradiobutton_225_226 visible: '+ h);/pre

I also tried apperyio("mobileradiobutton_226_227") instead of this: $("[name=mobileradiobutton_226_227]")

The result using the same steps provided in the earlier post is as follows:

Image

This results in these buttons do no appear on panel I mentioned. But more interesting, is that they the buttons are visible when I test on the phone (but that is not enough as there is other logic linked to visibility and it is not working properly as as result).

Your help is deeply appreciated.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Show button

HI Hawk,

It seems something else change visibility for this button(some other code or built-in functionality).

Please specify where you use this code.

Regards.

Return to “Issues”