What does widget-connection mean and how it works? - sap-commerce-cloud

I am learning hybris and I am stuck at widget creation. While creating a widget there is a tag , what does it do and why it's used?

Let's cover the basics first:
in the Backoffice, everything you see is a widget
widgets declare so-called "sockets". Widgets can send and receive events on sockets (the same idea as "signals and slots" from Qt, for example)
And now you may ask yourself:
How can I configure which widgets sends data do which other widget?
And that's where widget-connection comes in. With this tag, you can define that the data/event emitted by widget A on slot A1 is received by widget B on slot B2, for example.
Check out the "Backoffice Framework Architecture" page on help.hybris.com and all the sub-pages underneath it for the in-depth explanation for all Backoffice concepts

Related

Flutter Desktop:Best Practice for Persisting SideNavigationMenu Between Routes?

Background:
  Since build v2.10.0, Desktop Support has been introduced into Flutter Stable Channel.
  I am trying to develop a Desktop Application with it, achieving an adaptive split-view
Situation
  As it is illustrated above,I'd like a customized(Arbitary,Drawer-Like) sidemenu widget to be FIXED (Undismissable) in adjacent to the root navigator of MaterialApp.When a new route has been pushed into the route stack,I need the hero animation only covers the content part and leave the SideMenu untouched.
  Since MaterialApp hold the entire navigator (Have not find out a way to replace the root navigator or wrap it with any other container), I cannot customize the MaterialApp Layout.
  The main consideration why I don't want to put SideMenu out of MaterialApp is that I want to use the whole material things for SideMenu building which requires context information such us MediaQuery, Directionality,Locale etc... And I want there only one entry to setup Material-relationed configurations to keep the style consistancy of the whole design.
In Short
Split Layout
Customizable Persistant SideMenu
No Hero for Side
Official-Styled Code Pattern
Question
If it's possible, I do not prefer modifying any source code of official packages.
How to achieve this in a Flutter/Material way?
Maybe MaterialApp.build could be helpful?

Making and Object uniteractable

So I have a part of my game where the character is selecting an area of the map. And it opening up a panel. I have made it so that happens but an=m now stuck on the other part of it. I want only certain area of the map to be intractable, so that I can bar the player from selecting areas of the map that they aren't ready for. I have no idea how to make game objects in the game uninteractable. I have looked on Stack overflow, Youtube an d the Unity API to no success. Can someone help me with that.
How to make things un-interactable will vary depending on your situation. I'll be presuming that you're map is broken up into a grid of sorts.
The basic setup would involve a bool, probably called 'CanAccessZone'.
Then you'll need a class, to store any access info and popup logic, by popup logic I mean make the element either non-interactable or show a popup, with the shown popup being dependant on 'CanAccessZone'. This class can then be set up by your Map class when the level is loaded, or you could let the popup class grab the necessary values from the Map class.
If you're using Unity's UI buttons for the map pieces, then you could set interactable to false, until you want to let the player access the zone. If you want to display a popup informing the player that they can't access the zone, then your button will be interactable, but the click will delegate to your popup logic method.
It's a similiar principle if you're using gameobjects as buttons. You'd be using any of the OnMouse events to handle click events. https://docs.unity3d.com/ScriptReference/MonoBehaviour.html
Hopefully this'll lead you in the right direction.

Tootip and signal of Gio.MenuItem

