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

Appery and Native Select Menu refresh differences

I have a select menu populated with the following code

setTimeout(function() {
Apperyio("emp_select").val("");
Apperyio("emp_select").refresh();
}, 10);

-OR-

setTimeout(function() {
Apperyio("emp_select").val("").selectmenu('refresh');
}, 10);

On the following mapping:

Image

This results in the menu defaulting to a manually inoutted value, set up as shown:
Image

The issue I am having is that when a user selects an item from the menu, the menu refreshes. However, this does not happen if I set the menu component as a Native Menu.

Is there a way I can default to a certain value like so yet have the select menu keep its selected value?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Appery and Native Select Menu refresh differences

Hello Jack,

Please use this code:

Apperyio("emp_select").val("").selectmenu('refresh');

on the survice's success event

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

Appery and Native Select Menu refresh differences

I cant use just that code alone or the select menu defaults to the first value in the list, so I have to wrap it with a timeout, like so:

setTimeout(function() {
Apperyio("emp_select").val("").selectmenu('refresh');
}, 10);

which has the same result as the code I mentioned above.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Appery and Native Select Menu refresh differences

Do you still have this issue? If so - please share (http://devcenter.appery.io/documentat...) your app with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a and provide us with the following information:

1) App name
2) Test credentials if login functionality is implemented in your app
3) Detailed steps to reproduce the issue

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

Appery and Native Select Menu refresh differences

BC Speedway
test
123

That login will take you directly to the page. This page affects production data, but as long as you manipulate the select menu only, no problems will occur.

Reproduce the issue by selecting a item from the drop-down.

You can click the blue button "Clone with Native Menu" to go to a clone of the page with one difference: a native menu instead.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Appery and Native Select Menu refresh differences

Please write us, where do you use that JS code. I can't find it in your app.

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

Appery and Native Select Menu refresh differences

On success of the "mgr_payroll_user" service.

Image

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Appery and Native Select Menu refresh differences

Jack, please move JS code from here: http://prntscr.com/9abxvy to the success event of that service

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

Appery and Native Select Menu refresh differences

I did that and get the same result.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Appery and Native Select Menu refresh differences

"Filter By Employee..." is selected by default. Is it correct behavior? http://prntscr.com/9bam7v

Return to “Issues”