I am just started development in BB10 .I need to call soap based web service from URL .I google it and found one weather example .But it not help me.Actually I want to to call a method Example like
getVersionReturn .
from url so that my concept clear .Then I will call my other methods
here is my url.
http://railapps.firstgroup.com/FirstGroupRailApps/services/RailAppsCAWS?wsdl
The return value is response like :1.3 .
can you help me to call one method on button click ?
Ok this isn't full solution, but it will show you the important part (this is cascades solution)
Button {
text: "click"
onClicked: {
dataSource.load();
}
}
and
attachedObjects: [
DataSource {
id: dataSource
source: "http://railapps.firstgroup.com/FirstGroupRailApps/services/RailAppsCAWS?wsdl"
type: DataSourceType.Xml
remote: true
onDataLoaded: {
console.log(JSON.stringify(data))
}
onError: {
console.log(errorMessage)
}
}
]
so all you need to do is to search through that data.
Related
I see this question is being ask all over again still don't find solution that works for such a trivial task.
This url displays a list of navigations tabs for workspaces.
http://localhost:4200/users/1/workspaces
Each of tab resolves to
http://localhost:4200/users/1/workspaces/:wid
Also on the I have a button that suppose to create a new workspace as well as new tab.
Here how controller for looks:
export default Ember.Controller.extend({
actions: {
newWorkspace: function () {
this.get('currentModel').reload();
var self = this;
var onFail = function() {
// deal with the failure here
};
var onSuccess = function(workspace) {
self.transitionToRoute('dashboard.workspaces.workspace', workspace.id);
};
this.store.createRecord('workspace', {
title: 'Rails is Omakase'
}).save().then(onSuccess, onFail);
}
}
});
When I click on button I see in ember inspector new record indeed created as well as url redirected to id that represents newly created workspace.
My question is how to force model/template to reload. I have already killed 5h trying model.reload() etc. Everything seem not supported no longer. Please please help.
UPDATE
When adding onSuccess
model.pushObject(post);
throws Uncaught TypeError: internalModel.getRecord is not a function
I believe you should call this.store.find('workspace', workspace.id) for Ember Data 1.12.x or earlier. For 1.13 and 2.0 there are more complicated hooks that determine whether or not the browser should query the server again or use a cached value; in that case, call this.store.findRecord('workspace', workspace.id, { reload: true }).
I do not know if this help. I had a similar problem. My action was performed in the route. Refresh function took care of everything.
I have written a (very) simple RESTFul Web service to retrieve data from MongoDB using Node, Express and Mongoose.
On the server side, I have this code:
router.route('/products').post(function(req,res){
var product = new Product(req.body);
product.save(function(err){
if(err)
res.send(err);
res.send({message:'Product Added'});
});
When I submit a request from my Ember client, the req.body contains something like the following:
{ attributes:
{ category: 1,
name: 'y',
price: 1,
active: false,
notes: null } }
The attribute names are exactly the same as my mongoose schema. I get no error but the document created in MongoDB is empty (just get the _id and __v fields).
What am I doing wrong. Should I convert the req.body further into ???
A couple things that will help debug:
1) From a quick glance (I haven't used mongoose before) it looks like call back function passed to save takes two arguments.
2) I don't know if your code got cut off, but the sample above was missing a matching });
3) I made the function short circuit itself on error, so you will not see 'Product added' unless that is truly the case.
Try these fixes.
router.route('/products').post(function(req,res){
var product = new Product(req.body);
product.save(function(err, product){
if(err){
return res.send(err);
}
return res.send({message:'Product Added'});
});
});
The issue was related to my lack of familiarity with Ember and Node+Express. The data received in the server is slightly different from what I had first indicated: (first line was missing)
{ product:
{ attributes:
{ category: ... } } }
On the server side I can access my data using req.body.product.attributes (instead of req.body):
router.route('/products').post(function(req,res){
var product = new Product(req.body.product.attributes);
product.save(function(err){
if(err)
res.send(err);
res.send({message:'Product Added'});
});
I wanna using Ajax at front-end joomla site
I have found and tried some code about call ajax in Joomla! but unfortunately It don't run.
Here is my code:
File : components/com_headattack/views/headattackinfo/tmpl/default.php
$("#select-filter1").selectbox({
onChange: function (val, inst) {
$('#select-filter2').remove();
$.post("index.php?option=com_headattack&task=filter1_click&format=raw",
{
elementId : "select-filter1",
selectedValue : val
},
function(data,status){
$('#select_filter_div2').html(data);
}
);
}
});
File : components/com_headattack/controllers/headattackinfo.php
public function filter1_click(){
return "test";
}
When I run my site and click select-filter1(combobox) so javascript throw a message : 500 (Internal Server Error)
Please help me to solve my problem :(
Your task currently maps to the main controller in the component: components/com_headattack/controller.php
To have the task run in that controller, you should call task=headattackinfo.filter1_click (the controller, a period, then the function name).
The full url would look like this:
index.php?option=com_headattack&task=headattackinfo.filter1_click&format=raw
Hi i created a plugin portlet. In the JSP i am accessing all countries list by using JSON API. It is working fine for Logged in users. But for the Guest users i am unable to access the web service. I am working on Liferay 6.0.6. The following is my code.
Liferay.Service.Portal.Country.getCountries(
{},
function(result) {
for(var count=0;count< result.length;count++){
alert(result[count].name);
var option = document.createElement("option");
}
}
);
Assuming that you are using Liferay 6.1, you can achieve it by adding a property to portal-ext.properties file
json.service.public.methods=getCountries
If you need to check the whole flow checkout
JSONServiceAction
I think you need to pass the serviceContext with permissions to the Service.
Can you try by setting the communityPermissions and guestPermissions as VIEW ?
Liferay.Service.Portal.Country.getCountries(
{
serviceContext: jQuery.toJSON(
{
communityPermissions: communityPermission,
guestPermissions: guestPermission,
scopeGroupId: themeDisplay.getScopeGroupId()
}
)
},
function(result) {
for(var count=0;count< result.length;count++){
alert(result[count].name);
var option = document.createElement("option");
}
}
);
I found a work around for the above problem. I am unable to access JSON API because Liferay is using A.io.request for AJAX Calls which is available for Logged in Users only. So I have prepared the following code.
jQuery.ajax({
type: "POST",
url: '<%=themeDisplay.getURLPortal() %>'+'/tunnel-web/json?serviceClassName=com.liferay.portal.service.CountryServiceUtil&serviceMethodName=getCountries',
dataType: 'json',
success: function(countriesList) {
alert(countriesList);
alert(countriesList[0].countryId);
}
}
});
Assuming that I have followed the Sencha Touch 2 Getting Started tutorial, and have a list populated by JsonP proxy data- how do I go about making cached data appear if the user is offline? Currently, the list is simply not displayed if there is no internet connection.
In the video tutorial, Ed briefly mentions that this can "easily be done" but did not provide a reference to where I might find this in the Sencha documentation.
Below is an example of my store object:
Ext.define('test.store.NewsListStore', {
extend : 'Ext.data.Store',
requires: ['test.model.NewsListModel', 'Ext.data.Request'],
config : {
model : 'test.model.NewsListModel',
storeId : 'news-list-store',
autoLoad: true,
proxy: {
type: 'jsonp',
url : 'http://example.com/jsonp',
config : {
noCache: false
}
},
grouper : {
groupFn : function(record) {
var unix_timestamp = parseInt(record.get("entry_date"));
var date = new Date( unix_timestamp*1000 );
return Ext.Date.format(date, 'F');
}
},
}
});
Have a look at this tutorial about taking a Sencha Touch app offline - it's not Sencha Touch 2 but it might point you in the right direction
Here is an example you can follow with localstorage:
http://www.robertkehoe.com/2012/11/sencha-touch-2-localstorage-example/
It uses Sencha Touch 2