Is there a way in Enterprise Architect to modify elements displayed in InfoView element display by the means of EA API?
InfoView and its behavior is one of the undocumented features in EA API, so it may change without any notice. Following description is based on EA 13.5 build 1352.
The way it is implemented is somewhat weird (a good reason not to document it).
First, where the InfoView data is stored.
InfoView display mode is switched on by adding OPTIONS_duid=InfoView=value:; into field styleex of the table t_diagram, where duid is the short unique identifier of the diagram element (as in field InstanceId in t_diagramobjects) and value is a number, which bits are (MSB to LSB):
x x x x x x x
| | | | | | |_ ICON
| | | | | |___ TYPE
| | | | |_____ STEREOTYPE
| | | |_______ STATUS
| | |_________ PHASE
| |___________ VERSION
|_____________ AUTHOR
So the information about the element display format is stored in the diagram tables (and API object).
The styleEx field contains more than just this information; the information elements in the field are separated by semicolon (;) and their order is sometimes important, so don't touch the rest of this field, unless you know exactly know, what you're doing.
Let's assume we have diagram with DiagramId=12345, element with ElementId=6789.
So switching the InfoView ON and display the icon for the given element on our diagram shall be done like this (VbScript):
dim diag 'as EA.Diagram
dim el 'as EA.Element
dim dob 'as EA.DiagramObject
dim duid 'as String
set diag=Repository.getDiagramById(12345)
set el=Repository.getElementById(6789)
'find diagram object corresponding to the element in given diagram
for each dob in diag.DiagramObjects
if dob.ElementId=el.ElementId then
duid=dob.InstanceId
end if
next
' switch on the Infoview with an icon
diag.StyleEx=diag.StyleEx & "OPTIONS_" & duid & "=InfoView="1:;"
'save it
diag.Update
Notes:
You need to reload the diagram to see the changes.
Use Repository.SqlQuery() function to find the DiagramObject in production code; the example code is way too slow.
If the InfoView information element already exists in the StyleEx property of the diagram, you need to replace it instead of adding a new one.
Related
I'm currently following the tutorial "Creating a custom filter control" in Dynamics 365 for Finance and Operations Development Cookbook - Fourth Edition
I've created the extension to the MainAccount which includes, under NavigationList(Group) -> Filter (Group)", an instance of Combo Box with the following properties:
| Property | Value |
| Name | FilterType |
| AutoDeclaration | Yes |
| EnumType | DimensionLedgerAccountType |
| Selection | 10 |
In Visual Studio's preview, this displays correctly and offers the expected set of values.
I've set my project to be my startup project.
I've set my form extension to be my startup object.
... and then I click "Start".
After some long wait for the page to render, I find the labels for the fields are displayed with short black lines where the input fields should be, but the input fields hardly allow any interaction. I can click on them to select them, transforming them into blue box shapes, but I can't actually type anything into them and the input which should be a drop-down/combo-box for "type" has no visual or functional distinctions from the input for "name" which should just be text.
Is Visual Studio failing to deploy something?
Is there some additional modification needed in my metadata for this to render as expected?
What do I need to do to fix this?
Because you mention that you click "Apply", I think you are in the wrong area of the form.
Take a look at the screenshot from my implementation of the recipe, you can see there are two filter areas on the form. The first is the standard filter experience and the listed fields are based on the ranges set on the query of the form. Those fields are text fields because they allow you to enter filter values which may be different from one possible value. The second area is the one where the two custom filter controls described by the recipe in the cookbook were added. As you can see in the screenshot, the "Main account type" control provides a combo box behavior with the allowed values. If you change a value in on of these two controls, you don't need to click "Apply". Instead, the filters are applied automatically when the onModified event of the control fires.
With thanks to FH-Inway who spent some time screen sharing, it turns out the problem was not with the solution but with my expectations.
I expected the filter fields to simply be displayed and immediately available for use.
However, in actually -- completely counter-intuitively -- the fields, being created as part of the form, are only editable after one clicks the "Edit" button.
Once in edit mode, the fields display and interact as expected.
Is there a way to 'reset' or db entries to delete or something else without deleting all content already translated... (and would that solve the issue?)
In the first go all translation went well, I chose a 'one tree' setup pressing translate rather then copy, but adding and modifying the content over time certain elements where not available for translation anymore ...
at one point the second step in translation asked for the origin language (if I recall well) and trying to resolve I chose another language than the default, now I do not have the choice anymore and the record summary proposes elements from german rather than from my default language (italian) which might be the problem since I can only introduce new content in the default language.
if I try to localize from the list view clicking the language flag, in the language selection field I get [INVALID VALUE("1")] and as only option (Default) [0] to select ...
I use TYPO3 V7.6.13, EXT:gridelements and EXT:t3sbootstrap (the nested CE's where the first to show trouble)
content of my database table sys_language: (my default lang is italian)
uid | pid | tstamp | hidden | title | flag |
1 0 ... 0 English gb
2 0 ... 0 German de
does anyone know good reference or a solution to this problem ?
That sounds like your sys_language records (in yoour root-page, id = 0) are disabled or missing.
Those records make languages available for translation.
The other factor for translation selection is the translation of the current page. You need to have the page translated to a language (given above) to be able to translate any record in that page. That also is neccessary for pages which contain only data.
first check (as suggested by bernd) if your language setup is valid:
do you have a sys_language record for every added language in your
root-page ? (you can control the sys_language table with phpMyAdmin)
is the page translated ?
in my case that was all fine but I needed a thorough cleanup:
I deleted all hidden records in the backend
I activated the system extension 'recycler' and deleted all in the
list (from root-page recursive)
I then checked with phpMyAdmin which records in tt_content where
hidden (and did not show in the backend) and deleted those manually
once I did that the translate request answered perfectly and I could restore the missing CE's translations
note: I still had gridelements showing up in wrong sequence for the translation in the backend but correctly in the frontend, the nested CE's seem though, and of course 'CLEAR CASH FREQUENTLY' to avoid surprises ...
Imagine I have two pages which have exactly the same layout except for the data which always comes from a different model.
With a Javascript view I can code something like this using the OO mechanisms provided by UI5:
+---------------------------------------------------+
| CarsView |
+---------------------------------------------------+
| - defines the page structure |
| - contains no concrete model or uses dummy model |
+-----^-----------------------------------^---------+
| |
| |
| |
| |
+-------------+----------------+ +-------------+--------------+
| SportsCarView | | SUVview |
+------------------------------+ +----------------------------+
| - inherits from "CarsView" | | - inherits from "CarsView" |
| - uses "sportscar" model | | - uses "suv" model |
+------------------------------+ +----------------------------+
The SportCarView and the SUVview are actually used and displayed in the application, the CarsView is never used directly. So in fact it is an abstract class.
This is all fine and understood but how can I do the same (or similar thing) with XML views?
The only method of composition I am aware of are XML fragments which would let me reuse snippets for XML views in other XML views. But this is not what I am after.
Any ideas?
When you're applying XMLViews, I think I would get the controller to take care of the model selection. This is also where this kind of logic is supposed to be happening in my opinion (MVC).
E.g.:
this.setModel(
this.getComponent().getModel(
car === "SUV" ? "SUVModel" : "SportsCarModel"
));
On top of that, you could indeed apply different fragments (as you already mentioned) or play with visible and class attributes and binding expressions to make the views appear slightly different, e.g.:
<Text text="{SuvProperty}" visible={viewModel>/IsSuv} />
or:
<Text text="{= ${viewModel>/IsSuv} ? ${SuvProperty} : ${SportcarProperty} }" />
One word of caution esp. when playing with the visible attribute. If you get the app to construct 100 fields and hide 80 of them, you may understand that it'll be quite detrimental for performance.
I'm new with Magento2, I have a problem trying to add a new filter to the search module.
For example:
I created an attribute that names: "flag" of type "text field", that will be invisible in storefront.
I have 3 products:
name | description | flag
Product1 | Description1 | 1
Product2 | Description2 | 1
Product3 | Description3 | 0
When I type in the search box "product", by default Magento2 returns all the products, because all matches with the
search, what I want is add a filter to the search, that only returns the products with flag = 1, so it will returns only the product 1 and 2.
I don't know what is the exactly block or model that I must override.
Thanks in advance
You can add this attribute under search form as a hidden field with the value you want to filter with. When user click on the search button it would perform the search by adding one more parameter in the query string i.e ?q=product&flag=1 and you will get the expected result. With this way you don't need to overwrite any block or controller. But you need to overwrite the default search form. Below URL can help you overwriting core magento files.
Reference URL: https://magento.stackexchange.com/questions/84550/magento-2-override-base-view-file
Note: This technique will not work with the auto search. In that case you need to overwrite core search blocks.
Let me declare... I am a newbie at this filling in the spot temporarily at the moment.
Problem: Develop a application summary report using SSRS 2008( the completed product should be a RDL file, which can be deployed to the SSRS Server) for the online application completed by the applicant.
A little bit of background: The applicant fills in an online application using our web application, where he completes required and optional fields. The app summary report, is provided to the applicant filling out the application as a summary of his app and should display only the fields completed by the applicant.
Example:
Lest us say John Smith lives at
Add Line 1: 123 Any Street
Add Line 2: Null
City: Some City
State: Some State
And his spouse Jane Smith lives at
Add Line 1: 321 Any other Street
Add Line 2: Apt A
City: Some City
State: Some State
So in the report, the null field (Add Line 2) should not be displayed for john but displayed for Jane. When I say not displayed, meaning, the field label should be hidden the and report should adjust the spacing to not show a skipped blank line in the report.
We have about 1000 such fields that can or cannot be answered by the applicant. So the report should be generic and use as much of inbuilt functionality as possible.
If needed, an Xml containing key value pairs of fields and responses. this Xml can be made so that it can contain all fields and unanswered responses as null or only answered responses. i am not sure how this would help but putting it out there if needed.
I have done simple reports, but i have no idea on how to approach this situation. Any help will be great help.
Thanks.
I have had a similar situation and ended up using this approach within a textbox. Taking your example above, you would have this setup for your fields within the textbox, with the [ ] being fields from the dataset:
Name: [first_name] [m_name] [last_name]
Add Line 1: [address_1]
[expression]City: [city_name]
State: [state_name]
Zip: [zip_code]
Note that the expression and the City have no space between them. What happens is the city will be on its current line when [address_2] is null and move to the next line when there is an address line 2, using this expression:
=IIF(IsNothing(Fields!address_2.Value), "",
“Add Line 2: “ & Fields!address_2.Value & VbCrLF)
When the IFF is true and [address_2] is null the expression will write “” (Nothing) and [city_name] will remain on the same line. When the IFF is false and there is an [address_2] the label “Add Line 2” will be written along with the value of [address_2] and the [city_name] will be moved to the next line by “VbCrLf”. A more robust method that handles if [address-2] has a string of length 0 or a few spaces is this expression:
=IIF(IsNothing(Fields!address_2.Value) OR Len(Trim(Fields!address_2.Value)) < 1, "",
“Add Line 2: “ & Fields!address_2.Value & VbCrLF)
This stops the strange double space when a field is empty but not null; something similar woks great for middle names. Hopefully this is helpful to you or someone else reading this post.
This was really simple...
Lets say we have a report which is in a tabular format using rectangles and textboxes,
--------------------
|FIRST NAME : AAAA |
|LAST NAME : BBBB |
|PHONE: XXX-XXX-XXXX|
--------------------
Use the following expression to control visibility of the controls that you want to hide
=IsNothing(First(Fields!WorkPhoneNumber.Value, "DataSet1"))
Make sure all the controls are of the same height and width. I created a row with just 2 controls (the label text box and the value text box) and set their visibility using the value of the value text box as described in the expression above.
Since the row had just two controls the hiding the would auto adjust the layout as i desired.