cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 Walkthrough Step 32 Routing With Parameter Issue

yoppie_ariesthio
Participant
0 Kudos

Has anyone completed step 32 on SAPUI5 SDK - Demo Kit step 32

?

Do you find issues there?

I cant get it done since 3 days ago and really really needs help..

My Object List Invoice item don't have path like SAPUI5 Walkthrough - Test page

(CTRL+Shift+Alt+S)

each list item have (value or path?) when you click the list like  : /Invoices(ProductName='Milk',Quantity=4,ShipperName='ACME')"

Mine be like  Invoices/1

Where this path come from?? I'm still using local Invoices.Json but it shouldn't be a problem because it's same like remote oData.

Accepted Solutions (1)

Accepted Solutions (1)

jamie_cawley
Advisor
Advisor
0 Kudos

Take a look at step 27.  I would assume you are testing from the index.html and not the testService.html which is configured to use the MockServer.  The Mockserver uses the test/service/metadata.xml which defines the key values of the entities.  The index.html is just using a simple json model.

Regards,

Jamie

SAP - Technology RIG

yoppie_ariesthio
Participant
0 Kudos

Dear Jamie,

you are right, i am using index.html.

I am still don't understand which index.html or testService.html i should run...

Thank you for your answer. i skipped few steps and didn't use oData Remotely because step 26&27 are not working. Even I tried make it exactly look like tutorial code. then I assumed local invoices.json has same data like invoice json from remote.

I will try to take steps back to 26-27 and get oData remotely.

Best Regards

Yoppie

karthikarjun
Active Contributor
0 Kudos

Hi Yoppie,

Odata Service Binding:

1. In SAPUI5 example, they used to bind records from odata model.

2. So the Binding structure would be (Invoice/(milk=""....) collections with filter values

3. It is because of server side communication

eg: Simple OData Binding with SAPUI5 | SCN

JSON Model Binding:

1. It is client side model

2. you created your own structure like( Inovice: {

"Milk" : ""

}...

)

Data Binding: Getting Started - UI Development Toolkit for HTML5 (SAPUI5) - SAP Library

Thanks,

Karthik A

yoppie_ariesthio
Participant
0 Kudos

GOT INSPIRED! THANK YOU!!

Now i know both of them have different pattern.. so it needs different ways too to catch their binded value. Step 32 uses oData type, not JSON type. My fault, sorry..

But what if i still used JSON model for routing how to bind the value(to List) and catch'em in Detail.controller ?

InvoiceList.Controller -> set JSON data type to model and bind them to <List>

Detail.Controller -> catch binded value

karthikarjun
Active Contributor
0 Kudos

Hi Yoppie,

1. Step 3: Navigation and Routing - UI Development Toolkit for HTML5 (SAPUI5) - SAP Library

Example: OpenUI5-and-routing/SAPUI5Tutorial1/WebContent at master · lemaiwo/OpenUI5-and-routing · GitHub

This two blog are more than enough to understand the concepts of routing.


2. JSON model

The JSON model is a client-side model and, therefore, intended for small datasets, which are completely available on the client. The JSON model does not support mechanisms for server-based paging or loading of deltas. It supports, however, two-way binding.


Thanks,

Karthik A

jamie_cawley
Advisor
Advisor
0 Kudos

The first screenshot you are showing in your first post is using the mock server.  This acts more like a real service, but in fact it is just a json source.  If you wanna see the same results as this screenshot then use the testService.html.

Regards,

Jamie

SAP - Technology RIG

Answers (0)