Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Not getting result from list

Avatar

Level 8

Hi,

 

I want to display data of list and I have a method inside model like this logs are printing

public List<Double> getListOfValues() throws JSONException, IOException {
listOfValues=gpsservice.geDataOfWeather(latitudeVal,LongitudeVal,cityVal);
log.info("arraylist inside getter from service inside list method"+listOfValues);
return listOfValues;
}

 But I checked whether values are there in list in this method

public String getCity() throws JSONException, IOException {
city=cityVal;
log.info("city inside getter of cityval" + city);
listOfValues=gpsservice.geDataOfWeather(latitudeVal,LongitudeVal,cityVal);
log.info("arraylist inside getter from service"+listOfValues);
return city;

}

 There are values in logs of getCity()  but inside list method[getListOfValues()] Its not printing logs

 

this is the code I have in sigthly

<sly data-sly-use.GpsLocation="${'com.yppocsite.core.models.GpsLocation'}"></sly>
<h1>Weather</h1>
<h2>city using sly : ${GpsLocation.city}</h2>
<div data-sly-use.collect="com.yppocsite.core.models.GpsLocation">
<div data-sly-list.item="${collect.listOfValues}"></div>
<h2>List using div : ${item}</h2>
</div>
</div>

 

even itsnot entering inside div also can anyone help me on this.

1 Reply

Avatar

Level 5

You should see an error entry in the error.log file when you load the page. Can you share that error log entry?