title: How to create a InputText Tag File with a value attribute and a backing bean?
body: <p>I want to create a Tag (Source) File to get a custom tag in facelets (<a href="https://facelets.dev.java.net/nonav/docs/dev/docbook.html#taglib-create-source" rel="nofollow noreferrer">as described here</a>). I want it to get used like this:</p>
  
  <pre><code>&lt;my:inputText value="#{myBean.someString}"/&gt;
  &lt;my:inputText inputText="#{myBean.inputText}"/&gt;
  </code></pre>
  
  <p>In the first case, one could bind it to a simple String property within my bean. In the second case myBean should provide a backing bean for the input field. That backing bean contains not only the value, but also properties like maxlength, disabled, mandatory and so on.</p>
  
  <p>The Tag File looks like this (simplified):</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;ui:fragment
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:c="http://java.sun.com/jstl/core"
      xmlns:h="http://java.sun.com/jsf/html"&gt;
  
  &lt;c:set var="someValue" value="#{value}"/&gt;
  
  &lt;c:if test="#{empty value and not empty inputText}"&gt;
      &lt;c:set var="someValue" value="#{inputText.value}"/&gt;
  &lt;/c:if&gt;
  
      &lt;h:inputText value="#{someValue}"
      disabled="#{disabled or inputText.disabled}"/&gt;
  &lt;/ui:fragment&gt;
  </code></pre>
  
  <p>This problem is, this is not allowed. When I enter some text in the input field, I get the following error: <em>Illegal Syntax for Set Operation</em>. How can I use "value" or "inputText.value" depending on whether the one or the other is specified?</p>