如何刷新JSF中的模糊事件后的组件

问题描述:

我正在使用gmaps4jsf在我的应用程序中显示Google地图,但我想在用户键入他/她的延伸,城市,州和国家后更新地图。这样我可以动态地给gmaps4jsf提供更准确的信息。如何刷新JSF中的模糊事件后的组件

但是我每次填充一些字段时,地图就消失了。我与state这样做,例如:

State:<h:message id="m_state" for="state" styleClass="red" /><br/> 
<h:selectOneMenu id="state" value="#{propertyC.property.addressState.state}"> 
    <f:selectItem itemLabel="" itemValue="" /> 
    <f:selectItems value="#{addressB.states('US')}" var="state" itemValue="#{state.key}" itemLabel="#{state.value}" /> 
    <f:ajax event="blur" render="m_state map" /> 
</h:selectOneMenu> 
<br/> 

// others fields  

<m:map id="map" width="425px" height="250px" address="#{propertyC.property.street}, #{propertyC.property.addressCity.city}, #{propertyC.property.addressState.state}, #{propertyC.property.addressCountry.country}, #{propertyC.property.cep}" zoom="25" autoReshape="true" > 
    <m:marker> 
     <m:icon imageURL="http://i.imgur.com/WFJo62Q.png"/> 
    </m:marker> 
</m:map> 

我怎样才能显示在地图动态为用户键入他/她的地址是什么?

+0

哪您使用的是GMaps4JSF版本吗? – 2013-04-29 13:48:32

+0

@AlexandreLavoie,最后一个版本3. – 2013-04-29 21:49:07

+1

昨天我试了一下你的例子,同样的问题,我会在1.1.4这个晚上试试我的旧项目,很快回来! – 2013-04-30 00:12:51

是的,为了使用Ajax动态地更改地图内容,您需要将partiallyTriggered属性设置为true。

检查使用GMaps4JSF 3.0.0看到如何可以使用Ajax更新地图内容的JSF混搭混音演示:
http://www.mashups4jsf.com/gmaps4jsf-examples2-3.0.0/pages/theater2.xhtml

这也是演示源代码:
http://www.mashups4jsf.com/gmaps4jsf-examples2-3.0.0/pages/theater2.xhtml.source

+0

完美!有用! – 2013-05-07 23:50:16

尝试设置以下属性:partiallyTriggered="true"。 这将允许部分渲染,特别是如果您使用jaxfied数据提交。