我有以下代码:
<h:form id="facebookForm">
<p:button value="Facebook Connect" href="#{loginPageCode.facebookUrlAuth}">
<p:ajax event="click" listener="#{loginPageCode.getUserFromSession}" update="growl confirmDialog" ></p:ajax>
</p:button>
<p:confirmDialog id="confirmDialog" message="Welcome"
header="Welcome to our website!" severity="alert" widgetVar="confirmation">
<h:panelGrid columns="1" cellpadding="10">
<h:outputText id="msg" value="Salutation : #{user.salutation}" />
<h:outputText id="msg1" value="Name and surname: #{user.name} #{user.surname}" />
<h:outputText id="msg2" value="Birthday : #{user.birthDate}" />
<h:outputText id="msg3" value="Email : #{user.email}" />
<h:outputText id="msg4" value="Postal code : #{user.postalCode}" />
<h:outputText id="msg5" value="Phone nr : #{user.phoneNumber}" />
</h:panelGrid>
<p:commandButton id="confirmation" value="Ok" onclick="confirmation.hide()" type="button" />
</p:confirmDialog>
<p:growl id="growl" life="3000" showDetail="true" />
</h:form>
我正在尝试通过自定义从我的网页连接到facebookservlet
,该自定义处理有关验证、解析响应等的所有内容。href
上面的表单包含指向 facebook 身份验证的 url,最终将所有内容重定向到当前页面,其中是index.xhtml
。
我想要做的是在一切完成后调用一个方法,比如onComplete
来自组件的属性<p:commandButton>
,因为我想显示一个带有更新的托管 bean 的对话框<p:confirmDialog>
,并欢迎。所以我需要首先转到第一个URL,等到身份验证完成,然后调用这个方法#{loginPageCode.getUserFromSession}
,通过从 facebook http 响应解析 JSON,动态更新托管 bean,然后打开包含更新值的对话框。
我也尝试过使用<p:commandButton>
withtype="button"
来使用action
//能力actionListener
,update
但不成功。你能给些建议么?谢谢你。