Examples of UIRepeat


Examples of com.sun.facelets.component.UIRepeat

    assertTrue(dataModel.getSelectedRow() != dataModel.getRowData());
  }

  public void testProcessActionWithUIRepeat() {

    UIRepeat uiRepeat = new UIRepeat();
    uiRepeat.setValue(dataModel);
    UICommand commandButton = new UICommand();
    uiRepeat.getChildren().add(commandButton);
    viewToTest.getChildren().add(uiRepeat);

    Method indexMutator = ReflectionUtils.findMethod(UIRepeat.class, "setIndex", new Class[] { int.class });
    indexMutator.setAccessible(true);
View Full Code Here

Examples of com.sun.faces.facelets.component.UIRepeat

    assertTrue(this.dataModel.getSelectedRow() != this.dataModel.getRowData());
  }

  public void testProcessActionWithUIRepeat() {

    UIRepeat uiRepeat = new UIRepeat();
    uiRepeat.setValue(this.dataModel);
    UICommand commandButton = new UICommand();
    uiRepeat.getChildren().add(commandButton);
    this.viewToTest.getChildren().add(uiRepeat);

    Method indexMutator = ReflectionUtils.findMethod(UIRepeat.class, "setIndex", new Class[] { FacesContext.class,
        int.class });
    indexMutator.setAccessible(true);
View Full Code Here

Examples of org.ajax4jsf.component.UIRepeat

*/
public class RepeatRenderer extends RendererBase {

  public void encodeChildren(FacesContext context, UIComponent component)
      throws IOException {
    final UIRepeat repeater = (UIRepeat) component;
    repeater.captureOrigValue(context);
    try {
      DataVisitor visitor = new DataVisitor() {

        public void process(FacesContext context, Object rowKey, Object argument) throws IOException {
          repeater.setRowKey(rowKey);
          ListIterator childIterator = repeater.getChildren()
              .listIterator();
          while (childIterator.hasNext()) {
            UIComponent child = (UIComponent) childIterator.next();
            renderChild(context, child);
          }

        }

      };
      repeater.walk(context, visitor, null);

    } finally {
      repeater.restoreOrigValue(context);
      repeater.setRowKey(null);
    }
  }
View Full Code Here

Examples of org.apache.myfaces.view.facelets.component.UIRepeat

        // build testUIRepeat.xhtml
        UIViewRoot root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root, "testUIRepeat.xhtml");
       
        // get the component instances
        UIRepeat repeat = (UIRepeat) root.findComponent("form:repeat");
        UIComponent outputText = repeat.getChildren().get(0);
       
        // create the ContextCallback
        TestContextCallback callback = new TestContextCallback(facesContext);
       
        // save some values in #{row} and #{status} and test the
View Full Code Here

Examples of org.apache.myfaces.view.facelets.component.UIRepeat

        // build testUIRepeat.xhtml
        UIViewRoot root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root, "testUIRepeat.xhtml");
       
        // get the component instances
        UIRepeat repeat = (UIRepeat) root.findComponent("form:repeat");
       
        // create the VisitCallback
        TestVisitCallback testVisitCallback = new TestVisitCallback(facesContext, repeatValues);
       
        // save some values in #{row} and #{status} and test the
        // automatic saving and restoring of them
        final String var = "row";
        final String varStatus = "status";
        final String varValue = "someVarValue";
        final String statusValue = "someStatusValue";
        externalContext.getRequestMap().put(var, varValue);
        externalContext.getRequestMap().put(varStatus, statusValue);
       
        // perform visit
        repeat.visitTree(VisitContext.createVisitContext(facesContext), testVisitCallback);
       
        // created expected List
        List<String> expectedClientIds = new ArrayList<String>();
        expectedClientIds.add("form:repeat");
        expectedClientIds.add("form:repeat:0:outputText");
View Full Code Here

