on 21-05-2012 03:04 PM
Hey,
I got a ListPanel in a Scene.
I use these to populate them :
pnlItemsList.ScrollBarVisibility = ScrollBarVisibility.ScrollableVisible; pnlItemsList.SetListItemCreator(ListItemCreator); pnlItemsList.SetListItemUpdater(ListItemUpdator); pnlItemsList.Sections = section;
But the ListItemCreator and Updator only trigger when I do the slide movement in my scene.
So when the scene start, I don't see anything until I do a slide. What could be the problem?
(I looked at the UI_Catalog example but dont"t see any difference)
Thanks in advance
on 22-05-2012 03:34 PM
At first sight I do not see anything that could explain it in your code.
Did you use a breakpoint in the ListItemCreator and ListItemUpdator methods to check when it triggers that code?
Some questions to find the reason:
How is the section variable defined and where/when is it filled?
Is the code you provided located in the constructor of the scene?
Is the ListPanel placed directly on the scene or indirectly using another panel?
on 22-05-2012 03:57 PM
Thanks for the reply.
1) The code in my first post is situated in the initialize method (this is triggered in the constructor of the class)
2) How can I check by what it is triggered (when using breakpoints)?
3) The listPanel is placed directly on my scene.
4) I use this for my sections :
static private ListSection listSection = new ListSection(constantClass.LlblFeedScrollHeader, listItemStrings.Count);
22-05-2012 06:29 PM - edited 22-05-2012 06:32 PM
Ok,
1. Is your initialize method called after calling the method InitializeWidget(); in the constructor?
2. One of the debug windows is called Call stack. When the breakpoint is reached, choose: view | Debug windows | Call stack.
3. Ok.
4. Not sure if that's correct as you did not show how and where section is defined.
Do you use something like this for section?
static private ListSectionCollection section = new ListSectionCollection {
listSection;
}
Further, does listItemStrings already contain values when creating an instance for your listSection?
on 22-05-2012 07:15 PM
1. This is in my InitializeWidget() :
listSection = new ListSection("Feeds", list.Count);
section = new ListSectionCollection { listSection };
// pnlItemsList
pnlItemsList.ShowEmptySection = false;
pnlItemsList.ScrollBarVisibility = ScrollBarVisibility.ScrollableVisible;
pnlItemsList.SetListItemCreator(ListItemCreator);
pnlItemsList.SetListItemUpdater(ListItemUpdator);
pnlItemsList.Sections = section;and I got these methods for the creator and updater :
private ListPanelItem ListItemCreator()
{
return new pnlItemFeed();
}
public void ListItemUpdator(ListPanelItem item)
{
if (item is pnlItemFeed)
{
RssList.Add((pnlItemFeed)item);
}
foreach (pnlItemFeed _item in RssList)
{
pnlItemFeed x = (pnlItemFeed) _item;
x.Title = list[_item.Index].Title;
x.Description = list[_item.Index].Description;
x.ReadMore = constantClass.LbtnReadMore;
}
}But these only get trigger when the slide event is triggered.
2. This is the call stack.
RssReader2.scnItems.ListItemCreator () in c:\Users\Wim\Dropbox\RssReader2\RssReader2\UI\scnItems.composer.cs:105 Sce.Pss.HighLevel.UI.ListPanel.CreateListItem () in Sce.Pss.HighLevel.UI.ListPanel.SetNextListItem (nextPos=47, nextAllIndex=0, nextSctionIndex=0, nextIndexInSection=0) in Sce.Pss.HighLevel.UI.ListPanel.SetNextItem (nextPos=47) in Sce.Pss.HighLevel.UI.ListPanel.UpdateItems (scrollDistance=-21,00003) in Sce.Pss.HighLevel.UI.ListPanel.DragEventHandler (sender={Sce.Pss.HighLevel.UI.DragGestureDetector} , e={Sce.Pss.HighLevel.UI.DragEventArgs}) in Sce.Pss.HighLevel.UI.DragGestureDetector.OnTouchEv ent (touchEvents={Sce.Pss.HighLevel.UI.TouchEventColle ction}) in Sce.Pss.HighLevel.UI.Widget.SendTouchEventToGestur eDetectors (touchEvents={Sce.Pss.HighLevel.UI.TouchEventColle ction}) in Sce.Pss.HighLevel.UI.Widget.OnTouchEvent (touchEvents={Sce.Pss.HighLevel.UI.TouchEventColle ction}) in Sce.Pss.HighLevel.UI.ListPanel.OnTouchEvent (touchEvents={Sce.Pss.HighLevel.UI.TouchEventColle ction}) in Sce.Pss.HighLevel.UI.UISystem.CallTouchEventHandle rs (allTouchEvents={Sce.Pss.HighLevel.UI.TouchEventCo llection}, isUpdatePrimaryTouchEvent=true) in Sce.Pss.HighLevel.UI.UISystem.SendTouchDataList (touchDataList=Count=1) in Sce.Pss.HighLevel.UI.UISystem.Update (touchDataList=Count=1) in
But I think the problem is that the 2 methods from 1) don't get triggered on the initialisation. But I don't know why
22-05-2012 08:31 PM - edited 22-05-2012 08:33 PM
Wish I could just say why...
Until now, it is also not clear to me why the methods do not get triggered in your case.
I use PanelLists and they just work fine. So it is not impossible to get it workng.
But...
What I still cannot see from your code examples is where the variable list is filled.
Your first line says: listSection = new ListSection("Feeds", list.Count);
If this list variable is still empty at that time, list.Count will be 0 and it would result in an empty listsection which could explain why the event is not triggered at that time.
Further (if that's not the case), it may help to simplify your code a bit (put some code in comments for testing purposes).
Especially in your ListItemUpdator as you are doing some other stuff there with another list (RssList) that looks a bit strange to me at first sight (probably because I do not know the whole context of what you are trying to do there)
Maybe you can start by using only something like this:
public void ListItemUpdator(ListPanelItem item)
{
if (item is pnlItemFeed)
{
pnlItemFeed x = (pnlItemFeed)item;
x.Title = "test";
x.Description = "test";
x.ReadMore = constantClass.LbtnReadMore;
}
}
on 23-05-2012 09:28 AM
I actually do :
listSection = new ListSection("Feeds", list.Count);
section = new ListSectionCollection { listSection };
And this works fine, section has 20 items.
There is no point simplyfing that updator method since it doesn't get triggered when initializing the class.
But thanks anyway!
on 23-05-2012 08:48 PM
Ok,
unfortunately I could not provide a solution for this yet...
But there is one thing that I just noticed which may help you further ...
Another message you posted about: Setting an existing Scene()
Is that topic about the same source code as this one?
In that case, the approach you have chosen for setting scenes might be worth investigating as it could be the cause for this problem.
on 24-05-2012 12:31 PM
on 25-05-2012 09:40 AM
using System;
using System.Collections.Generic;
using Sce.Pss.Core;
using Sce.Pss.Core.Imaging;
using Sce.Pss.Core.Environment;
using System.Collections.ObjectModel;
using Sce.Pss.HighLevel.UI;
namespace RssReader2
{
partial class scnItems
{
ImageBox ImageBox_1;
ListPanel pnlItemsList;
Button btnGoBack;
Label lblFeedTitle;
private Scene menuScene = null;
private static Collection<Rss.Items> list;
static List<pnlItemFeed> RssList;
private static RssManager reader;
private ListSection listSection;
private string feedName = "";
private ListSectionCollection section;
private void InitializeWidget()
{
InitializeWidget(LayoutOrientation.Horizontal,"");
}
private void InitializeWidget(string filename)
{
InitializeWidget(LayoutOrientation.Horizontal,file name);
}
public Scene getMainMenuScene()
{
return menuScene;
}
private void InitializeWidget(LayoutOrientation orientation,string selectedFeedName)
{
ImageBox_1 = new ImageBox();
ImageBox_1.Name = "ImageBox_1";
pnlItemsList = new ListPanel();
pnlItemsList.Name = "pnlItemsList";
btnGoBack = new Button();
btnGoBack.Name = "btnGoBack";
lblFeedTitle = new Label();
lblFeedTitle.Name = "lblFeedTitle";
menuScene = new Scene();
reader = new RssManager();
feedName = selectedFeedName;
RssList = new List<pnlItemFeed>();
if(selectedFeedName.Length > 0)
{
reader.Url = "/Application/feeds/"+selectedFeedName+".xml";
}
reader.GetFeed();
list = reader.RssItems;
//feed dingen opvullen
listSection = new ListSection("Feeds", list.Count);
section = new ListSectionCollection { listSection };
// ImageBox_1
ImageBox_1.Image = new ImageAsset("/Application/assets/back.png");
// pnlItemsList
pnlItemsList.ShowEmptySection = false;
pnlItemsList.ScrollBarVisibility = ScrollBarVisibility.ScrollableVisible;
pnlItemsList.SetListItemCreator(ListItemCreator);
pnlItemsList.SetListItemUpdater(ListItemUpdator);
pnlItemsList.Sections = section;
// btnGoBack
btnGoBack.TextColor = new UIColor(0f / 255f, 0f / 255f, 0f / 255f, 255f / 255f);
btnGoBack.TextFont = new Font( FontAlias.System, 25, FontStyle.Regular);
btnGoBack.TouchEventReceived += HandleBtnGoBackTouchEventReceived;
// lblFeedTitle
lblFeedTitle.TextColor = new UIColor(0f / 255f, 0f / 255f, 0f / 255f, 255f / 255f);
lblFeedTitle.Font = new Font( FontAlias.System, 30, FontStyle.Bold);
lblFeedTitle.LineBreak = LineBreak.Character;
// Scene
pnlItemsList.UpdateItems();
menuScene.RootWidget.AddChildLast(ImageBox_1);
menuScene.RootWidget.AddChildLast(btnGoBack);
menuScene.RootWidget.AddChildLast(lblFeedTitle);
menuScene.RootWidget.AddChildLast(pnlItemsList);
SetWidgetLayout(orientation);
UpdateLanguage();
}
void HandleBtnGoBackTouchEventReceived (object sender, TouchEventArgs e)
{
AppMain.callTestStartScene();
}
private ListPanelItem ListItemCreator()
{
return new pnlItemFeed();
}
public void ListItemUpdator(ListPanelItem item)
{
if (item is pnlItemFeed)
{
RssList.Add((pnlItemFeed)item);
}
foreach (pnlItemFeed _item in RssList)
{
pnlItemFeed x = (pnlItemFeed) _item;
x.Title = list[_item.Index].Title;
x.Description = list[_item.Index].Description;
x.ReadMore = constantClass.LbtnReadMore;
}
}
private LayoutOrientation _currentLayoutOrientation;
public void SetWidgetLayout(LayoutOrientation orientation)
{
switch (orientation)
{
case LayoutOrientation.Vertical:
this.DesignWidth = 544;
this.DesignHeight = 960;
ImageBox_1.SetPosition(0, 0);
ImageBox_1.SetSize(200, 200);
ImageBox_1.Anchors = Anchors.Top | Anchors.Height | Anchors.Left | Anchors.Width;
ImageBox_1.Visible = true;
pnlItemsList.SetPosition(-256, -18);
pnlItemsList.SetSize(854, 400);
pnlItemsList.Anchors = Anchors.Top | Anchors.Height | Anchors.Left | Anchors.Width;
pnlItemsList.Visible = true;
btnGoBack.SetPosition(735, 15);
btnGoBack.SetSize(214, 56);
btnGoBack.Anchors = Anchors.Top | Anchors.Height | Anchors.Left | Anchors.Width;
btnGoBack.Visible = true;
lblFeedTitle.SetPosition(13, 22);
lblFeedTitle.SetSize(214, 36);
lblFeedTitle.Anchors = Anchors.Top | Anchors.Height | Anchors.Left | Anchors.Width;
lblFeedTitle.Visible = true;
break;
default:
this.DesignWidth = 960;
this.DesignHeight = 544;
ImageBox_1.SetPosition(0, 0);
ImageBox_1.SetSize(960, 544);
ImageBox_1.Anchors = Anchors.Top | Anchors.Height | Anchors.Left | Anchors.Width;
ImageBox_1.Visible = true;
pnlItemsList.SetPosition(0, 90);
pnlItemsList.SetSize(960, 440);
pnlItemsList.Anchors = Anchors.Top | Anchors.Height | Anchors.Left | Anchors.Width;
pnlItemsList.Visible = true;
btnGoBack.SetPosition(735, 15);
btnGoBack.SetSize(214, 56);
btnGoBack.Anchors = Anchors.Top | Anchors.Height | Anchors.Left | Anchors.Width;
btnGoBack.Visible = true;
lblFeedTitle.SetPosition(12, 10);
lblFeedTitle.SetSize(442, 61);
lblFeedTitle.Anchors = Anchors.Top | Anchors.Height | Anchors.Left | Anchors.Width;
lblFeedTitle.Visible = true;
break;
}
_currentLayoutOrientation = orientation;
}
public void UpdateLanguage()
{
btnGoBack.Text = constantClass.LbtnGoBack;
lblFeedTitle.Text = feedName;
}
private void onShowing(object sender, EventArgs e)
{
switch (_currentLayoutOrientation)
{
case LayoutOrientation.Vertical:
{
}
break;
default:
{
}
break;
}
}
private void onShown(object sender, EventArgs e)
{
switch (_currentLayoutOrientation)
{
case LayoutOrientation.Vertical:
{
}
break;
default:
{
}
break;
}
}
}
}
PSM Developer Registration (for free) on PSM DevPortal is required to post on the forum.
Please sign out then sign in again to the forum and PSM DevPortal after you have completed the registration.
フォーラムへ投稿をするにはPSM DevPortalへの登録(無料)が必要です。
登録後はフォーラムと
PSM DevPortalを一度ログアウトし、再度ログインしてください。


Website ©2013 Sony Computer Entertainment Europe
All content, game titles, trade names and/or trade dress, trademarks, artwork and associated imagery are trademarks and/or copyright material of their respective owners. All rights reserved. [more info]
%%http://community.eu.playstation.com/t5/Announcements/Beta-Trial-Information/td-p/11386362
best_shooter.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_driver.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_performer.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_footballer.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_fighter.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_creator.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_action_player.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
dev2.png%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/Producer-and-Developer-Ranks/td-p/18407352
trophy.gif%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/The-Community-Awards-FAQ/td-p/18407096
PSlogoSM.png%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/Online-Support-Coordinator-rank/td-p/18414870