openui5 googlemaps xmlview - sapui5

I am currently building an, where i need to add a maps option. I found the openui5-googlemaps option which fitted my needs. Currently i managed to get the marker to work in an xml view without any problems. However I want to add directions with waypoints similar to what you see here:
DirectionsWithWaypoints
But i can't figure out how to build this into my XML view. I tried to add this via the controller to the view and just add the myMap element to the page. That did show the map, but it didn't show any directions, i looked at the binding and i had the correct binding.
If i added the myMap to the context of the HTML file instead, then it works.
See the code here
Can someone help?

one trick to finding out how to make something work in an XML view is via the SAPUI5 Diagnostics tool, it generates the xml for you
<ctrl><shift><alt> + S
opens the SAPUI5 Diagnostics tool, then
-> Control Tree -> Export -> XML
here is an example using generated xmlview

Related

How to access the view of another plugin in Eclipse?

I'm developing an Eclipse plugin / extension of another plugin. For this I need to access the information displayed in a view by the other plugin.
Is there a way to accomplish this? I've only found how to do this if the view I want to access is created by the plugin I am currently developing
(using workbench.getActiveWorkbenchWindow().getActivePage().findView(MyView.ID);)
but this doesn't seem to be suitable in my situation as I do not know the ID of the view and do not have the MyView object.
Edit: The view contains a table with Strings / ints which I need. I guess it's also important to note that I have parts the source code of the other plugin available, so the class of the view.
Edit2: Because I have the source code of the other plugin, I was able to solve this - see comments.

Is it possible to create your own drag and drop Mailchimp template?

