2013-12-09 31 views
0

我正在使用JSF,并在Google Chrome中向我的index.html添加连接按钮时,如下所示;QuickBooks在线API - 添加连接按钮

<html xmlns="http://www.w3.org/1999/xhtml" 
xmlns:ipp="" 
xmlns:ui="http://java.sun.com/jsf/facelets"  
xmlns:h="http://java.sun.com/jsf/html"  
xmlns:f="http://java.sun.com/jsf/core"  
xmlns:p="http://primefaces.org/ui"> 

<f:view> 
<h:head>  
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>  
<script type="text/javascript" 
    src="https://appcenter.intuit.com/Content/IA/intuit.ipp.anywhere.js"> 


    intuit.ipp.anywhere.setup({ 
     menuProxy: 'http://com.example/dispatch/BlueDotMenu', 
     grantUrl: 'http://com.example/dispatch/RequestOAuthToken'  }); 

    </script> </h:head> 

</f:view> 
</html> 

我得到follwoing错误;

属性“xmlns:ipp”的值无效。前缀名称空间绑定可能不为空。

是否有我可以使用的命名空间值?

回答

1

我在这里有一个JSF的解决方法。为我工作。

您需要重写QBO为按钮和菜单功能提供的JavaScript文件。 您可以download it from here

如果你已经实现了所有的OAuth和东西,那么你只需要添加没有'ipp'前缀的标签。只需像这样插入:

<connectToIntuit></connectToIntuit> 
<blueDot></blueDot> 

不需要命名空间。 JSF会忽略未知标记,并且JS有能力将html和事件插入到它中。

我已经下载了easyUI JS以及from here。插入你已经下载的JS-es:

<script type="text/javascript" src="#{request.contextPath}/js/jquery/easyui/jquery.easyui.min.js"></script> 
<script type="text/javascript" src="#{request.contextPath}/js/intuit.ipp.anywhere.js"></script> 

需要插入不小于1.4.4的jQuery版本。

剩下的最后一件事是 '设置' 呼叫JS-功能:

<script> 
intuit.ipp.anywhere.setup({ 
    menuProxy: '#{request.scheme}://#{request.serverName}#{request.contextPath}/qb_blueDotMenu.jsf', 
    grantUrl: '#{request.scheme}://#{request.serverName}#{request.contextPath}/qb_requestToken.jsf' 
    }); 
</script> 

其中qb_blueDotMenu.jsf - 是呈现BlueDotMenu和 qb_requestToken.jsf servlet的 - 是RequestTokenServlet获取OAuth请求令牌,如在QuickBooks示例应用程序中显示。

让我知道你是否有问题。

+0

它的工作connectToIntuit按钮!非常感谢。 – user3083346

0

这可能是晚了,但我有同样的问题,并通过显示IPP解决它:用

<h:outputText value="#{bean.ippConnect}" escape="false" />