楼主: fangxueliang

<af:inputText>的值不能refresh

[复制链接]
论坛徽章:
0
11#
发表于 2009-12-30 08:36 | 只看该作者


好吧,让我来描述一下你的环境, 从楼上看出你使用了Taskflow,然后把Taskflow做成Region放在了一个页面中,要刷新的inputText就在这个Taskflow里面是不是?

那么在splitPanel的first facet里的<af:table>是在Taskflow/Region里的吗?还是直接在first facet里的?

从你先前的frag根本看不出你使用了Region。

在我的印象中也没有遇到过使用Region会有这样的问题。我翻翻以前做过的东西有空再看看吧。

还有,为什么outputText里你取的是binding对象#{bindings.InspDurHour},
而inputText里你取的是binding对象wrap的对象#{bindings.InspDurHour.inputValue}?

Todd

使用道具 举报

回复
论坛徽章:
2
授权会员
日期:2006-10-19 22:45:482010新春纪念徽章
日期:2010-01-04 08:33:08
12#
 楼主| 发表于 2009-12-30 10:18 | 只看该作者

回复 #11 ToddBao 的帖子

1)要刷新的inputText就在这个Taskflow里面
2)<af:table>直接在first facet里,
     <f:facet name="first">
            <afanelGroupLayout layout="vertical" halign="center" id="pgl11">
                <af:table value="#{bindings.BigInspOpsView1.collectionModel}"
                          var="row" rows="#{bindings.BigInspOpsView1.rangeSize}"
                          emptyText="#{bindings.BigInspOpsView1.viewable ? 'No data to display.' : 'Access Denied.'}"
                          fetchSize="#{bindings.BigInspOpsView1.rangeSize}"
                          rowBandingInterval="0" id="inspectionListTable"
                          autoHeightRows="10" contentDelivery="immediate"
                          displayRow="selected" width="210"
                          selectionListener="#{pageFlowScope.editInspection.inspectionSelectionListener}"
                          selectedRowKeys="#{bindings.BigInspOpsView1.collectionModel.selectedRow}"
                          disableColumnReordering="true" rowSelection="single"
                          columnSelection="none" horizontalGridVisible="false"
                          verticalGridVisible="false"
                          columnStretching="column:inspCol" immediate="true">
                    <af:column id="inspCol"
                               headerText="#{labels['pi.insp.set.input.status']}"
                               sortable="false">
                    </af:column>
                </af:table>
            </afanelGroupLayout>
        </f:facet>
3)inputText需要 #{bindings.InspDurHour.inputValue},outputText是为调试而用的,源码中无outputText

使用道具 举报

回复
论坛徽章:
0
13#
发表于 2009-12-30 13:17 | 只看该作者
我做成Region再试了一下,还是可以刷新的。
first Table:
<af:table value="#{bindings.EmployeeUVO.collectionModel}"
                          var="row" rows="#{bindings.EmployeeUVO.rangeSize}"
                          emptyText="#{bindings.EmployeeUVO.viewable ? 'No data to display.' : 'Access Denied.'}"
                          fetchSize="#{bindings.EmployeeUVO.rangeSize}"
                          rowBandingInterval="0"
                          selectedRowKeys="#{bindings.EmployeeUVO.collectionModel.selectedRow}"
                          selecti
                          rowSelection="single" id="t1">
                  <af:column sortProperty="EmployeeId" sortable="false"
                             headerText="#{bindings.EmployeeUVO.hints.EmployeeId.label}"
                             id="c2">
                    <afutputText value="#{row.EmployeeId}" id="ot3">
                      <af:convertNumber groupingUsed="false"
                                        pattern="#{bindings.EmployeeUVO.hints.EmployeeId.format}"/>
                    </afutputText>
                  </af:column>
                  <af:column sortProperty="FirstName" sortable="false"
                             headerText="#{bindings.EmployeeUVO.hints.FirstName.label}"
                             id="c3">
                    <afutputText value="#{row.FirstName}" id="ot2"/>
                  </af:column>
                  <af:column sortProperty="LastName" sortable="false"
                             headerText="#{bindings.EmployeeUVO.hints.LastName.label}"
                             id="c1">
                    <afutputText value="#{row.LastName}" id="ot1"/>
                  </af:column>
                </af:table>
Second Region:
<af:region value="#{bindings.boundedcontainsrefreshedinputtext1.regionModel}"
                           id="r1" partialTriggers="::t1"/>
Todd

Result.JPG (62.98 KB, 下载次数: 11)

Result.JPG

Result_Clicked.JPG (62.95 KB, 下载次数: 10)

Result_Clicked.JPG

使用道具 举报

回复
论坛徽章:
2
授权会员
日期:2006-10-19 22:45:482010新春纪念徽章
日期:2010-01-04 08:33:08
14#
 楼主| 发表于 2009-12-31 08:51 | 只看该作者

回复 #13 ToddBao 的帖子

兄弟,我按照你的方法,<af:region value="#{bindings.postinspectgeneralinfotaskflowdefinition1.regionModel}"
                               id="r9" />加上partialTriggers="::inspectionListTable"还是不能刷新。
我留意了一下,没看到你的selectionAction或者selectionListener,究竟他们在哪里?他们的代码是怎样?
另外,你用的是Mozilla,和我用IE 7 是不是有什么不同?因为不能自动刷新的时候,我尝试按F5键可以更新

