Get/Set Path of Categorization Layout

Hi, I am looking for a way to get and set the current selected path of a Categorization Layout programatically, outside of the JsonForm in React. I am using React Material Renderers.

I tried useJsonForms hook to get the state but every properties is empty.

Any idea how to do it?
Thanks :slight_smile:

Hi @Clem,

The currently selected part of a Categorizaton Layout is managed via local state. There is no mechanism to change this outside of JSON Forms.

To fulfill your requirements you need to create and register a custom categorization renderer which supports to being able to be controlled externally. As a starting point you can copy the code of the existing renderer linked above.

Awesome, thanks!

I noticed an onChange callback prop in this renderer but I can’t find how to pass this prop from the custom renderer:

export default {
  tester: materialCategorizationTester,
  renderer: withAjvProps(withTranslateProps(withJsonFormsLayoutProps(MaterialCategorizationLayoutRenderer))),

Hi @Clem,

I’m not sure I fully understand the question. If you would like to reuse existing controls and just slighly adapt their props, then you can follow this guide.