How can i link to attribute of an instance of a class - uml

In an EA model I have a class. The class defines an attribute. I want to be able to have an instance of this class (an object) with the attribute visible on a diagram and the ability to link specifically to that attribute (as in the Link to Element Feature option).
Is it possible?

Yes and no. You need to set the run state of the object
Once the following dialog is completed, it can look like
The value is free text and not linked to the original attribute, but better than nothing.

Related

How to know when a property has been updated from it's connected attribute?

Given:
#property({type: Boolean, attribute: 'some-attr'}) someAttr = false;
I was expecting to see updated being fired once 'some-attr' value gets updated in the DOM.
However, updated doesn't get fired at all.
Is my expectation wrong, or should I set things up differently?
Looking at Elm's discussion of properties vs attributes, the documentation of the Html.Attributes module's attribute function, and the Elm documentation on custom elements, I am pretty sure, that this is caused by simply binding an elm expression to attribute some-attr of the LitElement based custom element. I.e. the DOM attribute will always be present and hence the corresponding property always be true.
The default converter for Boolean (activated by providing type:Boolean to the decorator) mimicks the behaviour of HTML attributes used as flags (e.g. disabled on an <input> element): If the attribute is present (no matter the value), the flag is set (true). The implementation is really straight forward, if you want to look at it in the sources: https://github.com/Polymer/lit-element/blob/master/src/lib/updating-element.ts#L163
I see these options for your problem:
Implement some extra logic in Elm to add / remove the presence of the attribute.
Create your own attribute converter for the LitElement based custom element.
Use another default converter (e.g. for String, the "default" default converter) and implement the custom logic inside the LitElement (e.g. using a derived value).
Of these 3 options, I would generally recommend the first one, as your custom element then still behaves naturally, i.e. if some-attr should be a flag (boolean attribute), then following which HTML semantics, it should be defined by its presence, not its value. This allows you to re-use it in other projects without surprising other developers.
That being said, there may of course be project-specific requirements, that are more important. E.g. if you only use this custom element in this one project with Elm, your road to success may be faster going for options 2 or 3.

How to modify Hybris Backoffice refocus functionality

I'm trying to modify the backoffice refocusing functionality. Not sure exactly where the behavior is taking place but I believe the class is the FocusUtils.java (com.hybris.cockpitng.editor.util) This util class is used in the DefaultEditorAreaValidationHandler.onEvent().
The action takes place in the summary-view of a product in the "Data Quality" section. Here the user can see what fields are missing or are needing to be filled. They can click on the attribute listed and the editor will refocus on the selected field. Currently the refocusing is working with the OOTB implementation BUT it cuts off the label to the fields at times. I would like to slightly modify this util class (override) and use the custom implementation instead.
Field label is cut off
What should be dispalyed instead:
Field label is displayed correctly
The only way to do this from what I can see is by modifying/replacing the widget implementation that is using this logic. Basededitorarea widget (com\hybris\cockpitng\widgets\baseeditorarea) and specifically having to override bean definition of the below bean and additional classes as well.
<alias name="defaultEditorAreaValidationPopupDelegate" alias="editorAreaValidationPopupDelegate" />
This is the only bean I see that is defined in the backoffice-widgets-spring.xml that eventually touches this focus logic. This is like the starting point. Ideally, it would be nice to just make changes to the actual util class or replace it with a custom one rather than having to duplicate many other classes.
Does anyone know if this is the correct approach to doing this? or if anyone has any alternative suggestions that would be great.

Where is the object created for a class that extends Pane?

I am new to JavaFX. If u look at the attached code, you will see, we are not creating object explicitly while doing property binding; i.e. we see:
widthProperty.subtract(10);
As far as I can understand "this" is used here. But how?
Will it be a LinePane type object or a Pane type object?
Bye.
As it turns out, there is an implicit super call to Pane (the super class). That's why there is implicit "this" while binding. Thanks for the comment (it cleared).

How to find programmatically (SSJS) what item of the underlying doc the UI input control on Xpage is bound to?

The task is that I need to update the field of the underlying doc only given the id of the edit box or the combo box on the Xpage. All that has to happen before the page is actually saved. Cannot find any methods in UIComponent and subclasses that allow to find out the name of the actual doc item the current XSP input control is bound to. Plz help.
The following will get the Expression Language binding for a component with the id inputText1:
var inputText1:com.ibm.xsp.component.xp.XspInputText = getComponent("inputText1");
var valBinding:com.sun.faces.el.ValueBindingImpl = inputText1.getValueBinding("value");
return valBinding.getExpressionString();
This will return e.g. "#{document1.myField}". Using basic string parsing, you should be able to get what you want.
Like Oliver, I'd be interested to hear the use case. It's not something I've had the need to use.
As a bonus, try looking in the Local folder in Package Explorer at an XPage / Custom Control. You'll see all the getters / setters for components on your XPage, which will give you hints for what properties and methods are available. F3 and F4 are very useful for seeing all methods/properties and class hierarchy.

How to get state of checkbox of one class in another class vc++ mfc

I am developing MFC based SDI application in VC++ derived from CFormView class.In my dialog I have a checkbox. When this check box is clicked or not I want to get the state of this check box in main class say CDemoView.cpp and use that particular state for some calculations in another class say OServer.cpp which is a C++ class. I tried using SetCheck(), GetCheck() functions and I am failing.How can I get the state of checkbox in my other class??
Thanks in advance
Take a bool variable in the class.set its state according the checkbox.access that variable in other class to get the state of your check box.
The "other class" needs a variable that will let it access the view object that contains the check box state. Something like
if (pview->m_IsChecked)
or even
if(*pbool_IsChecked)
Initialize this pointer by passing the appropriate address to "other class" in its constructor or in a function you add for this purpose.

Resources