Solved Help with List Updating
#1
I have 2 lists in a window, one list is of concert dates for multiple artists and the other list consists of concert dates for an individual artist.
When I click on an item in the multiple artists list it takes the headliner from that list item and runs a script to fill events for that individual artist in the individual artist list.

The problem I am having is that once the individual artist list is filled and I click on a different artist in the multiple artists list the list disappears for a second or two while the script is running to get the concert dates for the artist clicked. When the list re-appears, for a split second the contents of the previous artist events are shown in the individual artist list and then real quick gets overwritten by the new contents.

How can I make this not happen and have the list appear gracefully? I can't seem to grasp how to format the ClearProperty function for the individual artist list (I think that is what I need to do) in the onclick of an item in the multiple artists list. I have tried for several hours to make it work and searched endlessly but still can't grasp how to do it. I appreciate any help I can get on this or an example... Thanks

Here is the item list for the multiple artists list...You can see on one of the onclicks, I have tried a ClearProperty, but it don't work.

PHP Code:
<item id="1">
    <
label>$INFO[Window(Home).Property(NearEvents.1.Artists)]</label>
    <
label2>$INFO[Window(Home).Property(NearEvents.1.Date)]</label2>
    <
thumb>$INFO[Window(Home).Property(NearEvents.1.Artist_Image)]</thumb>
    <
property name="City">$INFO[Window(Home).Property(NearEvents.1.City)]</property>
    <
property name="Name">$INFO[Window(Home).Property(NearEvents.1.Name)]</property>
    <
property name="Description">$INFO[Window(Home).Property(NearEvents.1.Description)]</property>
    <
property name="Title">$INFO[Window(Home).Property(NearEvents.1.Title)]</property>
    <
property name="Website">$INFO[Window(Home).Property(NearEvents.1.Website)]</property>
    <
property name="Headliner">$INFO[Window(Home).Property(NearEvents.1.Headliner)]</property>
    <
onclick>ClearProperty(ArtistEvents,Home)</onclick>
    <
onclick>Skin.SetString(name,$INFO[Window(Home).Property(NearEvents.1.Headliner)])</onclick>
    <
onclick>RunScript(script.extendedinfo,info=artistevents,artistname=$INFO[Window(Home).Property(ArtistEvents.1.Headliner)])</onclick>
    <
visible>IntegerGreaterThan(Window(Home).Property(NearEvents.Count),0)</visible>
</
item

And here is the item list for the individual artist list...

PHP Code:
<item id="1">
    <
label>$INFO[Window(Home).Property(ArtistEvents.1.Artists)]</label>
    <
label2>$INFO[Window(Home).Property(ArtistEvents.1.Date)]</label2>
    <
property name="City">$INFO[Window(Home).Property(ArtistEvents.1.City)]</property>
    <
property name="Name">$INFO[Window(Home).Property(ArtistEvents.1.Name)]</property>
    <
property name="Description">$INFO[Window(Home).Property(ArtistEvents.1.Description)]</property>
    <
property name="Artist">$INFO[Window(Home).Property(ArtistEvents.1.Artist)]</property>
    <
visible>IntegerGreaterThan(Window(Home).Property(ArtistEvents.Count),0)</visible>
</
item