I'd like to create a custom drag and drop template so I can increase the design possibilities without losing the functionality. I can't find anything in their documentation.
I was hoping to create something like this, not sure if I'm missing something obvious but I can't find a drag and drop that allows for the different coloured background with columns too.
I could use a block of code but I can't edit the css styles so it wouldn't be responsive for mobile and also not very friendly for those who don't know html.
Rather old question, but to who it might be helpfull:
If you code your own template and upload it to Mailchimp you lose the 'drag & drop' system/UX interface with the different blocks. You are able to create repeatable blocks but then it works with a dropdown list. This is (in my humble opinion) not that user friendly and takes a while before you fully understand how to use the dropdown. I had to explain it to a client earlier today and took a while before they understood it, so I decided to write them a manual for it.
But the design you want to create should be possible to make with a standard MC template. In the 'design' tab you will find settings to control background colors etc.
Still not possible, answer from the Mailchimp support: "At the moment, it's not currently possible to code a drag and drop template completely--one of our drag and drop template layouts will need to be selected, but you can drop in Code blocks to get a little more control over the styling of certain sections."
Though, if it's any help, it is possible to fully custom code your own template, and then add in mailchimps special Template language to the template to open up sections as editable within the campaign builder--or even duplicate certain sections of content. It's not quite the same as the drag drop templates, but adds similar functionality. More info on working with template language can be found here: https://mailchimp.com/help/getting-started-with-mailchimps-template-language/
I know this is an old question, but while searching for this myself I stumbled upon a solution posted here.
Basically it is possible to code your own drag n' drop template, but the solution has not been documented.
Find one of the Mailchimp templates (either one of the basic templates or a custom template from the 'Themes' menu.
Use 'Inspect element' and copy the source code of the iFramed html-email.
Paste in your preferred HTML-editor and modify as intended
Create your own template from the 'Paste in code' mode
If you want custom modules to be added by default, edit using the menu 'Edit design' in the bottom of the screen.
Save and exit :)
I found part of the answer on another topic: [Is it possible to code drag&drop templates for mailchimp?
If you add the following code into your main content div or td it will enable the drag and drop block editor:
mc:container="body_container" mccontainer="body_container"
example:
<div mc:container="body_container" mccontainer="body_container"></div>
This code will add a block editor region to the preheader section:
mc:container="preheader_container" mccontainer="preheader_container"
For the header:
mc:container="header_container" mccontainer="header_container"
For the footer:
mc:container="footer_container" mccontainer="footer_container"
Note: It doesn't seem to matter what you call the mc:container. Creating a new container with a different name worked. Although using just mc:container tag seems to work at first by itself, the mccontainer (no colon) tag is required for it to save properly.
You can create your own drag and drop template you need to add the following into your html coded template where you want the 'drag and drop' feature to exist.
<div id="templateBody" mc:container="container_name" mccontainer="container_name" class="tpl-container">
<div mc:block="3502204" mc:blocktype="text" mcblock="3502204" mcblocktype="text" class="tpl-block"></div>
</div>
This can be repeated in your code multiple times for multiple insertions. I could not find documentation to indicate if the container name or block number needs to be unique, I did make it unique in my template.

SAPUI5 - Basic info - how to manage UI elements in view.js?

experts,
These are two very basic connected questions.
I'm studying SAPUI5 and I cannot find means to position my UI elements on the screen.
In my view.js file I create, let's say, a button, a datepicker and a text field.
If I do something like:
aControls=[];
<Define the button - oButton>
aControls.push(oButton);
<Define the datepicker - oDatePicker>
aControls.push(oDatePicker);
<Define the text field - oText>
aControls.push(oText);
return aControls;
then I get all three elements positioned in a row one right after another.
I cannot use css, because I pass all those objects in one array and all of them are placed into a common div on index.html.
How do I position these? A link to any good tutorial/examples is very welcome.
Also, how do I refresh UI elements?
For example, I have situation, when on button press I make a call to the server, get response and put it into a using something like:
response.placeAt('some-id');
The button is created in the view.js and the call is processed in controller.js.
The response is added every time I press the button and I have no idea how to replace the old response with the new one.
A good link is very welcome.
Thanks.
There are a lot of layout controls of SAPUI5 you can use: Grid, HorizontalLayout, VerticalLayout, MatrixLayout,etc. You can check the examples and see how you need to layout your views.
You are currently doing UI5 JS view which implements createContent method to define views, this is one approach. Another common approach is to use XML views, it is declarative and more straightforward, also needs less code. See this simple example in JSBin of defining XML view and controller to refresh UI.
SAP UI5 is all about Model(JSONModel/ODataModel)-View(JSView/XMLView)-Controller. You are highly recommend to read this MVC example, though it is based on SAP UI5 mobile, the content is relevant to SAP UI5 desktop as well.
Hope you will get some hints.

How can I only display projects inside a treeviewer eclipse plugin?

I am making a tree viewer in Eclipse which would be used to pick a project and then I would find out the location of the project and zip it up.
I can currently display a tree which shows all the projects but it also allows you to expand the tree.
I am doing this in a wizard so I am unable to any dialogs.
I think I would need a filter but after using Google for a while I was unable to figure out how I could do this.
This is how I am currently making the viewer.
TreeViewer view = new TreeViewer(composite,new WorkbenchLabelProvider(),new BaseWorkbenchContentProvider());
view.setInput(ResourcesPlugin.getWorkspace().getRoot());
It's showing you exactly what that content provider is written to show.
The short answer is to setInput(ResourcesPlugin.getWorkspace().getRoot().getProjects()) and use the ArrayContentProvider with a ListViewer rather than the TableViewer.
The long answer is that the content provider you were using returns both the top level elements for the tree control using getElements() and any resource's children via getChildren(), and your case is not interested in the results of getChildren().
Projects are never nested so you only really need a TableViewer to show them. You can get the list of projects using:
IProject [] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
The same label provider will work.

Show annotation in custom views

First off - I'm not using MapKit. I'm using my own controls for something entirely different. But the annotation view is something I'd like to mimmic. I've seen other applications with similar views to indicate state or actions on other controls. However, scanning through the class library I can't find a view already in the SDK. Do I have to create my own custom view that mimics this look and behavior or does the iPhone provide a standard way of showing these annotations?
You have to create your own (or find an open source implementation). The annotation views are actually drawn by the map view so they don't work outside of a map.
Well I couldn't find an open source solution so I built my own. To save anyone else the trouble, the source can be found at
http://github.com/appsinyourpants/Pants-Framework/tree/master/Classes/Views/