Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Not getting result from list

Avatar

Level 4

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 4

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