routing,dialog,sapui5,openui5 , SAPUI5/OPENUI5 - Routing with Dialogs


SAPUI5/OPENUI5 - Routing with Dialogs

Question:

Tag: routing,dialog,sapui5,openui5

I´m currently stuck with the combination of routing and dialogs. I have a view with list elements and when I click on an element in the list I want the Detail view to be shown in a Dialog (Popup). The thing is, I also want the ID of the list element in my url and when I reload the page while the dialog is still open, I want to jump to this exact position again (the dialog is in fullscreen, it looks like a own view).

So, what I got so far:

When I click on an element in the list I call this function

campaignSelectHandler : function () {
    if(!this.fragment) {
        var controller = new sap.ui.controller("ui.controls.fragments.EventDetail");
        this.fragment = sap.ui.xmlfragment("ui.controls.fragments.EventDetail", controller);
    }
    //this.router.navTo(navigation.Constants.EventDetailFragment, {id : 12345});
    this.router.navTo(navigation.Constants.EventDetailFragment, {id: 1337});
    this.fragment.open();
},

Next thing is I jump to my fragment

<Dialog     id="dialogEventDetail"
        xmlns:view="ui.views.pages"
        xmlns="sap.m"
        xmlns:controls="ui.controls"
        xmlns:core="sap.ui.core"
        xmlns:mvc="sap.ui.core.mvc"
        contentWidth="100%" contentHeight="100%"
        showHeader="false"
        class="eventDetail"
        horizontalScrolling="false"
        verticalScrolling="false">

<mvc:XMLView viewName="ui.views.pages.EventDetail">

</mvc:XMLView>

</Dialog>

In this Dialog fragment I load my view including my controller etc. This works for opening a Dialog and display the url path but obviously as soon as I reload the page everything is gone.

In addition to that, I extend the "ui.views.pages.EventDetail" view from a AbstractController where I initiate the router. It works fine for my normal view but when I open the dialog I loose the reference to it and cannot route back to my initial view.

I know this solution cannot work so I hope you have some advices on how to get it to work!

Thanks in advance!

BTW: This is the Component.js

