Not getting result from list | Community
Skip to main content
Level 6
July 12, 2022
Question

Not getting result from list

  • July 12, 2022
  • 1 reply
  • 557 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Nikhil_Verma
Level 4
July 19, 2022

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