on 12-19-2017 10:26 AM
Hey guys,
I want to open a wizard when I'm entering numbers in a textfield and pressing enter which is inside my editor-area inside the backoffice.
Is there any way to open a wizard programatically? If not what would you guys suggest to work around with?
Cheers, Daniel
Hi ,
If it is your editor, then you are half way home. If not, then you would have to extend the existing editor and change configuration so that it is used in the attributes you need. However you achieve it, you will be at the point that you have your own editor renderer there you can add a`key_pressed` listener on input and inside the listener you would have to send a socket message via some socket that you define in definition.xml
of your custom editor. Then in mesh-up you need to connect your editor's output socket with Configurable Flow instance.
Cheers, Jacek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
is it possible that if I enter the code inside the Textbox and it equals a reference ID of an image that it is refreshing the section itself?
I've got a multireferenceeditor where I show the linked images to the product so if I add the image via the Textbox is it possible to refresh the section so the new added image gets shown? Can I implement that inside my custom editor?
And also I'm unsure of how to configure the sockets to the wizard / the editor inside the section properly? My sockets are called
<sockets>
<input id="cavokMediaInput"/>
<output id="cavokMediaOutput"/>
</sockets>
cheers,
The very first idea I would have is to take a WidgetInstanceManager
from EditorContext
(it is available under com.hybris.cockpitng.components.Editor#WIDGET_INSTANCE_MANAGER
key), then get a Widgetslot
out of it and call initialize()
method - it would make an editor area reload itself.
It may not be the best idea, but I would try to go this way. You may always get deeper in this direction and try to request just a section reload.
Cheers, Jacek
You need to connect a template to your editor:
STUB_your.editor.definition.id
-> any ConfigurableFlow
marked as template (i.e. configurableFlow
).
Here you have an example from OOTB mashup:
<widget-connection sourceWidgetId="STUB_com.hybris.cockpitng.editor.defaultmultireferenceeditor"
outputId="referenceEditorOutput" targetWidgetId="configurableFlow" inputId="context"/>
Thanks for the reply, it seems like i'm doing something wrong cause it's not opening when i'm triggering the Enter button.
Editor ID:
<editor-definition id="ecx.io.prem.pim.backoffice.widgets.renderer"
Widget Connection:
<widget-connection sourceWidgetId="STUB_ecx.io.prem.pim.backoffice.widgets.renderer"
outputId="cavokMediaOutput" targetWidgetId="cavokMediaRelationWizard" inputId="contextType"/>
Code:
editorView.addEventListener(Events.ON_OK, new EventListener<Event>()
{
@Override
public void onEvent(final Event event) throws Exception
{
sendOutput("cavokMediaOutput", context);
}
});
Hi I couldnt reply on your comment so I'm writing another answer, this is the defitionion of my renderer
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<editor-definition id="ecx.io.prem.pim.backoffice.widgets.renderer"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.hybris.com/schema/cockpitng/editor-definition.xsd">
<name>cavokMediaWizardTextField</name>
<description>Textfield for searching Cavok Media and opening a Wizard</description>
<!--The type of the value this editor is capable of handling.-->
<type>java.lang.Object</type>
<!--this is the renderer class of the editor. It is responsible for creation of the editor view.-->
<editorClassName>ecx.io.prem.pim.backoffice.widgets.renderer.PremCavokMediaSimpleTextFieldRenderer</editorClassName>
<sockets>
<input id="cavokMediaInput"/>
<output id="cavokMediaOutput"/>
</sockets>
</editor-definition>
and I changed cavokMediaRelationWizard to configurableFlow.
The thing is it opens a wizard now but nothing gets displayed. Because I'm only submitting a string basically. Or should something get displayed when I submit the context? But context is just an object and the wizard inputsocket context needs a map
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.