Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions api/src/org/labkey/api/data/MultiValuedDisplayColumn.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.labkey.api.query.FieldKey;
import org.labkey.api.util.DOM;
import org.labkey.api.writer.HtmlWriter;

import java.util.ArrayList;
Expand All @@ -28,6 +29,8 @@
import java.util.function.Function;
import java.util.stream.Collectors;

import static org.labkey.api.util.DOM.TD;

/**
* Wraps any DisplayColumn and causes it to render each value separately. Often used in conjunction with
* MultiValuedLookupColumn
Expand Down Expand Up @@ -209,4 +212,18 @@ public Object getInputValue(RenderContext ctx)
{
return values(ctx, _column::getInputValue);
}

// Issue 52983: This override matches the DisplayColumn.renderInputCell() implementation.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revised this comment to refer to this issue.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And whoever splits the values trims them, right?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I presume this comment was actually in reference to the other comment I made):

I added space here because we do everywhere else.

Yes, AliasInsertHelper does this and more.

// It's necessary to cancel out DisplayColumnDecorator's override.
@Override
public void renderInputCell(RenderContext ctx, HtmlWriter out)
{
TD(
getInputAttributes(),
(DOM.Renderable) ret -> {
renderInputHtml(ctx, out, getInputValue(ctx));
return ret;
}
).appendTo(out);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public Object getInputValue(RenderContext ctx)

sb.append(delim);
sb.append(name);
delim = ",";
delim = ", ";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added space here because we do everywhere else.

}
}
}
Expand Down