1

I added a new attribute at the a section in the backoffice. I added a date time attribute

                <editorArea:attribute qualifier="DateCutOffTime" defaultEditor="com.hybris.cockpitng.editor.defaulttime">
                        <editorArea:editor-parameter>
                            <editorArea:name>timeFormat</editorArea:name>    
                            <editorArea:value>short</editorArea:value>
                        </editorArea:editor-parameter>
                        <editorArea:editor-parameter>
                            <editorArea:name>timeZoneReadOnly</editorArea:name>
                            <editorArea:value>false</editorArea:value>  
                        </editorArea:editor-parameter>
                        <editorArea:editor-parameter>
                             <editorArea:name>selectedTimeZone</editorArea:name>
                             <editorArea:value>GMT+01:00</editorArea:value>
                        </editorArea:editor-parameter>
                        <editorArea:editor-parameter>
                             <editorArea:name>displayedTimeZones</editorArea:name>
                             <editorArea:value>GMT-12:00,GMT-11:00,GMT-10:00,GMT-09:30,GMT-09:00,GMT-08:00,GMT-07:00,GMT-06:00,GMT-05:00,GMT-04:30,GMT-04:00,GMT-03:30,GMT-03:00,GMT-02:00,GMT-01:00,GMT+00:00,GMT+01:00,GMT+02:00,GMT+03:00,GMT+03:30,GMT+04:00,GMT+04:30,GMT+05:00,GMT+05:30,GMT+05:45,GMT+06:00,GMT+06:30,GMT+07:00,GMT+08:00,GMT+08:30,GMT+08:45,GMT+09:00,GMT+09:30,GMT+10:00,GMT+10:30,GMT+11:00,GMT+12:00,GMT+12:45,GMT+13:00,GMT+14:00</editorArea:value>
                        </editorArea:editor-parameter>
                    </editorArea:attribute>

But i have a display with a calendar

enter image description here

I want to display a component just with the time to choose and timezone or only show hours.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Rodik
  • 271
  • 2
  • 19

1 Answers1

0

You seem to mix 2 different types of configuration

This line is wrong:

<editorArea:attribute qualifier="DateCutOffTime" defaultEditor="com.hybris.cockpitng.editor.defaulttime">

You want to use an editor for a specific property (qualifier). For that, you need to write the header with editor instead of defaultEditor. If you look at the correspondig xsd validation, you will notice that defaultEditor is not a valid config option. Change this to editor, and it should work. (assuming DateCutoffTime is a property and not a type on one of your objects, if it's a type, look at the 2nd part of the answer)

<editorArea:attribute qualifier="DateCutOffTime" editor="com.hybris.cockpitng.editor.defaulttime">

corresponding xsd:

<xs:complexType name="attribute">
        <xs:complexContent>
            <xs:extension base="abstractPositioned">
                <xs:sequence>
                    <xs:element name="editor-parameter" type="parameter" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
                <xs:attribute name="qualifier" type="xs:string" use="required"/>
                <xs:attribute name="label" type="xs:string" use="optional"/>
                <xs:attribute name="visible" type="xs:boolean" use="optional" default="true"/>
                <xs:attribute name="readonly" type="xs:boolean" use="optional" default="false"/>
                <xs:attribute name="editor" type="xs:string" use="optional"/>
                <xs:attribute name="merge-mode" type="xs:string" use="optional"/>
                <xs:attribute name="description" type="xs:string" use="optional"/>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

(For completion)

As far as I'm aware, defaultEditor is only ever used to define a default editor for a type. Then you need to specify the type for which you want to create a default editor. This also needs to be placed in a .zul file, and not in the regular backoffice config files.

<editor id="textEditor" type="java.lang.String" defaultEditor="com.hybris.cockpitng.editor.defaulttext"/>
Yoni
  • 1,370
  • 7
  • 17