com.ibm.mashups.enabler.model.state
Interface NavigationStateModel


public NavigationStateModel

Interface for a Navigation state model.
Navigation State API does not garantee that any modifications issued on the API have any further impact on the
user experience of any widgets or components on the page. Widgets or components may choose to listen to changes on the Navigation
State Model and react properly upon those changes. However any user experience change cuased by those components are not part of
the contract of this API and therefore these UI behaviour may change going forward
AccessorFactory API should be used to read/write navigation state within NavigationStateModel.
var navStateModel=com.ibm.mashups.enabler.model.state.NavigationStateModelFactory.getNavigationStateModel();
var widgetAccessor = com.ibm.mashups.enabler.model.state.AccessorFactory.getWidgetAccessor(navStateModel);
widgetAccessor.setSize("200","300");
var deferred = navStateModel.commit();
deferred.setFinishedCallback(cb);
deferred.start();


Field Summary
 String ONNAVSTATEUPDATED
           The name of the event to handle to get NavState update notifications.
 
Method Summary
 void startTransaction()
           This method starts a global transaction for a NavigationStateModel object
 void commitTransaction()
           This method commits all changes done withing a global transaction for a NavigationStateModel object
 void discardTransaction()
           This method discards all changes done within a transaction for a NavigationStateModel object and restores the original NavigationStateModel object.
 boolean isTransaction()
           This method starts a global transaction for a NavigationStateModel object
 DeferredOperation commit(Object additionalParams)
           Commits the modifications applied to this model and all dependent models.
 void discard()
           Discards the modifications applied to this model.
 void dispose()
           Dispose this model completely all the navigation state will be destroyed.
 

Field Detail

ONNAVSTATEUPDATED

String ONNAVSTATEUPDATED
The name of the event to handle to get NavState update notifications.

Method Detail

startTransaction

void startTransaction()
This method starts a global transaction for a NavigationStateModel object


commitTransaction

void commitTransaction()
This method commits all changes done withing a global transaction for a NavigationStateModel object


discardTransaction

void discardTransaction()
This method discards all changes done within a transaction for a NavigationStateModel object and restores the original NavigationStateModel object.


isTransaction

boolean isTransaction()
This method starts a global transaction for a NavigationStateModel object

Returns:
Returns true if a transaction has been started, false otherwise.

commit

DeferredOperation commit(Object additionalParams)
Commits the modifications applied to this model and all dependent models.

Parameters:
additionalParams - Optional JSON object to control various aspects while commiting
  addToHistory (Boolean) - true if the state should be added to the browser history, false otherwise
  allowRedirect (Boolean) - true if the page should be refreshed after the commit, false otherwise. Note, this parameter is ignored if the commit is synchronous
Returns:
a deferred object used to start this operation. The return value when executed through the deferred object is null

discard

void discard()
Discards the modifications applied to this model.


dispose

void dispose()
Dispose this model completely all the navigation state will be destroyed.



Copyright IBM Corp. 2010 All Rights Reserved.