extjs - How do I Reload Ajax Call Parameters without Reloading the webpage -
I am working with Extenses 2.2.1 with Alfresco 3.2 Enterprise.
I would like to update that which handles authentication for Alfresco server on loaded components during login ticket that ends after a set time and this is why I update the ticket Will happen.
Options that do not appear to be viable for me (but please tell me what is wrong with me):
-
Rebuild the components to reload the call parameters Load - I can not do this because the user that was first working on it is reset (such as tree panels are reloaded, grid filter reset, etc.). The actual webpage never reloads because everything uses AJAX calls to update things on the page.
-
Create a global variable that stores a ticket and engages it with any AJAX calls as a call parameter - any components loaded during login Still will use the original ticket to call the server.
try something like this
Ext.onReady (function () {var token = new Ext.util.MixedCollection (); token.add ('id', 'THE_TOKEN_ID'); Ext.ComponentMgr.register ('token', token);} ); Attach Event Listener to Composite Collection
which updates any component that focuses on the token.
// Now all you need is var token for event listeners = Ext.getCmp ('token'); Var component = Ext.getCmp ('some_component_that_needs_ajax'); Token.one ('substituted', function (key, value, original) {if (key == 'id') {component.params.token_id = value; // update new value}});
Whenever the token needs to be updated,
var token = Ext.getCmp ('token'); Token Location ('id', 'THE_NEW_TOKEN_ID');
What's going on here:
- You create
mixed compilation
to keep information about your token. Update
token mixed code
for any new token for the listener needs to be updated is. - When you receive a new token ID,
mixed selection to update the id
key with the new token ID. Change location
. -
Replace
handler will fire, and listeners who update all dependent components.
Comments
Post a Comment