Right now I have a view like this that works.
#{form @UserCreate.create()}
#{field 'user.email'}
#{text field /}
#{/field}
#{/form}
With a corresponding text tag defined which then uses the field (it is more complicated than this, just boiling down to essentials)
<input type="text" id="${_arg.id}" name="${_arg.name}" value="${_arg.value}">
Ideally I would rather have it so I did not have to declare the field in the view so it would look like this.
#{form @UserCreate.create()}
#{text 'user.email' /}
#{/form}
With a tag that looks like this.
#{field 'user.email'}
<input type="text" id="${field.id}" name="${field.name}" value="${field.value}">
#{/field}
But the field.value always returns null because user is not in the tags’ template binding. I am not really sure how to approach things at this point. Suggestions?
I don’t believe you will be able to do what you want due to the way the #{field} tag works (see its code here).
Probably the best approach is to create a series of fast tags based on Field tag’s code, without the part that renders the body (as you won’t need it), even if it may mean a bit of code duplication. Once done you can refactor to extract some common sections and reduce the duplication.