You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@empire-db.apache.org by do...@apache.org on 2016/02/20 17:45:15 UTC
empire-db git commit: EMPIREDB-235 suppress the for attribute on the
label tag if control is readonly
Repository: empire-db
Updated Branches:
refs/heads/master 4182161bb -> 7be35dd50
EMPIREDB-235
suppress the for attribute on the label tag if control is readonly
Project: http://git-wip-us.apache.org/repos/asf/empire-db/repo
Commit: http://git-wip-us.apache.org/repos/asf/empire-db/commit/7be35dd5
Tree: http://git-wip-us.apache.org/repos/asf/empire-db/tree/7be35dd5
Diff: http://git-wip-us.apache.org/repos/asf/empire-db/diff/7be35dd5
Branch: refs/heads/master
Commit: 7be35dd50820af271db9b0ee5f10832345e9fccc
Parents: 4182161
Author: Rainer Döbele <do...@esteam.de>
Authored: Sat Feb 20 17:45:09 2016 +0100
Committer: Rainer Döbele <do...@esteam.de>
Committed: Sat Feb 20 17:45:09 2016 +0100
----------------------------------------------------------------------
.../empire/jsf2/utils/TagEncodingHelper.java | 33 +++++++++++++-------
1 file changed, 21 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/empire-db/blob/7be35dd5/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagEncodingHelper.java
----------------------------------------------------------------------
diff --git a/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagEncodingHelper.java b/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagEncodingHelper.java
index e5a040b..e6d8286 100644
--- a/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagEncodingHelper.java
+++ b/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagEncodingHelper.java
@@ -1242,22 +1242,31 @@ public class TagEncodingHelper implements NamingContainer
Column column = null;
boolean readOnly=false;
boolean required=false;
- // for
- if (StringUtils.isNotEmpty(forInput) && !forInput.equals("*"))
- { // Set Label input Id
- UIComponent input = FacesUtils.getWebApplication().findComponent(context, forInput, tag);
- if (input!=null && (input instanceof InputTag))
- { // Check Read-Only
- InputTag inputTag = ((InputTag)input);
- column = inputTag.getInputColumn();
- readOnly = inputTag.isInputReadOnly();
- required = inputTag.isInputRequired();
+ // forInput provided
+ if (StringUtils.isNotEmpty(forInput))
+ { // find the component
+ if (!forInput.equals("*"))
+ { // Set Label input Id
+ UIComponent input = FacesUtils.getWebApplication().findComponent(context, forInput, tag);
+ if (input!=null && (input instanceof InputTag))
+ { // Check Read-Only
+ InputTag inputTag = ((InputTag)input);
+ column = inputTag.getInputColumn();
+ readOnly = inputTag.isInputReadOnly();
+ required = inputTag.isInputRequired();
+ }
+ else
+ { // Not found (<e:input id="ABC"...> must match <e:label for="ABC"...>
+ log.warn("Input component {} not found for label {}.", forInput, getColumn().getName());
+ }
}
else
- { // Not found (<e:input id="ABC"...> must match <e:label for="ABC"...>
- log.warn("Input component {} not found for label {}.", forInput, getColumn().getName());
+ { // set readonly
+ readOnly = this.isReadOnly();
}
}
+
+ // Column provided?
if (column==null)
{ // Get from LinkTag
column = getColumn();