Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Original thread:
Post 2 made on Tuesday March 17, 2009 at 17:40
Barry Gordon
Founding Member
Joined:
Posts:
August 2001
2,157
Your problem might be the fact that the script is on the hard key which is an activity level item. Since it is at the activity level I do not believe it can see things on pages. That is quite different than a soft key on a page calling a function at the activity level where that function is then running in the namespace of the page that called it.

The CF.page().tag is properly set, but the contents of that page are not in the namespace of the volume hard-key for the reason stated above. Hence the widget("volbarpanel",CF.page.tag())... can not be referenced.

The CF qualifier refers to the Configuration file which is static so that is not what you want unless you are trying to use it as a source as in var a=CF.widget(wtag,ptag).label.

In my work I always have all the code running in the context of a page's name space, the active pages namespace that is. I do this by putting all my code at the activity level and a page merely invokes code at the activity level. This code invoked by the page is a finite state machine (FSM). All soft-keys (page buttons) and Hard keys (real keys) make entries in a single queue which is flushed whenever a page starts. The queue is checked during the finite state machines execution and based upon whet the queue entry might say (e.g. "Volume,"Up") I perform a function which is defined at the activity level but since it is called from the FSM which is called cyclically by the active page it is then running in the context of the active pages namespace so it sees every widget on that page.

As a simpler solution you might try setting a variable defined at the activity level to be equal to the volbarpanel widget of the current page as part of each page's start up code. It would be the same line of code on each page. In that manner the activity level reference which can be seen in the volume Hard key code should be correct. This in effect gives you a pointer to the widget but the pointer is defined at the activity level where it needs to be.


Hope the above explains it.

Last edited by Barry Gordon on March 17, 2009 21:18.


Hosting Services by ipHouse