2014-10-29 37 views

回答

0

您可以在此重复执行重复吗?

第一个重复会捕获您的第一个类别。然后里面有一个面板和一个重复,第二个重复将进一步过滤数据源的第二类

0

你作弊。有一列连接客户和项目。在选择中抓取该列并将其拆分为代码。

然后使用所选值作为一列。让我们假设你的原始专栏是客户和项目。所以你的新专栏将有公式customer+"~"+project。然后读取此值以填充SSJS对象或变量,以便您可以检索客户(第一个下拉列表)和项目(第二个下拉列表)。在下拉菜单中,您可以使用格式Display|Value,因此一个好的方法是以customer〜项目的格式获取值。

正如你所说,你可以在Java或JavaScript中做到这一点。因为我喜欢Java的集合框架有很多,这里的Java版本:

import java.util.Set; 
import java.util.Map; 
import java.util.TreeMap; 
import java.util.TreeSet; 

import lotus.domino.Database; 
import lotus.domino.NotesException; 
import lotus.domino.View; 
import lotus.domino.ViewEntry; 
import lotus.domino.ViewEntryCollection; 

public class SplitCategoryBean { 

    private static final String SEPARATOR = "~"; 
    private final Map<String,Set<String>> allCategories = new TreeMap<String, Set<String>>(); 

    public void populate(Database db, String viewName) throws NotesException { 
     View v = db.getView(viewName); 
     ViewEntryCollection vec = v.getAllEntries(); 
     ViewEntry ve = vec.getFirstEntry(); 

     while (ve != null) { 
      ViewEntry nextVE = vec.getNextEntry(ve);   
      this.addEntry(ve.getColumnValues().get(0).toString()); 
      ve.recycle(); 
      ve = nextVE; 
     } 

     vec.recycle(); 
     v.recycle(); 
    } 

    private void addEntry(String combinedCategory) { 
     String[] splitCategory = combinedCategory.split(SEPARATOR); 
     String key = splitCategory[0]; 
     String value = splitCategory[1]; 
     Set<String> thisCategory = (this.allCategories.containsKey(key)) ? this.allCategories.get(key): new TreeSet<String>(); 
     thisCategory.add(value+"|"+combinedCategory); 
     this.allCategories.put(key, thisCategory);  
    } 

    public Set<String> getFirstCategory() { 
     return this.allCategories.keySet(); 
    } 

    public Set<String> getSecondCategoryReadyForDropDown(String key) { 
     return this.allCategories.get(key); 
    } 

} 

为管理bean(viewScope)和queryOpen调用填入方法,你能配置。然后,您可以轻松地将您的第一个选择绑定到#{beanName.firstCategory}以进行选择,例如该值为#{viewScope.curCustomer}。第二个下拉菜单使用rendered="#{viewScope.curCustomer}",因此它仅在选择客户时显示。并且您将所选内容绑定到#{javascript:beanName.getSecondCategoryReadyForDropDown(viewScope.curCustomer);

将刷新放在更改事件上并仅在选择了项目时才呈现视图。

这是否适合您?

0

由于球员

我创建的视图,所述第一列被分类和它的值是客户服务+然后把

document1.getDocument()。getItemValueString( “客​​户”)+ document1.getDocument( ).getItemValueString(“服务”)

in“按类别名称筛选”的视图面板现在可以使用。