Below are two questions on the same component:
Which signal is triggered when the mouse passes over a Gio.MenuItem?
How to implement a tooltip for Gio.MenuItem?
Gio.MenuItem is a direct descendent from GObject.GObject (See https://lazka.github.io/pgi-docs/Gio-2.0/classes/MenuItem.html). It does not have any signals itself, and only receives a notify signal via its descent from GObject.
As Gio.MenuItem is not a widget, it does not receive any signals from the GUI. It only represents data (opaque data at that).
I suspect you want Gtk.MenuItem, which is the visual component.
EDIT It seems the widget you are after is Gtk.PopoverMenu. Just to be clear, Gio.MenuItem is not a visible item, which is why I replied as above. Gtk.PopoverMenu is a widget (widget = a visible item).
PopoverMenu is the visible widget, and you can see how it fits together with other widgets. It inherits from Popover, which inherits from Gtk.Bin, Gtk.Container and finally from Gtk.Widget.
So, you have all the signals from those widgets, but those are for the 'complete' Gtk.PopoverMenu, not for the individual items.
According to this definition, the individual items are Gtk.ModelButtons, so you might be able to access them that way.
The solution to get this was much further than I thought. I always suspected that the Devhelp's menu could not be built using GtkPopoverMenu because my OS uses gtk 3.14. The solution involves a totally new concept of running an application, proposed by Gtk.Application interface and the Gtk.Action features. These "new" concepts can be studied in the following places.
http://python-gtk-3-tutorial.readthedocs.io/en/latest/application.html?highlight=Gtk.Application
https://wiki.gnome.org/HowDoI/GtkApplication
https://github.com/Programmica/python-gtk3-tutorial/blob/master/_examples/application.py
Apparently tooltip features are not available for this menu type.

Who is calling VisualStateManager.GoToState behind the scenes?

I am a newbie to xaml and windows app dev so sorry if this question might seem silly.
I created a textbox and in the designer I right clicked it and selected edit template=>edit a copy and put it into my custom dictionary.
In the control template for this textbox I saw visual states like disabled,focused and so on. And I modified them and run the mobile app and observed that my changes work like changing border color when textbox is focused.
But in order for this to work somebody has to call
VisualStateManager.GoToState("Focused")
when the textbox is focused so who is calling this because I don't see any visual transitions in the control template so how is this happening?
The code in the control itself is calling VisualStateManager.GoToState(...) .
When you start implementing your own custom controls, you might subscribe to events you have available and transition states based on your own logic. Here is an example of a custom control with its own two custom states.
https://github.com/xyzzer/WinRTXamlToolkit/blob/master/WinRTXamlToolkit/Controls/WatermarkTextBox/WatermarkTextBox.cs
XAML is a compiled language, and if you've looked extra close, what happens under the hood, is that the class behind your xaml has the same namespace as your xaml code.
This means (for no practical purpose) that compiling your program turns all of that XAML into C# code before then going over to MSIL and eventually execute as a binary program.
Much of the state changes that happen are event based, and TextBox, like all other user controls, will transmit a message and listen to messages. The Page that contains the TextBox will probably be the one that transmits a state change whenever one of it's children gets focus, and as a good control, the TextBox listens for this event and reacts to it.

Swapping ActionBar items when displaying different Tabs and Detail Views

this is not a technical question, but one for advice regarding the best practices in designing an Android tablet UI.
I've got my concept of an Android Phone app pinned down.
The first activity (master view) launched contains a tab bar with three fragments from which the user can launch detail view activities of different sorts.
Both the master-view activity and the detail-view activities have actions in their action bars. Different detail views have different action items.
My question is: How should I organize and display the action items on a tablet, where an activity combines both views side by side?
The problem is the unified action bar for both the master-view fragment and whatever kind of detail fragment is shown. I do not think it is a good idea to start messing with the contents of the action bar whenever a different kind of detail view is opened.
The Android Design Guide does not tell you much on that front. There is a sample of a Contacts app in the "Multi-pane Layouts" section, but it does not actually deal with the problem. It evades it, by putting the single relevant action as an icon inside the detail view fragment.
Any advice with regards to best practices and references are appreciated.
I would suggest leaving your master details icons in the action bar, whilst putting your details view icons in another view/area within the details fragment.
My reasoning would be that icons in the action bar affect / are associated with the whole app / view on screen. Whilst your details icons only affect the details view and therefor should not be in the action menu when showing multiple fragments.
I guess you will have to see how the designs look..
I am not a fan of the action bar icons being changed from within the same activity (even if it contains multiple fragments), however when you load a new activity (like in your phone design) then I say yeah throw them in the action bar.
If I understand your question correctly, which I think is basically a question of how multiple Fragments (i.e. when on a multi-pane layout such as on a tablet) should contribute to the single ActionBar, it's quite straightforward and it is actually briefly discussed in the documentation here. Essentially, you can have the multiple Fragments all contributing their own menu items / action items to the single action bar, via some simple API calls.

Resources