Skip to content
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

Error when trying out GWT&Polymer example #162

Open
chcklngm opened this issue May 19, 2020 · 1 comment
Open

Error when trying out GWT&Polymer example #162

chcklngm opened this issue May 19, 2020 · 1 comment

Comments

@chcklngm
Copy link

When going through the example in the GWTProject page, I get the following error in the step where the ripple effect is added. The UI works as expected up until that point.

Error message in Chrome DevTools (screenshot attached)
this.get_clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay_0_g$(...).style_3_g$ is not a function

Also in the screenshot is the Refused to get unsafe header "Location" error.

I am using GWT-2.8.1 with vaadin-gwt-polymer-elements-1.9.3.1.

In my app html file I have this in the head tags
`

<script src="gwtpolymer/bower_components/webcomponentsjs/webcomponents.js"></script> <script type="text/javascript" src="gwtpolymer/gwtpolymer.nocache.js"></script>

`

I am importing the webcomponents as follows
`
List alCollections = new ArrayList();
alCollections.add("iron-icons/iron-icons.html");
alCollections.add("paper-ripple/paper-ripple.html");
Polymer.importHref(alCollections,
new Function<Object, Object>() {

	@Override
	public Object call(Object arg) {
		GWT.log("import succeeded");
		startApplication();
		return null;
	}
}, 
new Function<Void, Void>() {
	@Override
	public Void call(Void arg) {
		GWT.log("import failed");
		return null;
	}
});
}

`

Main.java
`
public class Main extends Composite {

interface MainUiBinder extends UiBinder<HTMLPanel, Main> {}

private static MainUiBinder ourUiBinder = GWT.create(MainUiBinder.class);

public Main() {
	initWidget(ourUiBinder.createAndBindUi(this));
}

}`

Main.ui.xml
`
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
xmlns:g='urn:import:com.google.gwt.user.client.ui'
xmlns:p='urn:import:com.vaadin.polymer.paper.widget'
xmlns:i='urn:import:com.vaadin.polymer.iron.widget'>

    <ui:style>
      paper-icon-item {
        position: relative;
        overflow: hidden;
      }
    </ui:style>

    <g:HTMLPanel>
      <p:PaperIconItem ui:field="menuClearAll">
        <i:IronIcon icon="delete" attributes="item-icon"/>
        <div>Clear All</div>
        <p:PaperRipple/>
      </p:PaperIconItem>
      <p:PaperIconItem ui:field="menuClearDone">
        <i:IronIcon icon="clear" attributes="item-icon"/>
        <div>Clear Done</div>
        <p:PaperRipple/>
      </p:PaperIconItem>
      <p:PaperIconItem ui:field="menuSettings">
        <i:IronIcon icon="settings" attributes="item-icon"/>
        <div>Settings</div>
        <p:PaperRipple/>
      </p:PaperIconItem>
      <p:PaperIconItem ui:field="menuAbout">
        <i:IronIcon icon="help" attributes="item-icon"/>
        <div>About</div>
        <p:PaperRipple/>
      </p:PaperIconItem>
    </g:HTMLPanel>
</ui:UiBinder>

devtool
`

@chcklngm
Copy link
Author

Removing the <ui:style> section in the Main.ui.xml file fixed the problem of the page not rendering.

The 'Refused to get unsafe header "Location"' error is still there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant