掲示板

Getting nil rows from baseListView in ios

thumbnail
6年前 に Prakash Kumar Singh によって更新されました。

Getting nil rows from baseListView in ios

Junior Member 投稿: 85 参加年月日: 15/01/30 最新の投稿
Liferay Screen version : - 2.0.1

Hi
i am creating custom list screenlet. Screenlet is populated with list data. but when i am using below code for other functionalities .It returning nil .I am confused what is actual this return.


let rows = (screenlet.screenletView as? BaseListView)?.rows
  print("rows" , rows)



Thanks in advance for any help !!
thumbnail
6年前 に Victor Galan によって更新されました。

RE: Getting nil rows from baseListView in ios

Regular Member 投稿: 144 参加年月日: 16/06/14 最新の投稿
Where are you executing that code?

rows cant be nil so the screenletview is the nil here, maybe its not yet initialized
thumbnail
6年前 に Prakash Kumar Singh によって更新されました。

RE: Getting nil rows from baseListView in ios

Junior Member 投稿: 85 参加年月日: 15/01/30 最新の投稿
Victor Galan:
Where are you executing that code?
rows cant be nil so the screenletview is the nil here, maybe its not yet initialized



 // On List item selection
    func screenlet(screenlet: NewsListScreenlet,
        onNewsSelectedEntry entry: NewsListScreenletEntry) {
       
        // open page view controller
        let mainStoryBoard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
        let viewController : PageViewController = mainStoryBoard.instantiateViewControllerWithIdentifier("PageViewController") as! PageViewController
        let rows = (screenlet.screenletView as? BaseListView)?.rows
        print("selectedrows" , rows)
        // viewController.rows = rows
        if let rowCount = (screenlet.screenletView as? BaseListView)?.rowCount {
            viewController.rowCount = rowCount
        } else {
            viewController.rowCount = rows?.count ?? 0
        }
        
        viewController.selectedEntry = entry
        viewController.pageType = menuItem.pageType
        viewController.contentType = menuItem.friendlyURL
}
    }



i am using this code in viewController class from where custom screenlet is loaded
thumbnail
6年前 に Prakash Kumar Singh によって更新されました。

RE: Getting nil rows from baseListView in ios

Junior Member 投稿: 85 参加年月日: 15/01/30 最新の投稿
Any Help ??