Skip to content

Commit

Permalink
Close #207 Close #208
Browse files Browse the repository at this point in the history
  • Loading branch information
Open Lowcode SAS committed Sep 8, 2020
1 parent 5007399 commit 8c61705
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
24 changes: 23 additions & 1 deletion src/org/openlowcode/client/graphic/widget/CTextField.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -93,7 +96,7 @@
*/
public class CTextField
extends
CBusinessField<TextDataElt> {
CBusinessField<TextDataElt> implements ObjectDataElementKeyExtractor<ObjectDataElt,String>{
private static final Logger LOGGER = Logger.getLogger(CTextField.class.getName());
private static final int MAXROWWIDTH = 250;
private String label;
Expand Down Expand Up @@ -1103,4 +1106,23 @@ public void addSuggestions(CPageDataRef suggestions) {


}

@Override
public Function<ObjectDataElt, String> fieldExtractor() {
return (t) -> {
SimpleDataElt field = t.lookupEltByName(CTextField.this.datafieldname);
return field.defaultTextRepresentation();
};

}

@Override
public Function<String, String> keyExtractor() {
return (t)->(t);
}

@Override
public Function<String, String> labelExtractor() {
return (t) -> (t);
}
}
3 changes: 1 addition & 2 deletions src/org/openlowcode/server/graphic/widget/SGrid.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8c61705

Please sign in to comment.