Stable ID's in fiori launchpad - sapui5

I am using a FlexColumnLayout for my app.
In the mid column I need to access a controll of the begin column of the FlexColumnLayout. Here is the problem:
Since it is a different view I cannot use
this.getView().byId("myId")
My first solution was to use stable ID's, by giving the views (XML) IDs.
Like that I could use:
sap.ui.getCore().byId("application---viewId--myId")
At first it worked just fine, but now that I integrated my app into the fiori launchpad the first part of the stable ID (the part before "viewId") changed and when I transport into productive it will change again.
Is there a way to access the mid column controls without sap.ui.getCore().byId?
Or is there a way to load the first part dynamically so I don't need to change my IDs when tranporting?
Sadly I don't know how to reproduce a Launchpad for testing purposes, but for those who want to test their ideas about my problem, my FlexColumnLayout is build just like in the DemoApp: https://sapui5.hana.ondemand.com/#/entity/sap.f.FlexibleColumnLayout

Ok guys i found a solution:
this.getView().getParent().getParent()
returns the FlexColumnLayout. This has a method called "getBeginColumnPages", which returns an array of the views representing the begin column. Now that i can access the view in which my control is found, i can access it with the sap.ui.core.mvc.View.byId() method.
Now I have
this.getView().getParent().getParent().getMidColumnPages()[0].byId("myId")
Since the doulbe .getParent() doesn't seem to be ideal, please post a better solution if you know one : D

You have to use createId() function, this will return the complete ID of your control.
this.byId(this.createId("myid"));

Related

Why does the Google Tag Manager automaticalls has a Trigger event for gtm.load for my custom variables?

So I want to Trigger my Tags when the user accept cookies, obviously.
I tried different approaches, JSVariable, Custom JS, First party cookie and datalayer variable.
Now I have them all set in Triggers, for example if the JSVariable is true or if the first party cookie contains the cookie value I set, or the datalayer variable contains filled.
Now in Debug mode these Triggers actually seem to work. They all get Ticks under firing triggers, but the Tags don't seem to Trigger because I get another Trigger for some reason which states
gtm.load equals [variableName] (for example: gtm.load equals myJSVariable) and it always has this red X.
I just don't seem to find an answer to this problem.
Thank you all very much
So if anyone experienceses something similar (in case I am not the only dummy):
When you type in the eventname, it is about WHEN to look for your variable basically.
So for example you would enter gtm.load, when the site has been completely loaded. Then GTM would look for your CustomVariable

TTeeGrid is not displaying the data at runtime using data from REST

I created a simple RME for TTeeGrid, a descendant perhaps of TGrid in Firemonkey. As shown below, the data are displayed at design time but not at runtime except the headers.
I've been breaking my head over this for weeks already but not luck.
Let me know if you need more details but what you see in the image are all you get.
I just need help to have the data displayed at runtime as shown in the design time.
UPDATE 1
This issue is not the case with TPrototypeBindSource. The data shown in the design time are displayed at runtime. Something is wrong somewhere.
I've never used the TeeGrid before, but the following worked fine
first time for me in Delphi Tokyo:
Download the TeeGrid trial from Steema.Com & install.
Create new multi-device app and place a TeeGrid and a FDMemTable on the form.
Load FDMemTable1 with the file Parts.Fds from the Delphi samples Data directory. Note, I did not then create any FieldDefs as I mentioned in my comment earlier as what I'm describing works without them.
Set the DataSource property of TeeGrid1 to FDMemTable1. TeeGrid1 immediately
creates columns for each of the Parts fields and populates them with data - see
screenshot below. I don't ordinarily include screenshots but in this case thought
I would as what I got was so clearly at odds with what you've reported.
Your TeeGrid etc are obviously more complicated than mine. so the best I can
suggest is that you backtrack to step 2 and see if you can replicate my result
with your data (either at design time or run time). It might be worth loading
your FDMemTable with some data at design time, as my impression is that live bindings
is less grief-prone when the datasource has some data.
Incidentally, fwiw the results of my own attempts to set up live bindings even with a regular TGrid have been rather patchy, until I discovered that instead of messing with the LB components myself, simply starting with a fresh TGrid, right-clicking on it and leaving the Live Bindings Wizard
to do its stuff consistently works fine.

Protractor Implementation in Angular2 without using ids

