0
votes

I know how to add a field to the editing area in the hmc, but I'm kind of despair with the backoffice.

enter image description here

Right now I'm trying to extend the OAuthClientDetailsModel and try to edit it over the backoffice. For that I extende it over the core-items.xml:

<typegroup name="OCC">
    <itemtype code="OAuthClientDetails" autocreate="false" generate="false">
        <attributes>
            <attribute qualifier="brands" type="StringList" autocreate="false">
                <modifiers read="true" write="true" search="true" optional="true"/>
                <persistence type="property"/>
            </attribute>
        </attributes>
    </itemtype>
</typegroup>

Until now everything is fine.

Now to the backoffice. For that I need to edit the backoffice-config.xml. My current code, which is not working correctly looks like this:

<context merge-by="type" parent="Item" type="OAuthClientDetails" component="editor-area">
    <editorArea:editorArea name="">
        <editorArea:tab name="hmc.tab.category.common" merge-mode="append">
            <editorArea:section name="section.oauthclient.scope" merge-mode="append">
                <editorArea:attribute qualifier="brands"/>
            </editorArea:section>
        </editorArea:tab>
    </editorArea:editorArea>
</context>

This created a new tab and section with equal names, which I don't.

I have the following questions:

  • is there a easy way to figure out the visible tab and section name?
  • how can I add in the first tab, into an existing sextion another list of strings or other fields?
  • is there somewhere
1
There is no append value for merge-mode. Default is merge and that will do what you are trying to do. Read documentation. help.sap.com/viewer/5c9ea0c629214e42b727bf08800d8dfa/1905/en-US/…Zedex7
Thank you for that advice, but sadly nothing changed. I have still a second tab with the same name. I also tried to reset the backoffice config with F4.Mr.Tr33
What Hybris version are you using?Zedex7
6.7 - next problem what I solved is that duplicating tabs. I had to use hmc.tab.common. But now my field is not showing anywhere.Mr.Tr33

1 Answers

0
votes

In every editor area, there two main onglet : essential and administration. Essential : it's always showing, even when you switch between onglet. Administration : is the onglet, where all not categorized attributes goes.

If you don't want to create a new onglet, for your attribute, just use the existing onglet/section :

For your type : sections : hmc.essential, section.oauthclient.basics, section.oauthclient.scope, section.oauthclient.tokenvalidity,section.oauthclient.disabled .

So, lets add it to section section.oauthclient.scope. you need to keep the same tab "hmc.tab.common".

    <context merge-by="type" parent="GenericItem" type="OAuthClientDetails" component="editor-area">
    <editorArea:editorArea xmlns:editorArea="http://www.hybris.com/cockpitng/component/editorArea">
        <editorArea:tab name="hmc.tab.common">
            <editorArea:section name="section.oauthclient.scope" merge-mode="append">
                <editorArea:attribute qualifier="brands"/>
            </editorArea:section>
        </editorArea:tab>
    </editorArea:editorArea>
</context>