Yaniv
Posts: 0
Joined: Wed Jun 12, 2013 8:38 pm

Select option not getting populated with json response after Appery builder upgrade

Hi,

I have existing project that uses old Appery builder,
In this project I have a page with select component that getting populated from a call to server code with the 1st value in the response list (simple mapping :)).

Now, I upgraded to the new Appery builder,
While this page is loaded I cannot see the 1st option in select component populated, I need to click on the select component and select the value (while in previous version it was loaded 1st value automatically).

I checked the mapping and this is the same as the previous version.

Can you tell why?

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

Select option not getting populated with json response after Appery builder upgrade

Hi Yaniv,

Please check actual response from this service.

Also please show us "success" mapping.

Regards.

Yaniv
Posts: 0
Joined: Wed Jun 12, 2013 8:38 pm

Select option not getting populated with json response after Appery builder upgrade

Hi,
The response is that getting from the service doesn't contain any empty options.
Regarding the mapping, see attached image:
Image
In addition I notice the following also in new builder that not working as expected (related to this issue also):
The options label built from prefix + suffix, both of them coming from the server response: mapping: return localStorage.getItem("placeNameHelper") + " - " + value;
For the prefix I'm using local variable (placeNameHelper) that populated based on the current response iteration (see attached image):
Image

In the new builder this local variable populated only one and not per each iteration (in previous version it was updated per iteration)

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

Select option not getting populated with json response after Appery builder upgrade

Hi Yaniv,

Please follow these steps to get it work in new builder:

  1. Open success event handler.

  2. Delete link to storage "placeNameHelper".

  3. Make link from "$" to the "Label" attribute of the select item component.

  4. Click "JS" on this(3 step) link.

  5. Use following JS code:

    pre

    return value.PlaceAddressArea + "_" + value.PlaceName;

    /pre

    Regards.

Yaniv
Posts: 0
Joined: Wed Jun 12, 2013 8:38 pm

Select option not getting populated with json response after Appery builder upgrade

Thanks, I will check this :)
Still left the issue that the select not populated with the 1st value that come from response, its contains blank (as describe above), can you please check?

Yaniv
Posts: 0
Joined: Wed Jun 12, 2013 8:38 pm

Select option not getting populated with json response after Appery builder upgrade

Hi,
I notice the following:

  1. While I removed "Native Menu" check from the select component, I can see it loaded with the data as expected but while "Native Menu" is checked (use native menu) I'm facing this issue.

  2. I have 2 selects that depends one with the other, means that based on the value in the 1st select I'm retrieve the values of the 2nd select.
    In previous builder, while the service that retrieve the 1st select was get to success stage I was invoke the next services to retrieve the dependent values and get the 1st select value in the input mapping of the 2nd service by: "Appery('EventPlaceList').find(':selected').val()" - this was done successfully.

    Now in the new builder while 1st service retrieve the data and getting to success stage I'm invoking the 2nd service and in the input mapping the use of "Appery('EventPlaceList').find(':selected').val()" return to me blank.

    Note:

  3. After the page rendered completely and doing change in the 1st service, the 2nd service get the value of the 1st select and retrieve the data as expected.

  4. I tested it using native and non native select and in both cases the result is the same (same issue)

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

Select option not getting populated with json response after Appery builder upgrade

Hi Yaniv,

Tried this mapping with "native menu" option and it works for me.
Details: http://prntscr.com/65l36v/direct

Code to get selected value is not good.

pre

Appery('EventPlaceList').find(':selected').val();

/pre

Please use following instead of yours:

pre

Appery('EventPlaceList').val();

/pre

Regards.

Yaniv
Posts: 0
Joined: Wed Jun 12, 2013 8:38 pm

Select option not getting populated with json response after Appery builder upgrade

Hi Yurii,
Still have both issues (as describe previously) :

  1. While select is "native" - 1st option not selected automatically after getting response from service.

  2. While invoking 2nd service that based on selected value from the 1st select - 1st select value is blank on 2nd service mapping.

    My app is shared (MenuUpgradeTest), you can see both issues in page "CreateNewEvent".
    a. I configure bottom selects as "native" and part are not so you can see the 1st issue.
    b. In this page the top 2 selects are depends one on the other:
    i. 1st select get its values from getPlaceListQuery service.
    ii. 2nd select get its values from getSubPlaceListQuery service.

    Thanks

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

Select option not getting populated with json response after Appery builder upgrade

HI Yaniv,

I've tried your app but is seems the code to set active select items not executes cause of following condition:

pre

if("true" == localStorage.getItem("isNewEventCreatedSuccessfully")){

/pre

So please add some "console.log" to each of this condition cases to debug this code.

Regards.

Yaniv
Posts: 0
Joined: Wed Jun 12, 2013 8:38 pm

Select option not getting populated with json response after Appery builder upgrade

I tried to comment this code and faced the same issue.
Anyhow I see the same issue across the application.

I added additional button on the landing page to access directly to other page that contains 2 selects, you will see the same issue there (page: CreateNewDish).

Can you please take a look?

Return to “Issues”