如何让UiBinder通过标签而不绑定XFBML呢? [英] How do you let UiBinder pass tags without binding them so XFBML works?

查看:117
本文介绍了如何让UiBinder通过标签而不绑定XFBML呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序设计使用GWT和UiBinder。现在我们正在尝试通过Facebook设置登录。我已经包含脚本来初始化我应用程序的HTML中的fb javascript,我正在尝试获取一个Facebook登录按钮。



Login.ui.xml包含一个Facebook登录标签:

 < ui:UiBinder 
xmlns:ui ='urn:ui:com.google .gwt.uibinder'
xmlns:g =urn:import:com.google.gwt.user.client.ui>
< g:HTMLPanel addStyleNames =login>
< h2>登录使用您的帐户< / h2>
< g:TextBox ui:field =username/>
< g:PasswordTextBox ui:field =password/>
< g:Button ui:field =loginButton>登录< / g:Button>
< fb:login-button />
< / g:HTMLPanel>
< / ui:UiBinder>

UiBinder不会允许将其作为HTML传递,因为它试图将其绑定到某个东西。我不知道如何告诉UiBinder忽略这个标签,并让它通过未骚扰。



我如何可以a)允许fb:login-按钮被忽略,或b)定义允许定义非GWT标签的xmlns:fb标签?

解决方案

就像添加xmlns一样简单:fb =http://www.facebook.com/2008/fbml。它在IntelliJ的编辑器中显示为错误,但编译并包含该标签。


I have an application designed that's using GWT and UiBinder. Now we're trying to setup a login through facebook. I've included the script to init the fb javascript in my application's HTML, and I'm trying to get a facebook login button.

The Login.ui.xml contains a facebook login tag:

<ui:UiBinder
        xmlns:ui='urn:ui:com.google.gwt.uibinder'
        xmlns:g="urn:import:com.google.gwt.user.client.ui" >
    <g:HTMLPanel addStyleNames="login">
        <h2>Login Using Your Account</h2>
        <g:TextBox ui:field="username"/>
        <g:PasswordTextBox ui:field="password"/>
        <g:Button ui:field="loginButton">Login</g:Button>
        <fb:login-button/>
    </g:HTMLPanel>
</ui:UiBinder>

UiBinder won't allow this to be passed through as HTML because it's trying to bind it to something. I'm not sure how to tell UiBinder to ignore this tag, and let it pass through un-molested.

How can I either a) Allow the fb:login-button be ignored, or b) define an xmlns:fb tag that allow the definition of a non-GWT tag?

解决方案

Turns out it was as easy as adding xmlns:fb="http://www.facebook.com/2008/fbml". It shows up as an error in the editor for IntelliJ, but compiles and includes the tag.

这篇关于如何让UiBinder通过标签而不绑定XFBML呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