routes : [
            {
                pattern : "",
                name : navigation.Constants.MyEvents,
                view : navigation.Constants.MyEvents,
                viewId : navigation.Constants.MyEvents,
                targetAggregation : "pages",
                targetControl : "idAppControl",
                subroutes : [
                    {
                        pattern : "{id}",
                        name : navigation.Constants.EventDetailFragment,
                        view : navigation.Constants.EventDetailFragment
                    }
                ]
            }

Answer:

On refresh your attachRouteMatched method is called.

onInit: function() {
    var _this = this
    var oRouter = sap.ui.core.routing.Router.getRouter("appRouter");
    //can also use directly this.oRouter.attachRouteMatched(...)
    //I see you using this.router 
    oRouter.attachRouteMatched(function(oEvent) {
        if (oEvent.getParameter("name") !== navigation.Constants.EventDetailFragment) {
            return:
        }
        try {

            var oHasher = new sap.ui.core.routing.HashChanger();
            var hash = oHasher.getHash(); //this will get everything which is in URL after #
            //TODO : split the hash accordingly and find the event id and open your dialog and assign to oEventId
            if (!_this.fragment) {
                var controller = new sap.ui.controller("ui.controls.fragments.EventDetail");
                _this.fragment = sap.ui.xmlfragment("ui.controls.fragments.EventDetail", controller);
            }
            _this.router.navTo(navigation.Constants.EventDetailFragment, {
                id: oEventId
            });
            _this.fragment.open();
        } catch (e) {
            jQuery.sap.log.warning("Couldn't find the right event")
        }
    }, this);
}

Actually you can reuse campaignSelectHandler just change the signature implementation such a way that it accepts the eventId

Hope this helps


Related:


How to enable user to re-entry(or) reuse the same dialog in MFC


visual-c++,mfc,dialog
I'm currently doing a FTP download using MFC. Is a very simple program which takes 2 inputs from user and click a download button in order to download from server. Everything is fine and im able to download it from. But i realized this program can only be executed once....

Why does this MVC action return a 404 response in IE11


ajax,asp.net-mvc,routing
I have written an mvc action that works in Chrome and Firefox but not in IE11. Using IE11 it returns a 404 response code. Controller: [HttpDelete] public ActionResult DeleteAction(int ActionID) { return Json(_Logic.DeleteAction(ActionID), JsonRequestBehavior.DenyGet); } Calling JS: Ajax_Proxy.DeleteAction = function (_actionID, successCallback, failureCallback) { return $.ajax({ type: "DELETE", datatype: 'json',...

How to quote variables in a whiptail command with dynamic/conditional options?


bash,dialog,whiptail
I need to disable options in a dialog command built in a Bash script. Here is the original working script: my_backtitle="This is a test" selected_options=($(dialog \ --backtitle "$my_backtitle" \ --separate-output \ --checklist "Select your options:" 0 0 \ "option1" "description of option 1" "" \ "option2" "description of option 2"...

Updating a shown Dialog


android,dialog
I created a Dialog, using a custom layout: public class WaitDialog extends DialogFragment { [..] @SuppressLint("InflateParams") @Override public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); LayoutInflater inflater = getActivity().getLayoutInflater(); View viewDlg = inflater.inflate(R.layout.dialog_finish, null); tvStatusMain = (TextView) viewDlg.findViewById(R.id.tvStatusMain); [..] } public void setMessage(String message) { tvStatusMain.setText(message); } }...

Rails routing link to specific show


ruby-on-rails-4,routing
This question seems a little basic, but considering I have 'pages#show' with a show page with url 'history'. How could I add this specific show page to a link: = link_to 'History', pages_path(@?????) PD1: I would prefer avoid using :id since I tend to seed a lot of data, and...

Create jDialog Swing with a message of error with image


java,swing,dialog
I'm new of Java and I want to do a jDialog that is opening when I push a button in the main JFrame and show a message of error in this way: I can't put the image in another way in NetBeans? I create in the source package a directory...

Multiple routes with multiple domains


symfony2,routing
Let's say I've got a website with multiple (sub)domains: acme.com (USA) acme.nl (Netherlands) be.acme.eu (Belgium) de.acme.eu (Germany) fr.acme.eu (France) etc... I thought this should be very simple to configure, so I made this routing.yml: usa: host: "acme.com" resource: "@WebsiteBundle/Controller/" type: annotation defaults: country: "en" netherlands: host: "acme.nl" resource: "@WebsiteBundle/Controller/" type:...

Asp.net MVC Routelink null controller parameter


c#,asp.net,asp.net-mvc,asp.net-mvc-4,routing
I have two routes, the default one routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); I added another route, sometimes the parameter will by a string routes.MapRoute( name: "ByName", url: "{controller}/{action}/{name}", defaults: new { controller = "Home", action =...

Integer in place of Ids and Layouts


android,dialog
I have decompiled an apk for java code and in it I get these Integer values in the place of R.id and R.layouts. Can you explain why did it happen? protected void onCreate(Bundle paramBundle) { super.onCreate(paramBundle); setContentView(2130903041); this.b1 = ((Button)findViewById(2131230721)); this.b2 = ((Button)findViewById(2131230722)); this.b1.setOnClickListener(new View.OnClickListener() { public void onClick(View paramAnonymousView)...

Re-transmission concept in TCP


tcp,routing,tcp-ip,osi
Server sent data to client, but client didn't send ACK for the data . So once RTT completed , Server will resend data to client again .... like that how long it will try to send the data ? What is the maximum time server will try to send the...

Dismissing the dialog by outside touch event is not working


android,dialog,window,android-alertdialog
I have an utils class which vll return a dialog to the activity in my application. In that i need to provide the user to dismiss the dialog on outside click.So here i used like this lDialog.setCancelable( true ); lDialog.setCanceledOnTouchOutside( true ); I refereed some of these links Here &...

Codeigniter Select JSON, Insert JSON


json,codeigniter,select,insert,routing
I have very simple users database: user_id, user_name, user_email My model this: class Users extends CI_Model { private $table; private $table_fields; private $table_fields_join; function __construct() { parent::__construct(); $this->table = 'users'; $this->table_fields = array( $this->table.'.user_id', $this->table.'.user_name', $this->table.'.user_email' ); $this->table_fields_join = array(); } function select(){ $this->db->select(implode(', ', array_merge($this->table_fields, $this->table_fields_join)));...

Subdomain routing not working on Laravel 5 - WAMPServer


apache,.htaccess,laravel,routing,wamp
I am trying to implement static and dynamic subdomain routing in my application. It is not working as expected. I am using WAMPServer in my local machine. routes.php Route::get('/', '[email protected]'); Route::group(['domain' => 'api.letsplay.dev'], function () { Route::group(['prefix' => 'v1'], function () { Route::get('users', function () { return "Success"; }); });...

How to avoid user to click outside popup Dialog window using Qt and Python?


qt,user-interface,python-3.x,dialog,qt-creator
I created a Dialog window using Qt Creator and Python. I would like that Window stays on the top of my Gui AND avoid users to click outside that Dialog Until this dialog was closed.

Writing Another Text File based on Saved File from Tkinter


python,file,tkinter,dialog,save
I prompt the user to save a file, and I want to automatically save a file along with it. For example, let's say the user saves a text file under my program called "foo.txt", I want to automatically make a text file called "lengthfoo.txt". The word "length" before "foo", and...

Zend Framework 2 routing error: resolves to invalid controller class or alias


zend-framework,routing,zend-framework2,zend-framework-mvc,zend-framework-routing
I'm trying to learn Zend Framework 2 and I have their skeleton application up and running. In order to access it I visit http://localhost:8080/. When visiting that link it displays their generic Zend page. What I want to be able to do is visit http://localhost:8080/application/test and have it bring me...

Javafx: Close alert box (or, any dialog box) programatically


javafx,dialog
I have a JavaFx application in which I display an alert box using: alert = new Alert(AlertType.CONFIRMATION); alert.setTitle("Title"); alert.setHeaderText("Some Text"); alert.setContentText("Choose your option."); buttonTypeOne = new ButtonType("Yes"); buttonTypeCancel = new ButtonType("No", ButtonData.CANCEL_CLOSE); alert.getButtonTypes().setAll(buttonTypeOne, buttonTypeCancel); Optional<ButtonType> result = alert.showAndWait(); Because the alert executesshowAndWait, so it will be displayed till the user...

Put a string into a dialog from a slected list item from a expandable list child


android,dialog,expandablelistview
I've been trying to pull details of an item selected, from my strings.xml. To a dialog pop up when i select an item from my expandable list view (child). Sadly with little success. This is the expandable list fragment from my NavigationDrawerFragment. everything works great. the dialog pulls up with...

Ruby-on-Rails Voting Partial Routing


ruby-on-rails,routing,voting
I have a voting feature on my app but can't route back to the same page with the vote applied. I know I have to fill in the link_to methods but my understanding of routing/ruby syntax is a bit limited, so I'm not even sure [post, vote] is correct. I...

ImageView setOnClickListener in a dialog


android,dialog,imageview,onclicklistener
I create a custom dialog box with this method: public Dialog onCreateDialog() { AlertDialog.Builder builder = new AlertDialog.Builder(this); LayoutInflater inflater = this.getLayoutInflater(); builder.setView(inflater.inflate(R.layout.dialog_rate, null)) .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int id) { SharedPreferences.Editor settingsEditor = settings.edit(); settingsEditor.putBoolean("rate",false); settingsEditor.apply(); Intent intent = new Intent();...

How to add checkBox in Dialog and get value?


checkbox,dialog,axapta,x++,dynamics-ax-2012
I want to add a CheckBox in my Dialog. I used this code: Dialog dialog; DialogField dialogField; NoYesId checkValue; ; dialog = new Dialog("New dialog with checkBox"); dialogField = dialog.addFieldValue(identifierStr(NoYes) , checkValue); checkValue= dialogField.value(); dialog.run(); info(strfmt("Value %1" , checkValue)); So, in Debug I see the value of the variable (checkValue)...

Show UI dialogs using data-popup attributes


javascript,jquery,jquery-ui,dialog,jquery-ui-dialog
I am using jquery ui dialog to show more than one popup on one page, each popup will have its own ID and it will be triggered by an anchor with a data-popup="" attribute. For example, <a class="popup-button" data-popup="#popup-a">POPUP A</a> Will trigger the popup that has the ID #popup-a Below...

How to access UrlHelper.Action or similar from within Global asax


c#,routing,asp.net-mvc-5
I am trying to prepare a 301 redirect for a typo I made 'recieved' I am struggling to find a way of getting the url from the action and controller names. I am aware of UrlHelper.Action but it does not exist within Global.asax. How do I gain access to this...

Open page url in modal on a page (Facebook Photo URLs)


javascript,jquery,angularjs,routing,angularjs-routing
P.S. I am using html5Mode to remove '#' in routing in below scenario Removing the hashtag from AngularJS urls (# symbol) Consider I have two main pages.One is photos where thumbnails are provided and whose url is /someSlug/photos. Other is the url of a single photo '/someSlug/photos/somePhotoId' which shows a...

Dialog error in android


android,dialog
I am not able to understand why I'm getting error saying Dialog cannot be resolved to a type import android.os.Bundle; import android.support.v4.app.DialogFragment; import android.support.v7.app.AlertDialog; public class DatePickerFragment extends DialogFragment { @Override public Dialog onCreateDialog( Bundle savedInstanceState ) { return new AlertDialog.Builder( getActivity() ).setTitle( R.string.date_picker_title ) .setPositiveButton( android.R.string.ok, null ) .create();...

Select Mongoose Model Based on Express Route


express,routing,mongoose
I think this might be a basic question, but looking for the best approach. I'm building an express app that should route to one of four different Mongoose models depending on the route. Something like this: app.get('/:trial', function(req, res){ var trial = req.params.trial; trial.find(function(err, records) { if (err) res.send(err); res.json(records);...

How to deal with extra “/” in phpleague route?


php,web-services,routing
I am setting endpoints for my web application like this: $router = new League\Route\RouteCollection; function user_action (Request $request, Response $response) { // some logic . . . return $response; } $router->addRoute('GET', '/user', 'user_action'); /user endpoint works well. However when I use /user/ (extra slash in the end) I get a...

$StateProvider Remove Child View Nesting


angularjs,routing,angular-ui-router,angularjs-ui-router
I am new to angular ui routing . I am creating a sample application and want to display parent and child view separately . I mean when parent item gets selected child view will be displayed and parent view would be hidden . If I add ui-view to parent view...

Symfony/Twig how to render a Route set by anotation?


php,symfony2,routing,twig,url-routing
Let's say I have this code in a controller: <?php namespace Foo\BarBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration as Mvc; /** * @Mvc\Route("/foo/bar") */ class TestController extends Controller /** * @Mvc\Route("/test/{id}", requirements={"id" = "[0-9]{1,6}"}) * @Mvc\Template * * @return view */ public function testAction($id) { return array('test' => $id); } } How...

keep aspect ratio of .ui-dialog-content when resizing


jquery,jquery-ui,dialog,aspect-ratio,jquery-ui-resizable
I have an image within the dialog. when I resize the dialog, the aspectRation is working on the complete dialog, not only on the image, when I resize it. $("#videoDialog").dialog({ resizable: false, autoOpen: true, width: 300 }).parent().resizable({ aspectRatio: true, minWidth: 300 }); The more I resize the dialog, the more...

I don't understand routing


php,routing,flightphp
I am trying to learn a PHP framework. But I'm having some difficulties understanding some of the concepts of routing. I've chosen to use Flight. Their homepage shows: require 'flight/Flight.php'; Flight::route('/', function(){ echo 'hello world!'; }); Flight::start(); And I don't understand what they're using Flight::route... for. What am I missing?...

Node forward path request to another server


node.js,express,routing,routes,request
Currently have a website running a node server that handles all requests for example.com and I created a completely separate wordpress blog on a separate server (running apache) that I would like served on a path like example.com/blog at 172.23.23.23 IP address. The wordpress server doesn't share any code or...

Javascript: call dialog from button


javascript,button,dialog
I hope you can help me, because i'm new at javascript. I want to open a dialog by clicking on an button. When it shows up and you click "OK", there should pop-up a second dialog. http://forums.asp.net/t/1962249.aspx?Make+a+button+open+a+javascript+dialog And also on stackoverflow i saw related questions. But none of them could...

How to add menus/ subtopics for meteor site?


javascript,node.js,meteor,routing,meteor-blaze
I am new to meteor. I followed the tutorials and successfully making simple interfaces like below. I tried finding examples to add menus/ subtopics like this which does not reload the page when clicked, but I couldn't find any examples. Could you please give me an example how to do...

WebApi Routing not working for Post


routing,asp.net-web-api2,asp.net-web-api-routing
My WebApiConfig has following routes // Web API routes config.MapHttpAttributeRoutes(); config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { controller = "Employee", action = "Get", id = RouteParameter.Optional } ); The Post WebApi method has got following Signatures [HttpPost] public IHttpActionResult Post(Employee emp) { ..... } When i try to call...

Angular not responding to any routes with ui-router - URL just disappears when I enter


angularjs,node.js,express,routing,angular-ui-router
I'm using NodeJS+Express to serve an HTML page with an Angular app. It seems to work fine when it loads. There are no errors. Problem is that that page is pretty much blank - except for the header. But the part that is supposed to go where <div ui-view></div> is,...

Route parameter with slash “/” in URL


asp.net-web-api,routing,asp.net-web-api2,asp.net-web-api-routing,attributerouting
I know you can apply a wildcard in the route attribute to allow / such as date input for example: [Route("orders/{*orderdate}")] The problem with wildcard is only applicable to the last paramter in URI. How do I solve the issue if want to have the following URI: [Route("orders/{orderdate}/customers")] ? EDIT:...

Routing in Sinatra


ruby,web,routing,sinatra
I have an application where the user fills out a form at /search and I want that to output to /search/results. In my app.rb, I've attempted to call post '/search' do ... erb :search/results end However that fails. My directory structure is: views -search --results But it fails. Where am...

SAPUI5/OPENUI5 - Routing with Dialogs


routing,dialog,sapui5,openui5
I´m currently stuck with the combination of routing and dialogs. I have a view with list elements and when I click on an element in the list I want the Detail view to be shown in a Dialog (Popup). The thing is, I also want the ID of the list...

Why is Router used like normal function instead of constructor in express 4.x?


javascript,node.js,express,routing
I am newbie trying to understand Express 4.x routing and I am reading their guide at: http://expressjs.com/guide/routing.html In the last paragraph it says following: The express.Router class can be used to create modular mountable route handlers. A Router instance is a complete middleware and routing system and accompanying code is:...

Is it possible in laravel 5 to show a pretty url to the user, and a practical url to the app?


routing,routes,laravel-5,friendly-url,slug
I have this url: mywebsite.com/user/1/edit I want my users to see this: mywebsite.com/edit-your-profile/ Is this possible when using Route::resource('user', 'UserController');? If yes, how do I do it :) ? I still want my app to be able to see user/1/edit as I use it in my middleware to prevent unauthorized...

Implementing find node on torrent kademlia routing table


table,routing,bittorrent,dht,kademlia
I, already, reviewed a number of documents on this topic but there is something not exactly clear. For example bit torrent document (http://www.bittorrent.org/beps/bep_0005.html) states The routing table is subdivided into "buckets" that each cover a portion of the space. An empty table has one bucket with an ID space range...

how to correctly send CMFCMenuButton selected ID to the message map?


c++,menu,mfc,dialog
firstly let me describe what I have: scenario: CMFCMenuButton, loaded with a CMenu, in a dialog test: click on an item of the menuresult: the message map will get the ID of the CMFCMenuButton and not the ID of the menu how to get the actual menu ID clicked: use...

Angular $routeProvider and Controller As Syntax


angularjs,routing,angularjs-scope,angularjs-routing,ngroute
Can anyone tell me if it is valid to use $routeProvider with Controller as syntax? I am having issues accessing <h1>{{kickController.foo}}</h1> from the controller where this.foo resides. angular.module('ucp.kick', ['ngRoute']).config(function($routeProvider, APP_BASE_URL) { return $routeProvider.when(APP_BASE_URL + 'kicks', { reloadOnSearch: false, navitem: true, name: 'Kicks', templateUrl: 'kick/partials/kick.html', controller: 'kick as KickController' }); });...

Restrict laravel to open url that is not in route


php,laravel,routing,laravel-5,laravel-5.1
I am Learning laravel now. Today I came across a problem that surprised me. I open this link in my browser: http://localhost/laravel/project/ch/resources/views/pages/blog.blade.php And I expect error 404. but it opens contains of this file. So, How to restrict laravel to do this. I want laravel to open only url mentioned...

Get instance of JQuery UI popup


jquery-ui,dialog,instance
I am creating a JQuery UI popup this way: function ShowJQueryStandardDialog(searchTarget, title, width, height, closeFunction) { var $dialog = $('<div id="dialogDIV"><iframe id="dialogIFrame" frameborder="no" scrolling="auto" src="' + searchTarget + '" width="' + (width - 50) + 'px" height="' + (height - 50) + 'px"></iframe></div>'); $dialog.dialog( { modal: true, title: title, show:...

Where should I put Symfony third-party bundle's routing configuration?


php,symfony2,routing,symfony-routing
I have SonataAdminBundle, SonataUserBundle and LiipImagineBundle installed in my Symfony 2 application. According to their installation instruction, I put their routing configuration in /app/config/routing.yml. _liip_imagine: resource: "@LiipImagineBundle/Resources/config/routing.xml" admin: resource: "@SonataAdminBundle/Resources/config/routing/sonata_admin.xml" prefix: /admin _sonata_admin: resource: . type: sonata_admin prefix: /admin sonata_user: resource: '@SonataUserBundle/Resources/config/routing/admin_security.xml' prefix: /admin...

No action was found on the controller that matches the request


c#,asp.net,ajax,asp.net-mvc,routing
Sorry for the lame question. I've already read all similar questions and still can't resolve my issue. I'm getting 'No action was found on the controller that matches the request' error when calling from ajax: $.ajax({ url: '/api/ToyEdit/Post/', dataType: "json", type: "POST", contentType: 'application/json; charset=utf-8', data: JSON.stringify({toyId: 1, toy: 'asd'}),...

Change resources path


ruby-on-rails,ruby,routing
I'm using Rails 4 I have a routes.rb file that looks like: resources :books However, I'd like the urls in the application to end up looking like /b/101 instead of /books/101. I realize I could go through and rename each resource path individually, but is there not a way to...