Recess Framework get parameter - url

I'm using the recess framework. Suppose I have a URL like this
www.example.com/try.php?this=5
In recess, what do i do to access the value of parameter this ??

$this->request->get['this'];
Those variables {->get[], ->post[]} populate no matter what verb is being used.

Related

multiple exclude data can't catch in filter option odata

I create smart table sapui5 screen by using odata (S4Hana) .
On the odata side, get the filter value from smart filter by using this method ⇒ [ io_tech_request_context->get_filter( )->get_filter_select_options( ).]
It is ok when I pass the filter value as multiple Include option .
When I pass the filter value as multiple Exclude option , the data can't access from filter_select option method. The data can be get in filter_string method but it is difficult to get the data and put to range table .
Let me know how to get the filter value from entity set of odata .
Let me know how to get the filter value from entity set of odata .
There are defined rules, how your $filter parameter has to look like to get converted into the import parameter it_filter_select_options. If you breach this rules (you did...) the import parameter it_filter_select_options will be empty.
Sadly, there's no simple solution.
If you need to convert the parameter iv_filter_string into select options there are quite a few Tutorials/Blogs about it.
Filter String How To
How to Parse IV_FILTER_STRING in GET_ENTITYSET

Ucommerce parse niceurl or set context

I'm trying to get the current category from the url e.g. http://localhost/catalog/discs/c-24/c-92 (generated from GetNiceUrlForCategory()). But when I call SiteContext.Current.CatalogContext.CurrentCategory, returns null.
SiteContext.Current.CatalogContext.CurrentCatalogue and SiteContext.Current.CatalogContext.CurrentCatalogueGroup do not return null.
Is there another internal call where I can parse the URL or should I write my own?
Can I set the context from the URL?
Check hostnames, it looks like they are not set for localhost

Uri class throws error when queryParameters contains a key with a value: false?

I was working through some code, and noticed:
return new Uri(host: server, path: apiPath, query: query, queryParameters: queryParams);
This code is executed regularly throughout the application, and the only difference was queryParams. So i printed it out:
{Id:[1234], enabled:false}
shows it is a key:value set of: Id:List, enabled:boolean.
The stack trace i get is:
which shows the map and then the trace. #6 points to the above line.
It is looking at false... something with iterating false is what breaks this.
When dealing with the URI and query parameters, it is looking for numerics, lists, and strings but not booleans. In order to resolve this and allow it to function correctly, you will need to do:
{"enabled": false.toString()}
// or
{"enabled": "false"}
and the uri class will set the query parameter accordingly.
The Uri class is located in core library for Dart. When we are using it, we are passing in the created Uri object into an action for a client class,
Client client = new BrowserClient();
which accepts the url as a part of the parameters.
While looking at the errors above though, the Uri class ultimately is unable to properly parse a false value to an accepted value.
When looking at the Code Docs for Uri as per the Dart languages: https://api.dartlang.org/dev/1.25.0-dev.7.0/dart-core/Uri/Uri.html
The query component is set through either query or queryParameters. When query is used, the provided string should be a valid URI query, but invalid characters, other than general delimiters, will be escaped if necessary. When queryParameters is used the query is built from the provided map. Each key and value in the map is percent-encoded and joined using equal and ampersand characters. A value in the map must be either a string, or an Iterable of strings, where the latter corresponds to multiple values for the same key.
Which makes sense to say all values must be String or an Iterable of Strings. The only thing which I cant figure out is that in Dartpad, true and false have toString functions, and yet you can also pass numerics in there.
The only conclusion is that while it accepts Strings and Iterables of Strings, it will also parse ints and other numerics because they will explicitly check for that type as it is common to see in URI.
One would think that the URI would understand booleans since those are also common place, but that is yet to be seen since I cant take an explicit look at the source code for dartlang. I did however manage to look at the source code for it and narrowed it down. writeComponent points to _Uri._uriEncode but when looking at that function, there is no code as much as just a definition.
HTH.

OData call with $filter and $expand simultaneously

I've been trying to call a entity, but i'm supposed to call the results from its associated entities. I tried to do it with the following URL:
/sap/opu/odata/XXXXXXXX/SERVICE_NAME/MatnrGetdetailCollection?$filter=IVendorId eq '1701' and ILanguage eq 'P' and IMaterial eq 'M-05'&$expand=MatnrClassGetdetail
I must use the filter because the called function has these mandatory parameters.
Am I making any mistake on the URL or the error isn't there?
In general $filter and $expand can be combined, we use it in our application. Therefore please see Layla's Comment. In addition, you should tell us what the actual error is.
If MatnrGetdetailCollection is indeed an entity set, then the corresponding entity must have a navigation property of the name MatnrClassGetdetail, otherwise $expand won't work.
There is some problem with the URL when you want to go for obligatory parameters. Please pass them as key values in segw and and go for the format I'm sending:
/sap/opu/odata/sap/SERVICE_NAME/EntitySet(keyfield='value',keyfield='value')/?$expand=navigationName

Angular http get returns string in extra quotes

My project is a mixture of AngularJS and ASP.Net MVC.
I am using $http.get to call my api controller, which returns a string. But in the .success function, the data is getting returned like so "/"my string/"" (with the extra quotes around it).
Why are those there, and how can I get rid of them?
I need them gone because I am setting the title attribute of an element to the string that is returned, and this makes the tooltip have quotes around it (ugly).
parse the string value using JSON.parse(variable)

Resources