使用道具 举报

回复
论坛徽章:
0
15#
发表于 2009-12-31 10:02 | 只看该作者
用F5的话就不是PPR了,但是从你的代码来看你要的是PPR,是不是?点了左边的行,右边的inputText刷新,没有整个页面被刷新的感觉。但是按了F5整个页面都被刷新了。

我有个问题,你region的partialTriggers属性是怎么设置的?手写的吗?我建议你用JDeveloper Property Inspector下拉菜单,然后选Edit...,在向导里选中af:table,这样partialTriggers属性就肯定不会错。如果还是不行,就尝试在你的selectionListener的代码里添加触发PPR,去触发右边Region的PPR。
如:

先配置region的binding属性,让region暴露成managed bean的属性。比如,暴露为regionBindingObject。

然后在你的selectionListener逻辑的末尾添加:
AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
      adfFacesContext.addPartialTarget(regionBindingObject);

再试一下吧。

我没有覆盖selectionListener。

Todd

使用道具 举报

回复
论坛徽章:
2
授权会员
日期:2006-10-19 22:45:482010新春纪念徽章
日期:2010-01-04 08:33:08
16#
 楼主| 发表于 2009-12-31 11:21 | 只看该作者

回复 #15 ToddBao 的帖子

我要的是PPR,你还说对了,region的partialTriggers属性是手写的,我按照你的建议用属性下拉菜单改了,但还是不行。
尝试你的第二种方法,在selectionListener的代码里添加触发PPR,但不知道如何让region暴露成managed bean的属性。比如,象你所说的暴露为regionBindingObject。
兄弟你能不能说详细一点让我再试一试?

使用道具 举报

回复
论坛徽章:
0
17#
发表于 2009-12-31 11:43 | 只看该作者
通过region的binding这个属性暴露。还是点下拉菜单,方便的呃。

Todd

使用道具 举报

回复
论坛徽章:
2
授权会员
日期:2006-10-19 22:45:482010新春纪念徽章
日期:2010-01-04 08:33:08
18#
 楼主| 发表于 2009-12-31 11:59 | 只看该作者

回复 #17 ToddBao 的帖子

我点了下拉菜单来尝试region的binding这个属性暴露,但不知道怎么选啊,能说明一下吗?

使用道具 举报

回复
论坛徽章:
0
19#
发表于 2009-12-31 13:25 | 只看该作者
选Edit...呀,然后managed bean就来了,你要选择你的selectionListener所在的那个managed bean, 添加一个新的属性。

然后就到你的selectionListener里去添加我之前给出的代码。

Todd

使用道具 举报

回复
论坛徽章:
2
授权会员
日期:2006-10-19 22:45:482010新春纪念徽章
日期:2010-01-04 08:33:08
20#
 楼主| 发表于 2010-1-1 10:26 | 只看该作者
jsff文件.rar (4.1 KB, 下载次数: 20)
  包兄弟,

   还是不能自动刷新。

   我按照你的提示,采用下拉菜单后发现源代码变成:
    binding="#{pageFlowScope.editInspection.regionBindingObject}"
  
    下面是inspectionSelectionListener的代码:

public void inspectionSelectionListener(SelectionEvent selectionEvent) {
        //fun our code and then call the framework method      
        ELUtils.invokeMethod("#{bindings.BigInspOpsView1.collectionModel.makeCurrent}",SelectionEvent.class,selectionEvent);
        String prdId =null;
        String opsId = null;
        String buildingId = null;
        RichTable table = ((RichTable) selectionEvent.getSource());
        JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding)table.getSelectedRowData();
        prdId =((BigInspOpsViewRowImpl) rowData.getRow()).getInsptnPrdIdFk().stringValue();
        opsId =((BigInspOpsViewRowImpl) rowData.getRow()).getInsptnOpsPk().stringValue();        
        buildingId = ((BigInspOpsViewRowImpl) rowData.getRow()).getBldgIdPk().stringValue();
        System.out.println("inspectionSelectionListener(): buildingId: "+ buildingId);
        System.out.println("inspectionSelectionListener(): inspectionId: " + opsId);
        System.out.println("inspectionSelectionListener(): inspectionPrdId: " + prdId);
        ELUtils.set("#{pageFlowScope.inspectionPrdId}",prdId);
        ELUtils.set("#{pageFlowScope.inspectionId}",opsId);
        ELUtils.set("#{pageFlowScope.buildingId}",buildingId);
        AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
        adfFacesContext.addPartialTarget(regionBindingObject);
    }

   为了能齐全一点,我把两个jsff文件所有全部上传,editDetails.jsff是主要画面,里面包含要刷新的文件generalInfo.jsff。

    <f:facet name="second">
                <afanelGroupLayout id="pgl6"
                         layout="vertical" halign="right"
                                     partialTriggers="inspectionListTable">
        <afanelTabbed id="pt1" inlineStyle="width:100%; height:450.0px;">
            <af:showDetailItem text="#{labels['pi.tab.general']}" id="sdi1">
                <afanelGroupLayout id="pgl8" layout="scroll">
                    <af:region value="#{bindings.postinspectgeneralinfotaskflowdefinition1.regionModel}"
                               id="r9" />
                </afanelGroupLayout>
            </af:showDetailItem>

   帮我看看,该怎么才能自动刷新?

  顺便祝新年快乐!

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表