Appery().val() has stopped updating selected item in dropdown selector lists

This forum contains topics that were moved from Get Satisfaction
Jason Cheek
Posts: 0
Joined: Sun Jan 12, 2014 8:00 am

Appery().val() has stopped updating selected item in dropdown selector lists

Post by Jason Cheek »

It started about a few days ago. I thought it was an error in my javascript, but I just tested with a completely blank app. There is a dropdown selector and a button. When the button is clicked it runs this line:

Appery('mobileselectmenu_4').val('Vici');

The highlighted item changes when the dropdown list is displayed in native mode, but the displayed "selected' item does not. The value returned by Appery().val() is correct, however.

I have verified this on 2 desktops, both Win8.1 and Win7, in both the newest IE and FF -- as well as the Appery Tester app on a Samsung Note 2 running Android 4.3

Image

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

Appery().val() has stopped updating selected item in dropdown selector lists

Post by Alena Prykhodko »

Hello Jason,

We are looking into this question, we'll update as soon as have more information..

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

Appery().val() has stopped updating selected item in dropdown selector lists

Post by Alena Prykhodko »

Please use .trigger("change") to tell select UI control about value has been changed.

So correct code is:

pre
Appery("mobileselectmenu_4").val("Vici").trigger("change");/pre

Jason Cheek
Posts: 0
Joined: Sun Jan 12, 2014 8:00 am

Appery().val() has stopped updating selected item in dropdown selector lists

Post by Jason Cheek »

This solved the problem! Thank you.

Matt6607699
Posts: 0
Joined: Sat Jan 25, 2014 7:18 am

Appery().val() has stopped updating selected item in dropdown selector lists

Post by Matt6607699 »

can I pass a variable from local storage instead of a string to change the default select component value?

var current = localStorage.getItem("_accountUserName");

Appery("selectUserDropdown").val(current).trigger("change");

This didn't work for me.

I have the select component being populated from REST and it gives two values. "mark" and "Joe". "Joe" is the last name to populate to it is shown as default. I need to change the Default name to the current user(which is "mark"). The name has to be retrieved from local storage though because the name will change depending on the current user ID.

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

Appery().val() has stopped updating selected item in dropdown selector lists

Post by Yurii Orishchuk »

Hi Matt,

You need invoke this code on "success" event for your service that's populates your select component.

See details on screen shot:

http://prntscr.com/49bkjd/direct

Regards.

Matt6607699
Posts: 0
Joined: Sat Jan 25, 2014 7:18 am

Appery().val() has stopped updating selected item in dropdown selector lists

Post by Matt6607699 »

HI,
I had it setup that way originally but it doesn't seem to work for me. The alert shows "mark" like it should but the name joe comes up as the default menu item still. Image
Image
Image

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

Appery().val() has stopped updating selected item in dropdown selector lists

Post by Yurii Orishchuk »

Hi Matt,

You code looks ok.

Please try this code:

pre

//Note you should replace "mobileselectmenu_10" with your select component name.
var yourSelect = Appery("mobileselectmenu_10");
yourSelect.val("ValueYouNeed");
yourSelect.selectmenu('refresh', true);

/pre

Also if it does not help please give us your app public link and describe steps to reproduce this problem.

Thanks & regards.

Matt6607699
Posts: 0
Joined: Sat Jan 25, 2014 7:18 am

Appery().val() has stopped updating selected item in dropdown selector lists

Post by Matt6607699 »

Hi, thank you for the response. I used the code you suggested as follows:
Image

This still produced the same results.

Here is my public link:
a rel="nofollow"http://appery.io/app/mobile-frame?src=h ... e=mobile/a

Hit the top left gear to login.
Under Existing User login.
Username: mark
pass: 1234

After the redirect, click the top gear icon again and click "company info"
After that redirect the top left select menu should populate on page show event.
Since you are logged in as "mark", that name should be default but it just shows "Joe".

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

Appery().val() has stopped updating selected item in dropdown selector lists

Post by Yurii Orishchuk »

Hi Mat,

Unfortunatly i can not SignIn in your APP.

See details: http://prntscr.com/4abv5r/direct

Please specify how can i login in your app.

Regards.

Post Reply