Solved Q/Help needed: visible conditions / (Widget)Container Refresh - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12) +--- Thread: Solved Q/Help needed: visible conditions / (Widget)Container Refresh (/showthread.php?tid=348712) |
Q/Help needed: visible conditions / (Widget)Container Refresh - mardukL - 2019-10-25 Hi. In my Example i want to fill and refresh a panel container (id=5001) based on the input of an edit control (id="100002") Which works pretty well, but once my the panel container is empty, it cant refresh due to my visible condition
The simplest solution will be to get rid of the visible condition, BUT I DONT WANT AN EMPTY AREA USING SPACE So that leads me to try the following: issues : - once numitems=0, no more refresh/visible till reload due to visible condition - if i add static item container seems to get numitems issue ?? (sorry i cant descripe better) 2 items flickering around - HELP NEED FIND CORRECT VISIBLE CONDITION test to resolve - add to content path : &reload=$INFO[Window(home).Property(EmbuaryWidgetUpdate)] - no succes - removed vis condition (container) - ok, but group always visible unwished - added a static item as content - ok, but jumps around due to visible cond : !Integer.IsGreater(Container(5001).NumItems,1) | Container(5001).IsUpdating or Integer.IsLess(Container(5001).NumItems,2) | Container(5001).IsUpdating ( + if static item is placed as second 'content' tag , container still focus static item first onfocus ) Code:
Video Describe/Show Off EDIT: also tried refresh via button and different actions, without succes Container(5001).Refresh , Container.Refresh(5001) , Container.Refresh Container(5001).Update , Container.Update (5001) , Container.Update RE: Q/Help needed: visible conditions / (Widget)Container Refresh - jurialmunkey - 2019-10-25 What is control 100002? Is it a button? How is its label set? To refresh the container, use a window property in your visible condition: Code: <visible>Integer.IsGreater(Container(5001).NumItems,0) | Container(5001).IsUpdating | !String.IsEmpty(Window(Home).Property(Refresh5001))</visible> If control 1000002 is a button, you can set the property momentarily and then turn it off again onfocus/onclick etc. to make the container visible again when you update its content path. Code:
The problem with your original visibility condition is that once Container(5001).NumItems is 0 then the container never becomes visible again and so it never updates (it needs to be visible to update). Using the window property allows you to temporarily force it to be visible and thus update. Once it starts updating the Container.IsUpdating condition becomes true so the property no longer needs to be set. RE: Q/Help needed: visible conditions / (Widget)Container Refresh - mardukL - 2019-10-25 (2019-10-25, 13:56)jurialmunkey Wrote: What is control 100002? Is it a button? How is its label set? Thanks. Its an edit control. which should also be able to have onfocus/onunfocus/ondown actions. i am afk now,but will try soon your method soon To the flicker...
Quote:The problem with your original visibility condition is that once Container(5001).NumItems is 0 then the container never becomes visible again and so it never updates Thats the reason why i try a workaround with an static item. I would deal with that, but the issue there is the flicker. May you got an idea about the flicker issue? e.g. panel 5001 stays as long it isnt empty !Container(5001).NumItems(0) to have it never empty i put static content item (id=999), only visible on !Integer.IsGreater(Container(5001). NumItems,1) i assumed this will respect just the static item itself , but as soon i also get 1 result in the second content tag booth items are visible and flickering/flip araound.
Thanks for taking a look RE: Q/Help needed: visible conditions / (Widget)Container Refresh - mardukL - 2019-10-25 @jurialmunkey I did the test now, onfocus on an 'edit control type' doesnt seems to work. thats not an issue, as i can have an 'hidden' button as overlay. the big issue there is more that i will need a chain reaction to imitate the onclick/force refresh action (e.g. set skin string) to recognize that content will be refreshed. , which seems pretty complicatited. Because container refreshes on 'input' or 'dialogkeyboard output' of the edit control ( $INFO[Control.GetLabel(100002).index(1)] ) not 'onclick' like a button So i need to compare strings in a loop,to recognize that content will be refreshed. unsure if possible and if it'll be an good idea. To set Property used as label to return $INFO[Control.GetLabel(100002).index(1)] after change e.g.
.... But i really like to keep 'edit control type', as it's offer pretty nice search in comparison 'button control type' method. Hopefully the solution to resolve flicker is a thing. kind regards Q/Help needed: visible conditions / (Widget)Container Refresh - jurialmunkey - 2019-10-25 In that case, have you tried <onunload> from DialogKeyboard? Other option is to set property by using a hidden button on focus which also then sets focus to edit control. Then have conditions onleft/onup/onback etc in the edit control to clear the property when you move back off the edit control. RE: Q/Help needed: visible conditions / (Widget)Container Refresh - mardukL - 2019-10-26 Yeehaaa ! Finally got a correct/working condition. This way i dont have to deal with set/clear propertys, can circumstance the 'flicker' issue if using static item as content + THE IMPORTANT OF AT ALL use edit control for search engine. Strangely i can use String.IsEmpty(Container(5004).ListitemNoWrap(0).Album) + String.IsEmpty(Container(5004).ListitemNoWrap(1).Album) as visible condition for the static item (while others was failing, and i dont want to deal with animations) need slide anmiation if = String.IsEmpty(Container(5001).ListitemNoWrap(1).Artist) + Integer.IsEqual(Container(5001).NumItems,2) !Control.HasFocus(5001) + String.IsEmpty(Container(5001).ListitemNoWrap(1).Artist) wrong syntax !String.Contains(Container(5001).ListitemNoWrap(1).Control.GetLabel(100002).index(1)) wrong syntax !String.StartsWith(Container(5001).ListitemNoWrap(1).Control.GetLabel(100002).index(1)) flicker !Integer.IsGreater(Container(5001).NumItems,1) --> flicker String.IsEmpty(Container(5001).ListItemPosition(1).Artist) flicker String.IsEmpty(Container(5001).ListItemAbsolute(1).Artist) e.g. for artists <content>
So, at @jurialmunkey , First Thanks, for taking time and answering me, even if i try now another method. I thank you for the help. AND may this could be also interesting for you. The benefit of the edit control type is that it can be used to fill content dynamicaly and is more comfortable than the 'setkinstring' via button method. So, even if you miss keyboard (e.g. most remotes ) you can click the edit to define what you wanna search, - no need to set/clear skinstrings - just return Control.GetLabel(id).index(1) Working Now https://streamable.com/6z9kw |