EMPIREDB-317
Bugfix e:input inside ui:repeat
diff --git a/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/components/InputTag.java b/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/components/InputTag.java
index f38208e..cec5a1f 100644
--- a/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/components/InputTag.java
+++ b/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/components/InputTag.java
@@ -88,6 +88,7 @@
protected boolean initState(FacesContext context)
{
// Check visibility
+ helper.prepareData();
if (helper.isVisible() == false)
return false; // not visible
// Read only State
@@ -100,7 +101,6 @@
return false;
}
// Init Control and inputInfo;
- helper.prepareData();
control = helper.getInputControl();
inpInfo = helper.getInputInfo(context);
return (control != null && inpInfo != null);
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 ae83f15..9b9af08 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
@@ -644,8 +644,8 @@
public Object getRecord()
{
- if (record == null)
- record = findRecord();
+ if (record == null && (record=findRecord())!=null)
+ setRecord(record);
return record;
}
@@ -830,11 +830,18 @@
public boolean isVisible()
{
// reset record
- if (this.record!=null && (getTagAttributeValue("record") instanceof Record))
- this.record=null;
+ if (this.record!=null)
+ { // Check attribute
+ Object recordTagValue = getTagAttributeValue("record");
+ if ((recordTagValue instanceof DBRecord) && this.record!=recordTagValue)
+ { // shoud not come here
+ log.warn("Record in call to IsVisible has unexpectedly changed!");
+ this.record=null;
+ }
+ }
// Check Record
if ((getRecord() instanceof Record))
- { // Ask Record
+ { // Ask Record
Record r = (Record) record;
return r.isFieldVisible(getColumn());
}