【问题标题】:How can I retrieve data page results in Javascript?如何在 Javascript 中检索数据页结果?
【发布时间】:2019-07-13 18:23:44
【问题描述】:

我正在使用 Here Maps Javascript API 实现自定义 html 规则。我将坐标存储在数据类型中。 (大约 30000 行)我需要获取每一行并在 html 中绘制一条折线。如何在 html 规则中获取数据页结果?

由于我使用自定义服务并需要显示自定义部分,因此我需要在非自动生成的 html 规则上实现它并使用 Javascript。实际上,当我静态设置 Javascript variabşe 中的值时,我实现了我的目标。 (Pega 显示使用 Javascript API 生成的自定义地图部分没有问题)但是我必须动态地从数据页面获取坐标。因为它在生产中是动态的。

【问题讨论】:

    标签: pega


    【解决方案1】:

    检查<pega:forEach name="YourPageListPage.PageList">标签。

    我曾经用它在 HTML 中为 Pagelist 类型的属性创建表格。

    下面的例子可能会给你一个方向。

    示例:

    <table border="1">    
    <pega:forEach name="YourPageListPage.PageList"> // YourPageListPage.PageList is Page in which you have 3000 rows
    
        <tr>    
           <TD>
             <pega:reference name="$THIS.COLUMN1"/> // --> COLUMN1 is the property name inside pagelist
          </TD>
          <TD>
             <pega:reference name="$THIS.COLUMN2"/> // -->  COLUMN2 is the property name inside pagelist
          </TD>
              </tr>
            </pega:forEach>
        </table>
    

    在 JavaScript 中读取任何剪贴板页面的另一种方法..

    <%
    ClipboardPage dataPage= tools.findPage("D_DatapageName");// if tools keyword is unrecognized then add PublicAPI tools = ThreadContainer.get().getPublicAPI(); above this line.
    //D_DatapageName --> your data page name. You can give any Clipbord page here
    ClipboardProperty pageListProperty=  dataPage.getProperty("PageListProperty"); 
    // PageListProperty will be list property in your DataPage..for example pxResults in case if DataPage is of class Code-Pega-List
    
    //now if you want to iterate on this pageListProperty then use below method
    Iterator iterator = pageListProperty.iterator();
    // For eg. iterate over pxResults 
    while(iterator.hasNext()){
        ClipboardProperty pageProperty= (ClipboardProperty)iterator.next();
     // PageProperty can be of type Page or just a single property
     // But we need only the pages, so add below condition
        if(pageProperty.getMode()==ImmutablePropertyInfo.MODE_PAGE){
             Iterator iterator2 = pageProperty.iterator();
         // Iterate on all properties of single page (pxResults(1))
             while(iterator2.hasNext()){
                 ClipboardProperty property= (ClipboardProperty)iterator2.next();
                 String propertyLabel = property.getName(); // this will return the name of the property. For example pyNote
    
                 String propertyValue = property.getStringValue(); // this will return the value inside property. 
              }    
    
    
         }
    
    }
    
    %>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-03-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-13
      • 1970-01-01
      • 2015-07-12
      • 1970-01-01
      相关资源
      最近更新 更多