English 中文(简体)
JSF JSF 富有面孔再向事件改变 内容丰富:数据Grid结构
原标题:JSF RichFaces reRender event changes rich:dataGrid structure

我在找一个提示 如何处理一个奇怪的影响 重新生成数据格。 我有以下的网格结构 :

<rich:dataGrid id="allProductsGrid" value="#{allProducts}" var="_product">                       
     <s:div styleClass="grid-element">
         <s:link view="/product.xhtml">
             <s:div styleClass="product-element">                                                                                                           
                 <h:graphicImage value="/content/images?id=#{_product.image.id}&amp;width=170"/>                                                                                                                                                                                                                                        
             </s:div>                           
             <div id="title">
                 <h:outputText value="#{_product.name}" />
             </div>
             <f:param name="productId" value="#{_product.id}" />
        </s:link>                                                                
     </s:div>
 </rich:dataGrid>

网格被一个搜索输入字段发射的上键- 活动重新激活。 目前为止没有魔法。 现在的问题是, 重新输入会改变所生产的 html (DOM) 的结构。 因此, 链接不再有效 。

页面首页首页的火虫- html- 外观如下:

 <div id="j_id86:allProductsGrid:0:j_id124" class="grid-element">
    <a id=".. " onclick=".." href="/portal/product.vc?productId=22&cid=69">
        <div id="j_id86:allProductsGrid:0:j_id126" class="product-element">
            <img src="/portal/content/images?id=&width=170">
        </div>
        <div id="title">Sample Product</div>
    </a>
</div>

在重新提出网格后, html 输出为 :

<div id="j_id86:allProductsGrid:0:j_id124" class="grid-element">
    <a id=".." onclick=".." href="/portal/product.vc?productId=22&cid=76"></a>
    <div id="j_id86:allProductsGrid:0:j_id126" class="product-element">
        <img src="/portal/content/images?id=&width=170">
    </div>
    <div id="title">Sample Product</div>
</div>

The result is that the a-tag is not wrapping the product-element anymore. Can anybody give me a hint on what might be wrong here?? Any help appreciated. Thanks in advance.

约约约

ps:使用缝合2.2.2/JSF Mojarra2.0.3/Richfaces 3.3.3。

问题回答

确保您的 allProductions bean 拥有视图范围而不是请求范围。 所以在重新发送数据时, 数据将持续到调用中 。





相关问题
WPF: Adding Button Column to Datagrid

How can I add a Button column to a Datagrid programmatically? I want to do this through code in the code-behind file. Also i want to selectively enable or disable this button based on record (If ...

Silverlight Datagrid RowEditEnded

I have a SL DataGrid that has two columns. I need to be able to catch any change to the a row and save it into an undo stack. I setup the event RowEditEnded and tried to add to the undo stack there. ...

WPF Keep column sorting with Datagrid

I have several datagrid where I need to update the informations. Things is, since more than one person works on the system at the same time, the datagrid need to be refreshed on a regular basis. When ...

热门标签