cancel
Showing results for 
Search instead for 
Did you mean: 

productcockpit: new view

former_member640268
Participant
0 Kudos

Hi experts

I try to create a new view within productcockpit.

..backoffice-config.xml:

 <context component="pcmbackoffice-navibar-actions" merge-by="module">
     <y:actions xmlns:y="http://www.hybris.com/cockpit/config/hybris">
         <y:group qualifier="common">
             <y:action action-id="com.hybris.cockpitng.action.toggle" id="pcm-backoffice-triple-hierarchy-view" position="3">
                 <y:parameter>
                     <y:name>outputValue</y:name>
                     <y:value>"pcmbackoffice-triple-hierarchy-view"</y:value>
                 </y:parameter>
                 ...
             </y:action>
         </y:group>
     </y:actions>
 </context>

..backoffice-widgets.xml:

 <widget-extension widgetId="pcmbackoffice-contents">

     <widget id="pcmbackoffice-triple-hierarchy-view" widgetDefinitionId="com.hybris.cockpitng.extendedsplitlayout"
         template="false" slotId="views">
     </widget>

 </widget-extension>


Result: I get a new icon at the left navi-bar. After clicking on it the progressbar appears, but then the collectionBrowser-view is displayed.

Unfortunately there is no log-message and I do not know, how to debug it.

Any help appreciated. Thanks, Heiko

Accepted Solutions (1)

Accepted Solutions (1)

former_member638520
Contributor
0 Kudos

Does your extension have dependency to pcmbackoffice ? In your extensioninfo.xml you should have the following dependency:

     <requires-extension name="pcmbackoffice"/>

Regards,

Lukasz

Answers (4)

Answers (4)

former_member640268
Participant
0 Kudos

thanks for quick reply. But in the meanwhile I found this error in log-file:

ERROR [hybrisHTTP26] [XMLWidgetPersistenceService] Could not apply extension to widget with id 'pcmbackoffice-contents', widget doesn't exist.

It occurs when resetting configuration in BO-orchestrator. Is there anything wrong with the line:

 <widget-extension widgetId="pcmbackoffice-contents">

??

former_member632755
Active Contributor
0 Kudos

Hi,

the toggle action (if not configured differently) will notify a socket called output on the widget on which it is embed. Out of the box such a socket does not exist on that widget and must be declared as a virtual socket. For example:

             <widget id="some-id" widgetDefinitionId="the.widget.id" ...>
                 <virtual-sockets>
                     <output id="output" type="java.lang.String"/>
                 </virtual-sockets>
             </widget>

This way the widget of id some-id will get a new output socket that con be connected as a standard socket.

The other part of the problem is the extended split layout. As the documentation says it only supports the following layouts: single, twixe, twixs, triple, mixleft or mixright. No other string value will be effective.

In general the widget allows to:

  • place 3 widgets on its widget-slots

  • display 1 - 3 widgets at once

  • in case of more than 1 widget being displayed (single), the other layouts offer different mashup of the widgets on the screen (we always display the same widgets!)

In case you need to have another set of widgets displayed in the extended split layout I think that you may need a view switcher (a widget capable of displaying one of its children in a selective way) with the original extended split layout and an additional split layout to hold your new widgets.

This is probably a bit more complex and in this case I'd suggest to start with a paper sketch of the UI with the socket communication and navigation designed.

Cheers, Wojtek

former_member640268
Participant
0 Kudos

Yes, I have it. here is the complete action-code:

             <y:action action-id="com.hybris.cockpitng.action.toggle" id="pcm-backoffice-triple-hierarchy-view" position="3">
                 <y:parameter>
                     <y:name>outputValue</y:name>
                     <y:value>"pcmbackoffice-triple-hierarchy-view"</y:value>
                 </y:parameter>
                 <y:parameter>
                     <y:name>defaultActive</y:name>
                     <y:value>false</y:value>
                 </y:parameter>
                 <y:parameter>
                     <y:name>toggleInput</y:name>
                     <y:value>selected</y:value>
                 </y:parameter>
                 <y:parameter>
                     <y:name>viewMode</y:name>
                     <y:value>iconAndText</y:value>
                 </y:parameter>
                 <y:parameter>
                     <y:name>iconUri</y:name>
                     <y:value>cng/images/triple.svg</y:value>
                 </y:parameter>
                 <y:parameter>
                     <y:name>actionName</y:name>
                     <y:value>label.pcmbackoffice.triple.hierarchy</y:value>
                 </y:parameter>
             </y:action>

Thanks for the hint. I will try...

Heiko

former_member638520
Contributor
0 Kudos

Hi,

Do you have

       <y:parameter>
            <y:name>toggleInput</y:name>
            <y:value>selected</y:value>
       </y:parameter>

in your config.xml ?

As for the debugging. I would recommend to start with ViewSwitcherWidgetController.

Regards,

Lukasz