SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-11-2011, 11:19 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Refresh an Atrribute widget in another menu

Hey guys got an attibute widget that is part of a theme referenced in my menu. The attirbute widget looks like this.

Code:
Name[=If(Name==null,false,Name)]
It all works fine and well on initial load but I can't for the life of me get the variable changed in a refresh or refresharea call.

Any ideas?
Reply With Quote
  #2  
Old 02-11-2011, 12:11 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
I can never get attributes to change as a result of a refresh or refresharea either. I usually make sure the attribute is updated in the widget chain someplace rather than rely on haviing it re-initialized. Hopefully somebody else will come up with a better answer.
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #3  
Old 02-11-2011, 12:17 PM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Have you tried a RefreshAreaForVariable()...... can't remember if that does it or not now tho.
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
  #4  
Old 02-11-2011, 12:28 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Refresh just redraws the screen; it doesn't reload the menu. Only blue UI widgets are subject to refresh.

An Attribute's initialization expression get evaluated just once, when the menu is loaded. This is really no different in principle than a member variable in a Java class, which gets initialized just once, when the class is instantiated. If you want to change its value after that, you must execute an assignment statement. That's how variables work.

RefreshAreaForVariable has nothing to do with this. That's for refreshing one instance of a repeating element such as a table cell, where the instances might all have the same widget name, but can be distinguished by different attribute values.
__________________
-- Greg
Reply With Quote
  #5  
Old 02-11-2011, 12:52 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by GKusnick View Post
Refresh just redraws the screen; it doesn't reload the menu. Only blue UI widgets are subject to refresh.

An Attribute's initialization expression get evaluated just once, when the menu is loaded. This is really no different in principle than a member variable in a Java class, which gets initialized just once, when the class is instantiated. If you want to change its value after that, you must execute an assignment statement. That's how variables work.

RefreshAreaForVariable has nothing to do with this. That's for refreshing one instance of a repeating element such as a table cell, where the instances might all have the same widget name, but can be distinguished by different attribute values.
Yeah that is what I thought Going to have to figure out another way
Reply With Quote
  #6  
Old 02-11-2011, 03:04 PM
JREkiwi's Avatar
JREkiwi JREkiwi is offline
Sage Icon
 
Join Date: Jan 2005
Location: Auckland, New Zealand
Posts: 2,132
Not sure if it will help, but a long time ago I had a similar problem and Opus pointed me at using a BeforeMenuLoad hook, StaticContexts and reloading the menu to get the menu to refresh and not use a cached version. His example is here and that method is still used in the default STV for setting number of rows and columns in views.

John
Reply With Quote
  #7  
Old 02-11-2011, 03:31 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Quote:
Originally Posted by JREkiwi View Post
Not sure if it will help, but a long time ago I had a similar problem and Opus pointed me at using a BeforeMenuLoad hook, StaticContexts and reloading the menu to get the menu to refresh and not use a cached version. His example is here and that method is still used in the default STV for setting number of rows and columns in views.
Actually, I don't think there is any menu where I do that any more -- I used to do it because you couldn't dynamically change the number of rows & columns for tables, so I had to reload a menu to do so; but tables can be dynamically changed now.

The attribute in the first post just looks like it is set to remember its cached previous value, or false if there is no previous value. Unless there is some reason you can't do so in this case, I would consider just setting it in the UI chain. If it is too complex for a UI chain, set it before calling refresh or even use a LayoutStarted hook, among other possibilities.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #8  
Old 02-11-2011, 06:36 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by Opus4 View Post
Actually, I don't think there is any menu where I do that any more -- I used to do it because you couldn't dynamically change the number of rows & columns for tables, so I had to reload a menu to do so; but tables can be dynamically changed now.

The attribute in the first post just looks like it is set to remember its cached previous value, or false if there is no previous value. Unless there is some reason you can't do so in this case, I would consider just setting it in the UI chain. If it is too complex for a UI chain, set it before calling refresh or even use a LayoutStarted hook, among other possibilities.

- Andy
Unfortunately this is the attribute widget for a table FreeformCellSize. My understanding it has to be an attribute directly below the table widget. I never thought off adding a static context before reloading the menu that should do it.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use Video Widget cracklepopflash SageTV Studio 5 08-21-2009 03:24 PM
Weather Widget sam.griffin.bht SageTV Studio 3 06-09-2009 11:30 AM
Scaling Text widget size within image widget area Morgan111 SageTV Studio 2 12-04-2006 02:16 PM
Where can I find the menu title theme (Main Menu, Program Guide, Setup Menu, etc) mkanet SageTV Studio 5 11-11-2005 04:55 AM


All times are GMT -6. The time now is 06:04 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.