Java Code Examples for javax.faces.component.UIComponent#setValueBinding()

The following examples show how to use javax.faces.component.UIComponent#setValueBinding() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TagUtil.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
/**
 * Set a ValueBinding on a component - used by tags setProperties() method.
 */
public static void setValueBinding(UIComponent component, String name, String value)
{
    FacesContext context = FacesContext.getCurrentInstance();
    Application app = context.getApplication();
    ValueBinding vb = app.createValueBinding(value);
    component.setValueBinding(name, vb);
}
 
Example 2
Source File: TagUtil.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
public static void setValueBinding(UIComponent component,
  String attributeName,
  String attributeValue)
{
  FacesContext context = FacesContext.getCurrentInstance();
  Application app = context.getApplication();
  ValueBinding vb = app.createValueBinding(attributeValue);
  component.setValueBinding(attributeName, vb);
}
 
Example 3
Source File: ExtLibUtil.java    From XPagesExtensionLibrary with Apache License 2.0 5 votes vote down vote up
public static void assignBindingProperty(FacesContext context, String bindingExpr, UIComponent component) {
    ValueBinding binding = ((ApplicationEx)context.getApplication()).createValueBinding(bindingExpr);
    if( binding.isReadOnly(context) ){
        return;
    }
    if( binding instanceof ComponentBindingObject ){
        ((ComponentBindingObject)binding).setComponent(component);
    }
    binding.setValue(context, component);
    component.setValueBinding("binding", binding); //$NON-NLS-1$
}
 
Example 4
Source File: SyllabusShowAreaTag.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
public static void setValueBinding(UIComponent component,
    String attributeName, String attributeValue)
{
  FacesContext context = FacesContext.getCurrentInstance();
  Application app = context.getApplication();
  ValueBinding vb = app.createValueBinding(attributeValue);
  component.setValueBinding(attributeName, vb);
}
 
Example 5
Source File: SyllabusIfNotTag.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
public static void setValueBinding(UIComponent component,
    String attributeName, String attributeValue)
{
  FacesContext context = FacesContext.getCurrentInstance();
  Application app = context.getApplication();
  ValueBinding vb = app.createValueBinding(attributeValue);
  component.setValueBinding(attributeName, vb);
}
 
Example 6
Source File: SyllabusIfTag.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
public static void setValueBinding(UIComponent component,
    String attributeName, String attributeValue)
{
  FacesContext context = FacesContext.getCurrentInstance();
  Application app = context.getApplication();
  ValueBinding vb = app.createValueBinding(attributeValue);
  component.setValueBinding(attributeName, vb);
}
 
Example 7
Source File: TagUtil.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
/**
 * Set a ValueBinding on a component - used by tags setProperties() method.
 */
public static void setValueBinding(UIComponent component, String name, String value)
{
    FacesContext context = FacesContext.getCurrentInstance();
    Application app = context.getApplication();
    ValueBinding vb = app.createValueBinding(value);
    component.setValueBinding(name, vb);
}
 
Example 8
Source File: ShowAreaTag.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
public static void setValueBinding(UIComponent component,
    String attributeName, String attributeValue)
{
  FacesContext context = FacesContext.getCurrentInstance();
  Application app = context.getApplication();
  ValueBinding vb = app.createValueBinding(attributeValue);
  component.setValueBinding(attributeName, vb);
}
 
Example 9
Source File: Tags.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
public static void setValueBinding(UIComponent component,
		String attributeName, String attributeValue) {
	FacesContext context = FacesContext.getCurrentInstance();
	Application app = context.getApplication();
	ValueBinding vb = app.createValueBinding(attributeValue);
	component.setValueBinding(attributeName, vb);
}
 
Example 10
Source File: Tags.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
public static void setValueBinding(UIComponent component, String attributeName,
      String attributeValue) {
   FacesContext context = FacesContext.getCurrentInstance();
   Application app = context.getApplication();
   ValueBinding vb = app.createValueBinding(attributeValue);
   component.setValueBinding(attributeName, vb);
}
 
Example 11
Source File: SyllabusIfNotTag.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
public static void setValueBinding(UIComponent component,
    String attributeName, String attributeValue)
{
  FacesContext context = FacesContext.getCurrentInstance();
  Application app = context.getApplication();
  ValueBinding vb = app.createValueBinding(attributeValue);
  component.setValueBinding(attributeName, vb);
}
 
Example 12
Source File: TagUtil.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
/**
 * Set a ValueBinding on a component - used by tags setProperties() method.
 */
public static void setValueBinding(UIComponent component, String name, String value)
{
    FacesContext context = FacesContext.getCurrentInstance();
    Application app = context.getApplication();
    ValueBinding vb = app.createValueBinding(value);
    component.setValueBinding(name, vb);
}
 
Example 13
Source File: Tags.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
public static void setValueBinding(UIComponent component, String attributeName,
      String attributeValue) {
   FacesContext context = FacesContext.getCurrentInstance();
   Application app = context.getApplication();
   ValueBinding vb = app.createValueBinding(attributeValue);
   component.setValueBinding(attributeName, vb);
}
 
Example 14
Source File: TagUtil.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
/**
 * Set a ValueBinding on a component - used by tags setProperties() method.
 */
