当前位置: 首页>>代码示例>>Java>>正文


Java RequestContext.addPartialTriggerListeners方法代码示例

本文整理汇总了Java中org.apache.myfaces.trinidad.context.RequestContext.addPartialTriggerListeners方法的典型用法代码示例。如果您正苦于以下问题:Java RequestContext.addPartialTriggerListeners方法的具体用法?Java RequestContext.addPartialTriggerListeners怎么用?Java RequestContext.addPartialTriggerListeners使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.myfaces.trinidad.context.RequestContext的用法示例。


在下文中一共展示了RequestContext.addPartialTriggerListeners方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: decode

import org.apache.myfaces.trinidad.context.RequestContext; //导入方法依赖的package包/类
@Override
public void decode(FacesContext context)
{
  if (context == null)
    throw new NullPointerException();

  // Find all the partialTriggers and save on the context
  Map<String, Object> attrs = getAttributes();
  Object triggers = attrs.get("partialTriggers");
  if (triggers instanceof String[])
  {
    RequestContext adfContext = RequestContext.getCurrentInstance();
    if (adfContext != null)
      adfContext.addPartialTriggerListeners(this, (String[]) triggers);
  }

  __rendererDecode(context);
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:19,代码来源:UIXComponentBase.java

示例2: testSiblingButtons

import org.apache.myfaces.trinidad.context.RequestContext; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void testSiblingButtons()
{
  RequestContext context = _createContext();
  try
  {
    UIXCommand button1 = new UIXCommand();
    button1.setId("commandButton1");
    UIXCommand button2 = new UIXCommand();
    button2.setId("commandButton2");
    UIXPanel rootPanel = new UIXPanel();
    rootPanel.getChildren().add(button1);
    rootPanel.getChildren().add(button2);
    
    String[] triggers = {"commandButton1"};
    // add partialTriggers on button2
    context.addPartialTriggerListeners(button2, triggers);
    // now make sure the partialTargets is what we expect
    // in this case, the partial target source is button1,
    // and the targets are button2.
    Set<UIComponent> set = context.getPartialTargets(button1);
    assertTrue(set.contains(button2));
  }
  finally
  {
    context.release();
  }
  
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:30,代码来源:PartialTriggersTest.java

示例3: testSiblingWithTable

import org.apache.myfaces.trinidad.context.RequestContext; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void testSiblingWithTable()
{
  RequestContext context = _createContext();
  try
  {
    UIXCommand button1 = new UIXCommand();
    button1.setId("commandButton1");

    UIXTable table1 = new UIXTable();
    table1.setId("table1");
    UIXPanel rootPanel = new UIXPanel();
    rootPanel.getChildren().add(button1);
    rootPanel.getChildren().add(table1);
    
    String[] triggers = {"::commandButton1"};
    // add partialTriggers on button2
    context.addPartialTriggerListeners(table1, triggers);
    // now make sure the partialTargets is what we expect
    Set<UIComponent> set = context.getPartialTargets(button1);
    assertTrue(set.contains(table1));
    
    // the 'old' way worked like this, test backward-compatibility
    String[] triggersOld = {"commandButton1"};
    // add partialTriggers on button2
    context.addPartialTriggerListeners(table1, triggersOld);
    // now make sure the partialTargets is what we expect
    set = context.getPartialTargets(button1);
    assertTrue(set.contains(table1));
    
  }
  finally
  {
    context.release();
  }
  
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:38,代码来源:PartialTriggersTest.java

示例4: testRelativeSearch

import org.apache.myfaces.trinidad.context.RequestContext; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void testRelativeSearch()
{
  /*<f:subview id="ncRoot">
   *  <commandButton1>
   *  <commandButton2>
   *     <f:subview id="nc1">
   *     <tr:inputText id="inputA" pT="::commandButton1"/>
         <tr:panelGroupLayout>
           <tr:inputText
           id="inputText1"
           partialTriggers="::commandButton1"/>
         </tr:panelGroupLayout>
        </f:subview>
     </f:subview>
   */
  RequestContext context = _createContext();
  try
  {
    // set up component hierarchy
    UIViewRoot viewRoot = new UIViewRoot();
    UIForm form = new UIForm();
    TestNamingContainer ncRoot = new TestNamingContainer(); ncRoot.setId("ncRoot");
    UIXCommand button1 = new UIXCommand();
    button1.setId("commandButton1");
    UIXCommand button2 = new UIXCommand();
    button2.setId("commandButton2");
    
    form.getChildren().add(ncRoot);
    ncRoot.getChildren().add(button1);
    ncRoot.getChildren().add(button2);
    
    TestNamingContainer nc = new TestNamingContainer(); nc.setId("nc1");
    UIXInput inputA = new UIXInput(); inputA.setId("inputA");
    UIXPanel panel = new UIXPanel(); panel.setId("panel1");
    UIXInput input = new UIXInput(); input.setId("input1");
    ncRoot.getChildren().add(nc);
    nc.getChildren().add(inputA);
    nc.getChildren().add(panel);
    panel.getChildren().add(input);
    
    // test input partialTriggers="::commandButton1"
    String[] triggers = {"::commandButton1"};
    context.addPartialTriggerListeners(input, triggers);
    Set<UIComponent> set = context.getPartialTargets(button1);
    assertTrue(set.contains(input));
    
    // the 'old' way worked like this, test backward-compatibility
    String[] triggersOld = {":::commandButton1"};
    context.addPartialTriggerListeners(input, triggersOld);
    set = context.getPartialTargets(button1);
    assertTrue(set.contains(input));
    
    String[] triggersA = {"::commandButton1"};
    context.addPartialTriggerListeners(inputA, triggersA);
    set = context.getPartialTargets(button1);
    assertTrue(set.contains(inputA));
    // test old way
    String[] triggersAOld = {":::commandButton1"};
    context.addPartialTriggerListeners(inputA, triggersAOld);
    set = context.getPartialTargets(button1);
    assertTrue(set.contains(inputA));
    
    
  }
  finally
  {
    context.release();
  }
  

}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:73,代码来源:PartialTriggersTest.java


注:本文中的org.apache.myfaces.trinidad.context.RequestContext.addPartialTriggerListeners方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。