Sometimes I have a param.Parameterized class with a lot of parameters. For layout reasons I might split them up into multiple panel.Params. I would like to give these seperate names.
As far as I can see this is not supported by panel.Param.
As you can see the name is MyComponent instead of the custom one specified.

import param
import panel as pn
class MyComponent(param.Parameterized):
selection1 = param.ObjectSelector()
selection2 = param.ObjectSelector()
component = MyComponent()
app = pn.Column(
pn.Param(component, parameters=["selection1"], name="Primary Selections"),
pn.Param(component, parameters=["selection2"], name="Secondary Selections"),
)
app.show()
Support this.
As you can see below the layout is not nice. There is too much space (margin I guess) between things.

import param
import panel as pn
class MyComponent(param.Parameterized):
selection1 = param.ObjectSelector()
selection2 = param.ObjectSelector()
component = MyComponent()
app = pn.Column(
pn.pane.Markdown("# Primary Selections"),
pn.Param(component, parameters=["selection1"], show_name=False),
pn.pane.Markdown("# Secondary Selections"),
pn.Param(component, parameters=["selection2"], show_name=False),
)
app.show()
It makes sense to support that I guess, I also encountered the same issue and used a similar workaround. I could give it a try since I've been working on param.py lately.
@philippjfr Does it make sense to you if I explicitly add a name parameter to panel.Param ?
It could be:
parameters isn't used such as with pn.Param(MyComponent(name="A name"), name="Another name") that would display Another name as a titleobject.name (how the title is currently determined) if the user doesn't provide nameNote that it would break the following test since the default name would no longer be ParamXXXXX:
https://github.com/holoviz/panel/blob/65fb0fba1287ca8bd9ebbbcfd6b918e30742dea3/panel/tests/test_param.py#L103
Yes, I absolutely think that makes sense.