Examples of org.apache.myfaces.view.facelets.component.UIRepeat

        facesContext.getExternalContext().getRequestMap().put("repeatValues", repeatValues);
       
        UIViewRoot root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root, "ui_repeat_offset.xhtml");
       
        UIRepeat repeat = (UIRepeat) root.findComponent("form:repeat");
        Assert.assertNotNull(repeat);
       
        FastWriter fw = new FastWriter();
        ResponseWriter rw = facesContext.getResponseWriter();
        rw = rw.cloneWithWriter(fw);
        facesContext.setResponseWriter(rw);
       
        repeat.encodeAll(facesContext);
        String content = fw.toString();
       
        // offset="2" size="1" should render only 1 row
        int itemIndex1 = content.indexOf("B1");
        Assert.assertEquals(-1, itemIndex1);
View Full Code Here

Examples of org.apache.myfaces.view.facelets.component.UIRepeat

        facesContext.getExternalContext().getRequestMap().put("repeatValues", repeatValues);
       
        UIViewRoot root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root, "ui_repeat_offset.xhtml");
       
        UIRepeat repeat = (UIRepeat) root.findComponent("form:repeat0");
        Assert.assertNotNull(repeat);
       
        FastWriter fw = new FastWriter();
        ResponseWriter rw = facesContext.getResponseWriter();
        rw = rw.cloneWithWriter(fw);
        facesContext.setResponseWriter(rw);
       
        repeat.encodeAll(facesContext);
       
        String content = fw.toString();

        int itemIndex1 = content.indexOf("B1");
        Assert.assertNotSame(-1, itemIndex1);
View Full Code Here

Examples of org.apache.myfaces.view.facelets.component.UIRepeat

        facesContext.getExternalContext().getRequestMap().put("repeatValues", repeatValues);
       
        UIViewRoot root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root, "ui_repeat_offset.xhtml");
       
        UIRepeat repeat = (UIRepeat) root.findComponent("form:repeat0_7");
        Assert.assertNotNull(repeat);
       
        FastWriter fw = new FastWriter();
        ResponseWriter rw = facesContext.getResponseWriter();
        rw = rw.cloneWithWriter(fw);
        facesContext.setResponseWriter(rw);
       
        repeat.encodeAll(facesContext);
       
        String content = fw.toString();

        int itemIndex1 = content.indexOf("B1");
        Assert.assertNotSame(-1, itemIndex1);
View Full Code Here

Examples of org.apache.myfaces.view.facelets.component.UIRepeat

        facesContext.getExternalContext().getRequestMap().put("repeatValues", repeatValues);
       
        UIViewRoot root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root, "ui_repeat_offset.xhtml");
       
        UIRepeat repeat = (UIRepeat) root.findComponent("form:repeat0_8");
        Assert.assertNotNull(repeat);
       
        FastWriter fw = new FastWriter();
        ResponseWriter rw = facesContext.getResponseWriter();
        rw = rw.cloneWithWriter(fw);
        facesContext.setResponseWriter(rw);
       
        try
        {
            repeat.encodeAll(facesContext);
            Assert.fail();
        }
        catch(FacesException e)
        {
            // size cannot be greater than collection size
View Full Code Here

Examples of org.apache.myfaces.view.facelets.component.UIRepeat

        facesContext.getExternalContext().getRequestMap().put("repeatValues", repeatValues);
       
        UIViewRoot root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root, "ui_repeat_offset.xhtml");
       
        UIRepeat repeat = (UIRepeat) root.findComponent("form:repeat1");
        Assert.assertNotNull(repeat);
       
        FastWriter fw = new FastWriter();
        ResponseWriter rw = facesContext.getResponseWriter();
        rw = rw.cloneWithWriter(fw);
        facesContext.setResponseWriter(rw);
       
        repeat.encodeAll(facesContext);
       
        String content = fw.toString();

        int itemIndex1 = content.indexOf("B1");
        Assert.assertEquals(-1, itemIndex1);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.