Skip to content

Commit d4c5c45

Browse files
author
Open Lowcode SAS
committed
Close #246
1 parent 87e0406 commit d4c5c45

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

src/org/openlowcode/design/data/DataObjectDefinitionShowPage.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,7 @@ public void generateToFile(SourceGenerator sg, Module module) throws IOException
831831
sg.wl(" objectdisplaydefinition.setReducedDisplay(false);");
832832
sg.wl(" detailstab.addElement(objectdisplaydefinition);");
833833
if (companion != null) {
834+
sg.wl(" objectdisplaydefinition.overridesLabel(\""+companion.getLabel()+"\");");
834835
sg.wl(" SObjectDisplay<" + companionclass + "> companionobjectdisplay = new SObjectDisplay<"
835836
+ companionclass + ">(\"COMPANION\",this.get" + companionclass + "()," + companionclass
836837
+ ".getDefinition(), this, true);");
@@ -849,11 +850,13 @@ public void generateToFile(SourceGenerator sg, Module module) throws IOException
849850
sg.wl(" SObjectDisplay<" + objectclass + "> objectdisplaydefinition = new SObjectDisplay<" + objectclass
850851
+ ">(\"" + objectclass.toUpperCase() + "\", this.get" + objectclass + "()," + objectclass
851852
+ ".getDefinition(),this, true);");
853+
852854
sg.wl(" mainband.addElement(objectdisplaydefinition);");
853855
if (hasworkflow)
854856
sg.wl(" objectdisplaydefinition.addPageNodeRightOfTitle(activetaskband);");
855857
sg.wl("");
856858
if (companion != null) {
859+
sg.wl(" objectdisplaydefinition.overridesLabel(\""+companion.getLabel()+"\");");
857860
sg.wl(" SObjectDisplay<" + companionclass + "> companionobjectdisplay = new SObjectDisplay<"
858861
+ companionclass + ">(\"COMPANION\",this.get" + companionclass + "()," + companionclass
859862
+ ".getDefinition(), this, true);");

src/org/openlowcode/design/data/DataObjectDefinitionUpdatePage.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public void generateToFile(SourceGenerator sg, Module module) throws IOException
175175
sg.wl(" @Override");
176176
sg.wl(" protected SPageNode getContent() {");
177177
sg.wl(" SComponentBand mainband = new SComponentBand(SComponentBand.DIRECTION_DOWN,this);");
178-
sg.wl(" mainband.addElement(new SPageText(\"Update " + objectclass + "\",SPageText.TYPE_TITLE,this));");
178+
sg.wl(" mainband.addElement(new SPageText(\"Update " + (companionobject!=null?companionobject.getLabel():dataobject.getLabel()) + "\",SPageText.TYPE_TITLE,this));");
179179
sg.wl(" AtgUpdate" + (companionobject != null ? companionvariable : objectvariable)
180180
+ "Action.ActionRef update" + objectvariable + "actionref = AtgUpdate"
181181
+ (companionobject != null ? companionvariable : objectvariable) + "Action.get().getActionRef();");
@@ -190,6 +190,7 @@ public void generateToFile(SourceGenerator sg, Module module) throws IOException
190190
sg.wl(" SObjectDisplay<" + objectclass + "> objectupdatedefinition = new SObjectDisplay<" + objectclass
191191
+ ">(\"" + dataobject.getName().toUpperCase() + "\", this.get" + objectclass + "()," + objectclass
192192
+ ".getDefinition(),this, false);");
193+
sg.wl(" objectupdatedefinition.setReducedDisplay(false);");
193194
sg.wl(" update" + objectvariable + "actionref.set" + objectclass
194195
+ "(objectupdatedefinition.getObjectInput()); ");
195196
if (companionobject != null) {

src/org/openlowcode/server/graphic/widget/SObjectDisplay.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public class SObjectDisplay<E extends DataObject<E>>
7070
private ArrayList<DataObjectFieldMarker<E>> hiddenfields;
7171
private HashMap<DataObjectFieldMarker<E>, TextDataElt> overridenlabels;
7272
private HashMap<DataObjectFieldMarker<E>, ArrayDataElt<TextDataElt>> suggestionsfortextfields;
73+
private String overrideslabel;
7374

7475
/**
7576
* creates an object display
@@ -290,10 +291,19 @@ public String getPathName() {
290291
return this.name;
291292
}
292293

294+
/**
295+
* Replaces the object type label by another label
296+
*
297+
* @param overrideslabel alternative label
298+
*/
299+
public void overridesLabel(String overrideslabel) {
300+
this.overrideslabel = overrideslabel;
301+
}
302+
293303
@Override
294304
public void WritePayloadToCDL(MessageWriter writer, SPageData input, SecurityBuffer buffer) throws IOException {
295305
writer.addStringField("NAME", this.name);
296-
writer.addStringField("LABEL", this.objectmodel.getLabel());
306+
writer.addStringField("LABEL",(overrideslabel!=null?overrideslabel: this.objectmodel.getLabel()));
297307
writer.addBooleanField("SOT", this.showtitle);
298308
writer.addBooleanField("SOC", this.showcontent);
299309

0 commit comments

Comments
 (0)