Package org.omnifaces.el

Examples of org.omnifaces.el.ScopedRunner


    String var = (String) attributes.get("var");

    // Helper class that's used to set the item value in (EL) scope using the name set by "var" during the iteration.
    // If during each iteration the value of this is changed, any value expressions in the attribute
    // map referring it will resolve to that particular instance.
    ScopedRunner scopedRunner = new ScopedRunner(facesContext);

    for (final Object item : items) {

      // If the item is already a SelectItem, take it directly.
      // NOTE: I'm not 100% sure if this is right, since it now allows a collection to consist
      // out of a mix of SelectItems and non-SelectItems. Should we maybe always process the iterator
      // if there's a "var", "itemLabel" or "itemValue" present, or should we process the entire collection
      // as SelectItems if the first element is a SelectItem and throw an exception as soon as we encounter
      // a non-SelectItem?
      if (item instanceof SelectItem) {
        selectItems.add((SelectItem)item);
        continue;
      }

      if (!isEmpty(var)) {
        scopedRunner.with(var, item);
      }

      // During each iteration, just resolve all attributes again.
      scopedRunner.invoke(new Callback.Void() { @Override public void invoke() {

        Object itemValue = getItemValue(attributes, item);
        Object noSelectionValue = attributes.get("noSelectionValue");
        boolean itemValueIsNoSelectionValue = noSelectionValue != null && noSelectionValue.equals(itemValue);
View Full Code Here

TOP

Related Classes of org.omnifaces.el.ScopedRunner

Copyright © 2018 www.massapicom. 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.