public static void setValueBinding(UIComponent component, String name, String value)
{
    FacesContext context = FacesContext.getCurrentInstance();
    Application app = context.getApplication();
    ValueBinding vb = app.createValueBinding(value);
    component.setValueBinding(name, vb);
}
 
Example 15
Source File: FlowStateTag.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
protected void setProperties(UIComponent component) {
	if (log.isDebugEnabled()) log.debug("setProperties " + bean);
	super.setProperties(component);

	FacesContext context = getFacesContext();

	if (bean != null) {
		if (UIComponentTag.isValueReference(bean)) {
			ValueBinding vb = context.getApplication().createValueBinding(bean);
			component.setValueBinding("bean", vb);
		} else {
			log.error("Invalid expression " + bean);
		}
	}
}
 
Example 16
Source File: TagUtil.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
/**
 * Set a ValueBinding on a component - used by tags setProperties() method.
 */
public static void setValueBinding(UIComponent component, String name, String value)
{
    FacesContext context = FacesContext.getCurrentInstance();
    Application app = context.getApplication();
    ValueBinding vb = app.createValueBinding(value);
    component.setValueBinding(name, vb);
}
 
Example 17
Source File: HideDivisionTag.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
protected void setProperties(UIComponent component)
{

  super.setProperties(component);

  /* SAK-7299
  if (id != null)
  {
    component.getAttributes().put("id", id);
  }
  */
  
  if (title != null)
  {
    if ( title.indexOf("#{") > -1)
    {
      component.setValueBinding("title",
        getFacesContext().getApplication().createValueBinding(
        getTitle()));
    }
    else
    {
      component.getAttributes().put("title", title);
    }
  }

}
 
Example 18
Source File: TagUtil.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
public static void setValueBinding(UIComponent component,
  String attributeName,
  String attributeValue)
{
  FacesContext context = FacesContext.getCurrentInstance();
  Application app = context.getApplication();
  ValueBinding vb = app.createValueBinding(attributeValue);
  component.setValueBinding(attributeName, vb);
}
 
Example 19
Source File: HelpFrameSetTag.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
/** 
 * @see javax.faces.webapp.UIComponentTag#setProperties(javax.faces.component.UIComponent)
 */
protected void setProperties(UIComponent component)
{
  super.setProperties(component);
  FacesContext context = getFacesContext();

  if (searchToolUrl != null)
  {
    if (isValueReference(searchToolUrl))
    {
      component.setValueBinding("searchToolUrl", context.getApplication()
          .createValueBinding(searchToolUrl));
    }
    else
    {
      component.getAttributes().put("searchToolUrl", searchToolUrl);
    }
  }
  if (tocToolUrl != null)
  {
    if (isValueReference(tocToolUrl))
    {
      component.setValueBinding("tocToolUrl", context.getApplication()
          .createValueBinding(tocToolUrl));
    }
    else
    {
      component.getAttributes().put("tocToolUrl", tocToolUrl);
    }
  }
  if (helpWindowTitle != null)
  {
    if (isValueReference(helpWindowTitle))
    {
      component.setValueBinding("helpWindowTitle", context.getApplication()
          .createValueBinding(helpWindowTitle));
    }
    else
    {
      component.getAttributes().put("helpWindowTitle", helpWindowTitle);
    }
  }
  if (helpUrl != null)
  {
    if (isValueReference(helpUrl))
    {
      component.setValueBinding("helpUrl", context.getApplication()
          .createValueBinding(helpUrl));
    }
    else
    {
      component.getAttributes().put("helpUrl", helpUrl);
    }
  }
}
 
Example 20
Source File: HelpFrameSetTag.java    From sakai with Educational Community License v2.0 4 votes vote down vote up
/** 
 * @see javax.faces.webapp.UIComponentTag#setProperties(javax.faces.component.UIComponent)
 */
protected void setProperties(UIComponent component)
{
  super.setProperties(component);
  FacesContext context = getFacesContext();

  if (searchToolUrl != null)
  {
    if (isValueReference(searchToolUrl))
    {
      component.setValueBinding("searchToolUrl", context.getApplication()
          .createValueBinding(searchToolUrl));
    }
    else
    {
      component.getAttributes().put("searchToolUrl", searchToolUrl);
    }
  }
  if (tocToolUrl != null)
  {
    if (isValueReference(tocToolUrl))
    {
      component.setValueBinding("tocToolUrl", context.getApplication()
          .createValueBinding(tocToolUrl));
    }
    else
    {
      component.getAttributes().put("tocToolUrl", tocToolUrl);
    }
  }
  if (helpWindowTitle != null)
  {
    if (isValueReference(helpWindowTitle))
    {
      component.setValueBinding("helpWindowTitle", context.getApplication()
          .createValueBinding(helpWindowTitle));
    }
    else
    {
      component.getAttributes().put("helpWindowTitle", helpWindowTitle);
    }
  }
  if (helpUrl != null)
  {
    if (isValueReference(helpUrl))
    {
      component.setValueBinding("helpUrl", context.getApplication()
          .createValueBinding(helpUrl));
    }
    else
    {
      component.getAttributes().put("helpUrl", helpUrl);
    }
  }
}