I have included a link to a video of my problem if it will help...
Reply
#2
Something like this in your info list? The delay could bridge the gap.
Code:
<animation effect="fade" start="0" end="100" time="1000" delay="300" condition="!IsEmpty(Window(Home).Property(ArtistEvents))">Conditional</animation>
You might need a specific property from the last item (don't know how many you have).
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply
#3
(2014-06-27, 02:57)MassIV Wrote: Something like this in your info list? The delay could bridge the gap.
Code:
<animation effect="fade" start="0" end="100" time="1000" delay="300" condition="!IsEmpty(Window(Home).Property(ArtistEvents))">Conditional</animation>
You might need a specific property from the last item (don't know how many you have).

I'm not sure exactly what you mean "in your info list". Do you mean in the Items layout?
Not sure where to put animations in a list control... I'm a newbie so don't laugh...lol... could you give an example of where to put animations into lists?... thanks.
Reply
#4
hummm... okay I put it in this control in the list

PHP Code:
<control type="label">
    <
left>30</left>
    <
top>0</top>
    <
width>765</width>
    <
height>30</height>
    <
align>left</align>
    <
label>[COLOR white2]$INFO[ListItem.Property(City)]: [/COLOR]$INFO[ListItem.Property(Name)]</label>
    <
font>Font_Reg26</font>
    <
textcolor>grey2</textcolor>
    <
animation effect="fade" start="0" end="100" time="1000" delay="300" condition="!IsEmpty(Window(Home).Property(ArtistEvents.1.Artists))">Conditional</animation>
</
control

And the animation works on the list and it loads gracefully but only after a restart of XBMC.
Once the list has content and I click on another artist it does the same thing.
It seems XBMC keeps the list contents in a cache and reloads the cache before
the list gets re-filled again so I guess I'm still in the same boat.
By the way... Thanks for taking the time to help me. I appreciate it much.
Reply
#5
okay... If i put these in the items layout it will clear those properties onclick...

PHP Code:
<onclick>ClearProperty(ArtistEvents.1.Artists,Home)</onclick>
<
onclick>ClearProperty(ArtistEvents.1.Date,Home)</onclick>
 <
onclick>ClearProperty(ArtistEvents.1.City,Home)</onclick>
 <
onclick>ClearProperty(ArtistEvents.1.Name,Home)</onclick>
<
onclick>ClearProperty(ArtistEvents.1.Description,Home)</onclick

How would I format an onclick to clear all the properties of the list at once?
I tried...
Quote:<onclick>ClearProperty(ArtistEvents,Home)</onclick>
<onclick>ClearProperty(ArtistEvents.Artists,Home)</onclick>
<onclick>ClearProperty(ArtistEvents.Clear.The.Freakin.Property,Home)</onclick>
and several other different ways but with no luck... I know there has to be a way to clear all the properties of all the lines of a list at once
without putting a million Clearproperty's for each line in each item id but I can't seem to find the right combination of code to do that.
Can anyone help a guy out?... Would be much appreciated. Thanks
Reply
#6
By "your info list" i meant the list on the left that contains your info (i.e. not the artist list). The stuff you want cleared.
Code:
<control type="list">
    <left>0</left>
    <top>0</top>
    <animation effect="fade" start="0" end="100" time="1000" delay="400" condition="!IsEmpty(Window(Home).Property(ArtistEvents.1.Artists))">Conditional</animation>
    <itemlayout width="250" height="250">

Quote:but only after a restart of XBMC.
In the thread of the foundation skin there is a keybind to reload the skin. Find and edit your keymap.xml file.
http://forum.xbmc.org/showthread.php?tid=94438

Quote:How would I format an onclick to clear all the properties of the list at once?

I haven't used this addon, but if it does not have a way to clear them all you can gather everything you want clear in one include and add the include to the item.

Includes.xml
Code:
<include name="ClearAllArtistEvents">
    <onclick>ClearProperty(ArtistEvents.1.Artists,Home)</onclick>
    <onclick>ClearProperty(ArtistEvents.1.Date,Home)</onclick>
    <onclick>ClearProperty(ArtistEvents.1.City,Home)</onclick>
    <onclick>ClearProperty(ArtistEvents.1.Name,Home)</onclick>
    <onclick>ClearProperty(ArtistEvents.1.Description,Home)</onclick>
</include>

In your items:
Code:
<item id="1">
<include>ClearAllArtistEvents</include>
</item>
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply
#7
(2014-06-27, 14:10)MassIV Wrote: In the thread of the foundation skin there is a keybind to reload the skin. Find and edit your keymap.xml file.
http://forum.xbmc.org/showthread.php?tid=94438

Yeah, thats what I meant was to reload the skin... I've pressed F5 so many times I got a blister...lol

(2014-06-27, 14:10)MassIV Wrote: I haven't used this addon, but if it does not have a way to clear them all you can gather everything you want clear in one include and add the include to the item.

Includes.xml
Code:
<include name="ClearAllArtistEvents">
    <onclick>ClearProperty(ArtistEvents.1.Artists,Home)</onclick>
    <onclick>ClearProperty(ArtistEvents.1.Date,Home)</onclick>
    <onclick>ClearProperty(ArtistEvents.1.City,Home)</onclick>
    <onclick>ClearProperty(ArtistEvents.1.Name,Home)</onclick>
    <onclick>ClearProperty(ArtistEvents.1.Description,Home)</onclick>
</include>

In your items:
Code:
<item id="1">
<include>ClearAllArtistEvents</include>
</item>

I did this and it does work. However, wouldn't that be skin specific? wouldn't anyone who would want to use the addon have to edit their includes file and add my script_includes.xml to it? or am I not understanding how the includes file works. Can you put an include file in an addon directory and if xbmc don't find the includes file in the skin directory it will look in the addon directory? sort of how the script-XBMC_Lyrics-main.xml works. Gosh, there has to be an easier way to accomplish something as simple as clearing all lines in a list, I'm just not finding it... Yet.

[EDIT] Nevermind about the includes file bit... I brain-farted on that...I could just xbmcexecute the commands in the addons py code and ditch the includes file all together.

[EDIT2] I resolved my issue by adding...
Quote:xbmc.executebuiltin('ClearProperty(ArtistEvents.1.Artists,Home)')...
for the first six lines of the list (since only 5 lines are shown without scrolling) in the addons py files. So I actually only had to add 36 lines of code to the py file.
I will soon learn enough about python to figure out how to iterate through and do it with just a couple of lines of code.
Just want to say thanks MassIV for helping me out... your time is much appreciated.
Reply
#8
Yes it would be skin specific with includes.
Ah, i did not realize you were also making the addon. I assumed you were modding a skin.
In that case you can also provide whatever skin setting you need for triggering the animation.
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply
#9
(2014-06-27, 18:19)MassIV Wrote: Yes it would be skin specific with includes.
Ah, i did not realize you were also making the addon. I assumed you were modding a skin.

see EDIT2 in my previous post... thanks bro for your help!
Reply
#10
Tongue 
(2014-06-27, 15:53)woodside Wrote: I resolved my issue by adding...
Quote:xbmc.executebuiltin('ClearProperty(ArtistEvents.1.Artists,Home)')...
for the first six lines of the list (since only 5 lines are shown without scrolling) in the addons py files. So I actually only had to add 36 lines of code to the py file.
I will soon learn enough about python to figure out how to iterate through and do it with just a couple of lines of code.
Just want to say thanks MassIV for helping me out... your time is much appreciated.
"%d", "for" and "count" are my friends. Managed to do it in 6 lines of code Big Grin
PHP Code:
for count in range50 ):
            
xbmc.executebuiltin('ClearProperty(ArtistEvents.%d.Artists,Home)' % ( count ) )
            
xbmc.executebuiltin('ClearProperty(ArtistEvents.%d.Date,Home)' % ( count ) )
            
xbmc.executebuiltin('ClearProperty(ArtistEvents.%d.City,Home)' % ( count ) )
            
xbmc.executebuiltin('ClearProperty(ArtistEvents.%d.Name,Home)' % ( count ) )
            
xbmc.executebuiltin('ClearProperty(ArtistEvents.%d.Description,Home)' % ( count ) ) 
Reply

Logout Mark Read Team Forum Stats Members Help
Help with List Updating0