diff --git a/src/org/openlowcode/client/graphic/widget/CTextField.java b/src/org/openlowcode/client/graphic/widget/CTextField.java index 22fc6f81..8805071a 100644 --- a/src/org/openlowcode/client/graphic/widget/CTextField.java +++ b/src/org/openlowcode/client/graphic/widget/CTextField.java @@ -12,6 +12,7 @@ import java.io.IOException; import java.util.ArrayList; +import java.util.function.Function; import java.util.function.UnaryOperator; import java.util.logging.Logger; import javafx.beans.property.SimpleObjectProperty; @@ -24,7 +25,9 @@ import org.openlowcode.client.graphic.CPageSignifPath; import org.openlowcode.client.graphic.widget.table.CObjectGridLine; import org.openlowcode.client.graphic.widget.table.LargeTextTableCell; +import org.openlowcode.client.graphic.widget.table.ObjectDataElementKeyExtractor; import org.openlowcode.client.graphic.widget.table.ObjectTableRow; +import org.openlowcode.client.graphic.widget.tools.CChoiceFieldValue; import org.openlowcode.client.runtime.PageActionManager; import org.openlowcode.tools.structure.ArrayDataElt; import org.openlowcode.tools.structure.ArrayDataEltType; @@ -93,7 +96,7 @@ */ public class CTextField extends - CBusinessField { + CBusinessField implements ObjectDataElementKeyExtractor{ private static final Logger LOGGER = Logger.getLogger(CTextField.class.getName()); private static final int MAXROWWIDTH = 250; private String label; @@ -1103,4 +1106,23 @@ public void addSuggestions(CPageDataRef suggestions) { } + + @Override + public Function fieldExtractor() { + return (t) -> { + SimpleDataElt field = t.lookupEltByName(CTextField.this.datafieldname); + return field.defaultTextRepresentation(); + }; + + } + + @Override + public Function keyExtractor() { + return (t)->(t); + } + + @Override + public Function labelExtractor() { + return (t) -> (t); + } } diff --git a/src/org/openlowcode/server/graphic/widget/SGrid.java b/src/org/openlowcode/server/graphic/widget/SGrid.java index 6fbde7c2..964c7a3c 100644 --- a/src/org/openlowcode/server/graphic/widget/SGrid.java +++ b/src/org/openlowcode/server/graphic/widget/SGrid.java @@ -321,8 +321,7 @@ public void WritePayloadToCDL(MessageWriter writer, SPageData input, SecurityBuf } objectarray.writeReferenceToCML(writer); writer.startStructure("ATTRS"); - // TODO potential optimization: sends only required fields + ID. - objectmodel.writeFieldDefinition(writer, input, buffer); + objectmodel.writeFieldDefinition(writer, null, null,-1000,input, buffer); writer.endStructure("ATTRS"); if (this.inlineupdateaction == null) { writer.addBooleanField("INLUPD", false);