New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LockInteractionEvent Umbrella Exception #314
Comments
I think we need more to go on. Could you provide the presenter and view and anything else that could reproduce this? |
ApplicationPresenter /**
* Presenter that parents other child presenters display and layout.<br>
* This presenter associates with:
* <ul>
* <li>{@link ApplicationView} - for the presenters display view.</li>
* </ul>
* @author Ben Dol
*
*/
public class ApplicationPresenter extends RichPresenter<ApplicationPresenter.MyView,
ApplicationPresenter.MyProxy> implements ViewUiHandlers, SendGlobalMessageHandler,
LoginTryHandler, LoadingIndicatorHandler, RequireWidgetHandler, AsyncCallFailHandler {
private static final Logger logger = Logger.getLogger(ApplicationPresenter.class.getName());
public interface MyView extends View, HasUiHandlers<ViewUiHandlers> {
public HTMLPanel getTitlePanel();
public HTMLPanel getTopPanel();
public HTMLPanel getMiddlePanel();
public HTMLPanel getBottomPanel();
public HTMLPanel getInfoPanel();
public HTMLPanel getNavPanel();
public HTMLPanel getLoadingPanel();
}
@ProxyCodeSplit
public interface MyProxy extends Proxy<ApplicationPresenter> {
}
@ContentSlot
public static final Type<RevealContentHandler<?>> SLOT_TITLE
= new Type<RevealContentHandler<?>>();
@ContentSlot
public static final Type<RevealContentHandler<?>> SLOT_TOP
= new Type<RevealContentHandler<?>>();
@ContentSlot
public static final Type<RevealContentHandler<?>> SLOT_MIDDLE
= new Type<RevealContentHandler<?>>();
@ContentSlot
public static final Type<RevealContentHandler<?>> SLOT_BOTTOM
= new Type<RevealContentHandler<?>>();
@ContentSlot
public static final Type<RevealContentHandler<?>> SLOT_INFO
= new Type<RevealContentHandler<?>>();
@ContentSlot
public static final Type<RevealContentHandler<?>> SLOT_NAV
= new Type<RevealContentHandler<?>>();
@ContentSlot
public static final Type<RevealContentHandler<?>> SLOT_ACTIONBAR
= new Type<RevealContentHandler<?>>();
@ContentSlot
public static final Type<RevealContentHandler<?>> SLOT_PROGRESSBAR
= new Type<RevealContentHandler<?>>();
.. snip ..
private PlaceManager placeManager;
private DispatchAsync dispatch;
@Inject
public ApplicationPresenter(final EventBus eventBus, final MyView view, final MyProxy proxy,
final PlaceManager placeManager, final DispatchAsync dispatch,
final Provider<GlobalMessagePresenterWidget> globalMessageFactory){
super(eventBus, view, proxy);
this.dispatch = dispatch;
this.placeManager = placeManager;
.. snip ..
getView().setUiHandlers(this);
}
@Override
protected void revealInParent() {
RevealRootContentEvent.fire(this, this);
}
@Override
protected void onBind() {
super.onBind();
if(Cookies.getCookie(SharedTokens.securityCookie) == null) {
dispatch.execute(new InitSecurity(), new AsyncCallback<NoResult>() {
@Override
public void onSuccess(NoResult result) {
logger.log(Level.INFO, "Successfully initialized the security cookie");
// TODO: Fix this hack (working with GWTP team to figure out what is going on)
Cookies.setCookie(SharedTokens.securityCookie, "secured");
}
@Override
public void onFailure(Throwable caught) {
logger.log(Level.WARNING, "Failed to initialized the security cookie");
}
});
}
}
@Override
protected void onUnbind() {
super.onUnbind();
}
@Override
protected void onReset() {
super.onReset();
}
@Override
protected void onReveal() {
// Add global navigation presenter
getView().addToSlot(SLOT_NAV, navigationPresenter);
}
.. snip ..
/**
* Event callback for {@link LoadingIndicatorEvent}.<br>
* Displays or hides the applications page load indicator.
*/
@ProxyEvent
@Override
public void onLoadingIndicator(LoadingIndicatorEvent event) {
if(event.isLoading()) {
getView().getLoadingPanel().setVisible(true);
LockInteractionEvent.fire(ApplicationPresenter.this, true);
}
else {
getView().getLoadingPanel().setVisible(false);
LockInteractionEvent.fire(ApplicationPresenter.this, false);
}
}
.. snip ..
} ApplicationView /**
* Application page view associated with {@link ApplicationPresenter}
* <br>Display design documentation:
* <ul>
* <li>http://...</li>
* </ul>
* @author Ben Dol
*
*/
public class ApplicationView extends ViewWithUiHandlers<ApplicationView.ViewUiHandlers>
implements MyView {
private final Widget widget;
public interface Binder extends UiBinder<Widget, ApplicationView> {
}
public interface ViewUiHandlers extends UiHandlers {
}
@UiField HTMLPanel titlePanel;
@UiField HTMLPanel topPanel;
@UiField HTMLPanel middlePanel;
@UiField HTMLPanel bottomPanel;
@UiField HTMLPanel infoPanel;
@UiField HTMLPanel navPanel;
@UiField HTMLPanel loadingPanel;
@UiField HTMLPanel actionBarPanel;
@UiField HTMLPanel progressBarPanel;
@Inject
public ApplicationView(final Binder binder) {
widget = binder.createAndBindUi(this);
}
@Override
public Widget asWidget() {
return widget;
}
@Override
public void addToSlot(Object slot, IsWidget content) {
HTMLPanel panel = null;
if(slot == ApplicationPresenter.SLOT_TOP) {
panel = topPanel;
}
else if(slot == ApplicationPresenter.SLOT_MIDDLE) {
panel = middlePanel;
}
else if(slot == ApplicationPresenter.SLOT_BOTTOM) {
panel = bottomPanel;
}
else if(slot == ApplicationPresenter.SLOT_INFO) {
panel = infoPanel;
}
else if(slot == ApplicationPresenter.SLOT_NAV) {
panel = navPanel;
}
else if(slot == ApplicationPresenter.SLOT_TITLE) {
panel = titlePanel;
}
else if(slot == ApplicationPresenter.SLOT_ACTIONBAR) {
panel = actionBarPanel;
}
else if(slot == ApplicationPresenter.SLOT_PROGRESSBAR) {
panel = progressBarPanel;
}
if(panel != null) {
if(content != null) {
panel.add(content);
}
}
else {
super.addToSlot(slot, content);
}
}
@Override
public void setInSlot(Object slot, IsWidget content) {
HTMLPanel panel = null;
if(slot == ApplicationPresenter.SLOT_TOP) {
panel = topPanel;
}
else if(slot == ApplicationPresenter.SLOT_MIDDLE) {
panel = middlePanel;
}
else if(slot == ApplicationPresenter.SLOT_BOTTOM) {
panel = bottomPanel;
}
else if(slot == ApplicationPresenter.SLOT_INFO) {
panel = infoPanel;
}
else if(slot == ApplicationPresenter.SLOT_NAV) {
panel = navPanel;
}
else if(slot == ApplicationPresenter.SLOT_TITLE) {
panel = titlePanel;
}
else if(slot == ApplicationPresenter.SLOT_ACTIONBAR) {
panel = actionBarPanel;
}
else if(slot == ApplicationPresenter.SLOT_PROGRESSBAR) {
panel = progressBarPanel;
}
if(panel != null) {
panel.clear();
if(content != null) {
panel.add(content);
}
}
else {
super.setInSlot(slot, content);
}
}
@Override
public HTMLPanel getTitlePanel() {
return titlePanel;
}
@Override
public HTMLPanel getTopPanel() {
return topPanel;
}
@Override
public HTMLPanel getMiddlePanel() {
return middlePanel;
}
@Override
public HTMLPanel getBottomPanel() {
return bottomPanel;
}
@Override
public HTMLPanel getInfoPanel() {
return infoPanel;
}
@Override
public HTMLPanel getNavPanel() {
return navPanel;
}
@Override
public HTMLPanel getLoadingPanel() {
return loadingPanel;
}
} One of the places I am calling this event from is a root presenter I am using: /**
* This is a base presenter that extends {@link Presenter}.<br>
* A custom presenter which provides an extended set of 'rich' functionality.<br><br>
* Use this class when you require the following:
* <ul>
* <li>Page loading indicators onReveal and request preperation.</li>
* <li><i>Reserved for future functionality.</i></li>
* </ul>
* @author Ben Dol
*
* @param <T> Presenters view class
* @param <H> Presenters proxy class
*/
public class RichPresenter<T extends View,
H extends Proxy<?>> extends Presenter<T, H> {
@Inject
public RichPresenter(EventBus eventBus, T view, H proxy) {
super(eventBus, view, proxy);
}
@Override
protected void revealInParent() {
RevealRootContentEvent.fire(this, this);
}
@Override
public void prepareFromRequest(PlaceRequest request) {
super.prepareFromRequest(request);
// Start page load indicator
LoadingIndicatorEvent.fire(this, true);
}
@Override
protected void onReveal() {
super.onReveal();
// Stop page load indicator
LoadingIndicatorEvent.fire(this, false);
}
@Override
protected void onReset() {
super.onReset();
// Stop page load indicator
LoadingIndicatorEvent.fire(this, false);
}
} Any other uses of this Event is called before dispatch calls etc. Not sure if there's anything else I can provide for this issue as I have no idea why it is happening. All I know is that if I remove LockInteractionEvent from the LoadIncidatorEvent callback it doesn't happen. |
Do you still have this error in GWTP 1.2.1? |
No this seems to be resolved now :) |
I have an event setup called LoadingIndicatorEvent that is for controlling my applications loading displays and restrictions, one of the restrictions being the LockInterfactionEvent call.
Here is my event callback in my ApplicationPresenter that is causing the exception:
The exception:
Anyone have any idea what is going on with this? Perhaps I am missing something.
Cheers,
Ben!
The text was updated successfully, but these errors were encountered: