KUIB - Passing Parameters

Posted by spandau66 on 16-Apr-2017 09:49

Hi,

I've recently starting experimenting with KUIB and put together some sample pages :) However, I have come across a scenario of which I hope someone has encountered and resolved.

The scenario:

Order Form wants to call OrderLine form passing the selected Order Number.

In normal AngualrJS development, I would use $StateParams to pass values from one form to another (state to state).

Within the app.js I would have in the callee something like:

.state('order-lines', {
url: '/order-lines',
templateUrl: '.../order-lines.html',
controller: 'OrderLinesCtrl',
params: { 'callingObject': null},
data: {
...
},
resolve: {
....
}
BUT, how is this achieved within KUIB? I have implemented something similar, but obvioulsy, everytime I rebuild, the code I place within the KUIB 'app.js' is overwritten. 
Any info on this topic would be greatly appreciated.

All Replies

Posted by Anil Kumar on 16-Apr-2017 10:16

Hi Spandau66,

A quick reply...

Can you please customize the code ok view-factory.js file located in src/ folder and check if it solves the issue.

Thanks and Regards,
Anil Kumar.

Posted by spandau66 on 16-Apr-2017 10:25

Hi Anil,

The issue is not with the view-factory.js file (I have already changed these files accordingly to set $stateparams and then to check $stateparams). In short, it's the 'app.js' not having a "params: { }" option. I can change the 'app.js' but is always overwritten when I rebuild.

So the same question still applies. Is there an alternative way to pass parameters from one form to another (controller/factory to another controller/factory) using KUIB?

TIA

spandau66

Posted by spandau66 on 16-Apr-2017 10:28

Hi Anil,

As an alternative, I could change the ejs template that builds the 'app.js' file. However, I would need some pointers as to where and what I would need to change. Obviously, I would maintain the template personally afterwards.

TIA

Posted by Shelley Chase on 16-Apr-2017 16:53

You can edit the ejs template but we do not have documentation on how to do that at this time. The best way might be to save the values to local storage in onside of the first form and get from local storage on the show of the second form. You can google easily... I found [View:https://www.quora.com/Can-I-pass-a-value-from-one-HTML-or-JavaScript-page-to-another-HTML-or-JavaScript-page-without-passing-it-in-URL]

HTH

-Shelley

Posted by spandau66 on 18-Apr-2017 05:28

Hi Shelley,

Thanks for the link (already in my bookmarks) :)

I have resolved my own question, by accessing and changing the app.js.ejs file and adding what I required.

Local Storage is always one way (providing it's encrypted), but have to be honest, not a fan of local storage....

Thanks

Martyn

This thread is closed