I have application in Angularjs2, and developers have not been using ids into it. Now I have to implement the Protractor on same application. Is there anyway to implement the Protractor without using "absolute XPath"?
Thanks in advance!
Please find a huge range of locator-possibilities on the official Protractortest API Page
Every element on a page needs to be uniquely identifiable... else the page wouldn't work, no matter which technology. Therefore with the help of any of the above provided locator-possibilities you'll always find the element you're looking for.
And there is never a need for XPath, except for this only one. (though there is an parentElementArrayFinder introduced in the meantime, so not even that one exception is valid anymore)
UDPATE
If you could use XPath, you can for sure use CSS-Locators.
Here some examples for locators:
$('div.class#id[anyAttribute="anyValue"] div.child.somewhere-below-div-point-class')
element(by.cssContainingText('div[data-index="2"]', 'select this option'))
Or as a specific example the "Learn More" of the "Tree List" section of https://js.devexpress.com/ :
treeListSection = element(by.cssContainingText('div.tab-content h2', 'Tree List')).getDriver();
learnMoreBtn = treeListSection.element(by.cssContainingText('a.tab-button','Learn More'));
learnMoreBtn.click();
Those are just examples, but there is always a way to do it.
If you provide some example-HTML in your Question, I can direct you towards a solution.
UPDATE 2
For getting the Parent Web Element, one could use getDriver() as well

Is it possible to use a control without putting it on a form in VB6?

I'm pretty sure about the answer to this, but I'm trying a variety of things to get a very stubborn project to work. One idea was to try to run code through a control without defining it on a form.
So, for example, my original code looked like this:
frmProcess.MyViewer.MaxPageSize = 100
frmProcess.MyViewer.ResetPages
frmProcess.MyViewer.AddPageToView "C:\TestPage1.txt"
I've changed it to:
Dim objViewer As MyViewer
objViewer.MaxPageSize = 100
objViewer.ResetPages
objViewer.AddPageToView "C:\TestPage1.txt"
I get an error window with "Run-time error '91': Object variable or With block variable not set".
But there doesn't seem to be a way to 'set' this control. Is this just impossible, or is there another way to do it that doesn't require a form?
EDIT: I ended up abandoning this entire path of activity, as an alternate solution was found that got around the problem I was having with this form freezing. I don't want to delete this question in case someone else comes along and can benefit from the answers, which are potentially useful.
Try this on a form.
Dim objViewer As MyViewer
Set objViewer = Controls.Add("MyViewer", "MyViewer1")
objViewer.MaxPageSize = 100
objViewer.ResetPages
objViewer.AddPageToView "C:\TestPage1.txt"
I've had similar situations in the past. If all else fails and you have to use a form you can do something crude like
1) Set the .Left property of the control to a negative number (like -10000) so the control doesn't appear on the form, the user can not see it
2) Make the entire form not visible..
ActiveX controls normally expect a number of services from their containers, for example persistence. They are also "packaged and marked" in ways that set the kinds of instantiation they support.
See Introduction to ActiveX Controls.
While it is perfectly possible for a control to be created in such a way as to make many of the available services optional, most controls are created from template code that requires a number of them. And most controls that are "visible at runtime" are going to require container services.
However that doesn't mean a control can't be designed to support containerless instantiation. A well known example of such a control is Microsoft Script Control 1.0 (MSScriptControl.ScriptControl) which can be used either way.

Since User Info & Address were used at the time of Signing Up & Updating Profile, so How to design GWT Gui to reuse the components & action?

Ok, Here is the problem.
At the time user signup, user need to provide info such as:
-Email:______________ -UserName:____________
-FName:______________ -LName:_______________
-Address:____________ (User can have option to update Address lately)
....
-Captcha:__________
[Sign Up] [Reset]
Now suppose that user already got an account & they want to modify their info, then the Gui Could be 40% similar to the the above one.
-FName:______________ -LName:_______________ [Update Name]
-Address:____________ [Update Address]
....
My question is how to design GWT Gui in such a way that we can reuse the Gui components and the Action in both situations?
Maybe put all GUI into 1 page & have 2 different params: 1 for handling Signing Up Ex: #profile;actionParam="signup", & the other for Updating Profile Ex:#profile;actionParam="modify".
We can also use PresenterWidget but I think PresenterWidget is for using the exact same code everywhere, but in my case the Gui need to be modified a bit.
In Java we can do like Parent and Child Inheritance, but I am not sure if we an do similar things like that in GWT?
Can u find a better solution?
You can use the exact same view (widget) and simply hide some fields based on your criteria. You can also group these extra components in one container, so you can hide/show them with a single call:
.newUserPanel.setVisible(user == new);
You can extends widgets in GWT - all of the "standard" widgets extend and implement something - but in this use case the benefits are probably too small to justify two separate views/widgets. But it's possible if you decide to go this route.