Jack Bua
Posts: 0
Joined: Sun Jun 28, 2015 10:16 pm

Collapsblock header Taphold Event issues

I noticed that there was no Appery way to set events on a collapsblock header, so I put this code into a function:

function QuoteTap() {
var result = confirm("Would you like to make a new quote?");
if (result) {
Appery.navigateTo('edit_info_screen', {
transition: 'pop'
});
}
}

and this code in the Page Show event:

Apperyio("quotes").bind( "taphold", QuoteTap);

Basically I wanted to confirm dialog on tap hold of the header to take to me to a dialog when I clicked ok. All of that works, but on two Android tablets I noticed that the destination page is pretty much frozen and the controls are all unresponsive. I can go back by using the device's back button and now everything is unresponsive. However, I do not have this problem on a phone. I can confirm that one of the tablets are running Android 4.4.2 and the phone is running 5.0.2.

After further testing I have isolated this issue to the taphold event of the collapsblock header only as the same .bind() code works on buttons and the result is the same whether the target I am navigating to is a page or dialog.

I guess now I know why Appery doesn't have a way to add events to a collapsblock header...

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

Collapsblock header Taphold Event issues

Hello Jack,

Thank you for detailed explanation.
Kindly let us know if support team can be of any assistance here.

Jack Bua
Posts: 0
Joined: Sun Jun 28, 2015 10:16 pm

Collapsblock header Taphold Event issues

Is there a way to make a taphold event work properly on a collapsblock header or to put a functioning button in a grid in the header? I am just looking to navigate to another page or open a dialog.

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

Collapsblock header Taphold Event issues

Hi Jack,

You can use following JS code to attach event:

pre

//Where "mobilecollapsblockheader_149' is your collapsible header component name.
Apperyio("mobilecollapsblockheader_149").bind("taphold", onTapHold);

/pre

I tried it on my phone and it works correctly.

Please try:

1 use JS code for event handler to simplify the event handler.

pre

var onTapHold = function(){alert("taphold");}

/pre

2 If 1st step will work without problems try following JS code(with delay) to navigate to other page:

pre

var onTapHold = function(){
var onDelay = function(){
Appery.navigateTo('edit_info_screen', {});
};
window.setTimeout(onDelay, 100);

}

/pre

Regards.

Jack Bua
Posts: 0
Joined: Sun Jun 28, 2015 10:16 pm

Collapsblock header Taphold Event issues

Thank you for your reply. I apologize for not getting to this sooner, but I found a way to avoid this, until now. My problem is with:

Apperyio("mobilecollapsblockheader_149").bind("taphold", onTapHold);

I need to clarify:
I cannot assign this to the proper collapse Collapsable Block Header because I have the collapsible set being populated/mapped by a service, and you can only map to the block, not the header. How would I resolve this?

Return to “Issues”