How to add Integers in a Python Entry Field - java

So I'm a newbie when it comes to creating GUI's in Python, and I was wondering how I can add values/integers in an Entry Field that has its state disabled in Python. I've actually done the same thing in Java, but I can't seem to figure out how to translate from Java to Python.
Java Version
C_ID.setText(String.valueOf(Integer.parseInt(C_ID.getText())+1));
Python Code
# Title for the Registration Form
label = Label(window, text="Customer Registration System", width=30, height=1, bg="yellow", anchor="center")
label.config(font=("Courier", 10))
label.grid(column=2, row=1)
# Customer ID Label (Left)
ID_Label = Label(window, text="Customer ID:", width=14, height=1, bg="yellow", anchor="w")
ID_Label.config(font=("Courier", 10))
ID_Label.grid(column=1, row=2)
# Customer ID Input Field
C_ID = StringVar()
C_ID = Entry(window, textvariable=C_ID, text="1")
C_ID.insert(0, "1")
C_ID.config(state=DISABLED)
C_ID.grid(column=2, row=2)
Extra Info:
My code needs to increment by 1 every time I press the save button.
def save():
if len(C_Name.get()) == 0 or len(C_Email.get()) == 0 or len(C_Birthday.get()) == 0 or len(
C_Address.get()) == 0 or len(C_Contact.get()) == 0:
msg_box("All Input Fields Must Be Complete", "Record")
elif not check_email:
msg_box("Please Input a Valid Email", "Record")
elif not check_dateValid:
msg_box("Please Input a Valid date", "Record")
elif not check_minor:
msg_box("Minors are Not Allowed to Register", "Record")
else:
msg_box("Save Record", "Record")
I tried using this code right here,
C_ID.config(text=str(int(C_ID.get())+1))1
But it doesn't seem to add no matter what I do.

You are doing it correctly in your code.
You just need to set the config to normal, set the text, and then set the config back to disabled.
C_ID.config(state=NORMAL) # sets config to normal
C_ID.delete(0, END) #deletes the current value in entry
C_ID.insert(0, "2") # enters a new default value
C_ID.config(state=DISABLED) # sets config to disabled again

Related

Work around for Alexa Custom Skill Reoccuring response

I am building a custom Alexa skill
In which I can ask the name of User and repeat it. (Working fine).
Now, the next part is to confirm the name of the user.
Alexa: "Please confirm your name!"<br>
User:"-"
Alexa: "Please confirm your name!"<br>
User: "No"
Alexa: "Please confirm your name!"<br>
**User: "Yes I confirm"**
End.
Now I am trying to achieve the above behaviour, as
Alexa should prompt "Please confirm your name!" on every 10 seconds until the user Responds
"Yes, I confirm".
I have checked the API documentation but not able to find any Intent related to this case.
Please share some info or solution.
Repromting every 10 seconds when the user doesn't responds, not sure if we can do.
But we can achieve the Yes/No part. One way of doing this is by using the state. Here in this example, I am using the node-cache module for state management.
Consider the below intent named "ConfirmationQuestionIntent". It sets the state to "confirm-name".
const ConfirmationQuestionIntentHandler = {
canHandle(handlerInput) {
return (
handlerInput.requestEnvelope.request.type === "IntentRequest" &&
handlerInput.requestEnvelope.request.intent.name === "ConfirmationQuestionIntent"
);
},
handle(handlerInput) {
const speechText = "Please confirm your name as 'John'.";
myCache.set('state','confirm-name');
return handlerInput.responseBuilder
.speak(speechText)
.reprompt(speechText)
.getResponse();
}
};
Now, enable/Add two BuiltIn intents, AMAZON.YesIntent and AMAZON.NoIntent.
Consider the AMAZON.NoIntent below,
In the handler function. it checks if there is any state with the name "confirm-name". If it is present, it responds with "Please confirm your name as 'John'." and if not then responds with the default response.
const NoBuiltInIntent = {
canHandle(handlerInput) {
return (
handlerInput.requestEnvelope.request.type === "IntentRequest" &&
handlerInput.requestEnvelope.request.intent.name === "AMAZON.NoIntent"
);
},
handle(handlerInput) {
const state = myCache.get("state");
let speechText = "I didn't get this!. Could you please rephrase.";
if(state === "confirm-name") speechText = "Please confirm your name as 'John'.";
return handlerInput.responseBuilder
.speak(speechText)
.reprompt(speechText)
.getResponse();
}
};
Consider the AMAZON.YesIntent below,
In the handle function, it checks if there is any state named "confirm-name". If it is, then it responds back with "Thanks for the confirmation" and deletes the state from the cache. If not then it asks the user to rephrase.
const YesBuiltInIntent = {
canHandle(handlerInput) {
return (
handlerInput.requestEnvelope.request.type === "IntentRequest" &&
handlerInput.requestEnvelope.request.intent.name === "AMAZON.YesIntent"
);
},
handle(handlerInput) {
const state = myCache.get("state");
let speechText = "I didn't get this!. Could you please rephrase.";
if(state === "confirm-name") speechText = "Thanks for the confirmation.";
myCache.del('state');
return handlerInput.responseBuilder
.speak(speechText)
.reprompt(speechText)
.getResponse();
}
};
So, you can use "State" to identify in which scenario the user is responding to and then provide the right response.
I am afraid it is not possible to make Alexa ask the question every 10 seconds untill the user confirm.
I suppose you are using confirmSlotDirective to confirm the name of the user.
confirmSlotDirective or simply any confirmation directive in Alexa works with words that only agree or disagree with the confirmation message. e.g. YES/NO
Solution:
1) If you have already asked for the name of the user (e.g. 'John'), do not ask it again. Simply make Alexa to say:
Alexa: "Your name is John, right?" Or "You said John? please confirm?"
User: can say Yes/No to confirm.
Note: Alexa only recognizes a limited set of international names.
2) Better way to get user's name is using Alexa's Customer Profile Api, so you won't have to worry about Alexa not able to recognize name let alone the confirmation of user's name.

How to restart page number from 1 in different group of BIRT report

Backgroud:
Use Java + BIRT to generate report.
Generate report in viewer and allow user to choose to export it to different format (pdf, xls, word...).
All program are in "Layout", no program in "Master Page".
Have 1 "Data Set". The fields in "Layout" refer to this DS.
There is Group in "Layout", gropu by one field.
In "Group Header", I create one cell to use as page number. "Page : MyPageNumber".
"MyPageNumber" is a field I define which would +1 in Group Header.
Problem:
When I use 1st method to generate report, "MyPageNumber" could not show correctly. Because group header only load one time for each group. It would always show 1.
Question:
As I know there is "restart page number in group" in Crystal report. How to restart page in BIRT?
I want to show data of different group in 1 report file, and the page number start from 1 for each group.
You can do it with BIRT reports using page variables. For example:
Add 2 page variables... Group_page, Group_name.
Add 1 report variable... Group_total_page.
In the report beforeFactory add the script:
prevGroupKey = "";
groupPageNumber = 1;
reportContext.setGlobalVariable("gGROUP_NAME", "");
reportContext.setGlobalVariable("gGROUP_PAGE", 1);
In the report onPageEnd add the script:
var groupKey = currGroup;
var prevGroupKey = reportContext.getGlobalVariable("gGROUP_NAME");
var groupPageNumber = reportContext.getGlobalVariable("gGROUP_PAGE");
if( prevGroupKey == null ){
prevGroupKey = "";
}
if (prevGroupKey == groupKey)
{
if (groupPageNumber != null)
{
groupPageNumber = parseInt(groupPageNumber) + 1;
}
else {
groupPageNumber = 1;
}
}
else {
groupPageNumber = 1;
prevGroupKey = groupKey;
}
reportContext.setPageVariable("GROUP_NAME", groupKey);
reportContext.setPageVariable("GROUP_PAGE", groupPageNumber);
reportContext.setGlobalVariable("gGROUP_NAME", groupKey);
reportContext.setGlobalVariable("gGROUP_PAGE", groupPageNumber);
var groupTotalPage = reportContext.getPageVariable("GROUP_TOTAL_PAGE");
if (groupTotalPage == null)
{
groupTotalPage = new java.util.HashMap();
reportContext.setPageVariable("GROUP_TOTAL_PAGE", groupTotalPage);
}
groupTotalPage.put(groupKey, groupPageNumber);
In a master page onRender script add the following script:
var totalPage = reportContext.getPageVariable("GROUP_TOTAL_PAGE");
var groupName = reportContext.getPageVariable("GROUP_NAME");
if (totalPage != null)
{
this.text = java.lang.Integer.toString(totalPage.get(groupName));
}
In the table group header onCreate event, add the following script, replacing 'COUNTRY' with the name of the column that you are grouping on:
currGroup = this.getRowData().getColumnValue("COUNTRY");
In the master page add a grid to the header or footer and add an autotext variable for Group_page and Group_total_page. Optionally add the page variable for the Group_name as well.
Check out these links for more information about BIRT page variables:
https://books.google.ch/books?id=aIjZ4FYJOQkC&pg=PA85&lpg=PA85&dq=birt+change+autotext&source=bl&ots=K0nCmF2hrD&sig=CBOr_otRW0B72sZoFS7LC_1Mrz4&hl=en&sa=X&ei=ZKNAVcnuLYLHsAXRmIHoCw&ved=0CEoQ6AEwBQ#v=onepage&q=birt%20change%20autotext&f=false
https://www.youtube.com/watch?v=lw_k1qHY_gU
http://www.eclipse.org/birt/phoenix/project/notable2.5.php#jump_4
https://bugs.eclipse.org/bugs/show_bug.cgi?id=316173
http://www.eclipse.org/forums/index.php/t/575172/
Alas, this is not supported with BIRT.
That's probably not the answer you've hoped for, but it's the truth.
This is one of the very few aspects where BIRT is way behind other report generator tools.
However, depending on how you have BIRT integrated into your environment, a workaround approach is possible for PDF export that we use in our solution with great success.
The idea is to let BIRT generate a PDF outline based on the grouping.
And the BIRT report creates information in the ReportContext about where and how it wants the page numbers to be displayed.
After BIRT generated the PDF, a custom PDFPostProcessor uses the PDF outline and the information from the ReportContext to add the page numbers with iText.
If this work-around is viable for you, feel free to contact me.

Clicking a Java script button using excel

I am trying to use VBA to click on a Java script button on the following website: http://www.ura.gov.sg/realEstateIIWeb/transaction/search.action
I'm trying to get the vba to select a project and then click on the button labelled Add and then the button labelled search in the web link above.
I have managed to get the VBA to open the website and select the project, but some how I am unable to get the VBA to click on the "Add" button and "Search" button
Sub DLDATA()
Dim MAS As Object
Dim STYR As Object
Dim DLD As Object
Dim XLD As Object
Dim form As Variant, button As Variant
Set MAS = CreateObject("InternetExplorer.application")
With MAS
.Visible = True
.Navigate Sheets("Property Value").Range("B30").Value ' Navigate to website
Do Until .ReadyState = 4
DoEvents
Loop
Set STYR = MAS.Document.all.Item("projectNameList")
STYR.Value = Sheets("Property Value").Range("A1").Value ' Select name of property based on name in cell A1.
Set XLD = MAS.Document.all.Item("addOpt")
XLD.Value = Sheets("Property Value").Range("A1").Value
End With
End Sub
this works for me
Sub test()
URL = "http://www.ura.gov.sg/realEstateIIWeb/transaction/search.action"
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.navigate URL
Do Until (ie.readyState = 4 And Not ie.Busy)
DoEvents
Loop
Set STYR = ie.Document.all.Item("projectNameList")
STYR.Value = Sheets("Property Value").Range("A1").Value ' Select name of property based on name in cell A1.
Set Results = ie.Document.getElementsByTagName("input") ' find and click the "add" button
For Each itm In Results
If InStr(1, itm.outerhtml, "addOpt", vbTextCompare) > 0 Then
itm.Click
Exit For
End If
Next
ie.Document.getElementByID("searchForm_0").Click ' click the "search" button
Do Until (ie.readyState = 4 And Not ie.Busy)
DoEvents
Loop
' do whatever
End Sub

JSON - is there any XML CDATA equivalent?

I'm looking for a way that json parsing will take information as is (as if it was CDATA) - and not to try to serialize that.
We use both .net and java (client and server) - so the answer should be about JSON structure
Is there any way to achieve this structure?
Thanks.
There is no XML CDATA equivalent in JSON. But you can encode your message in a string literal using something like base64. See this question for more details.
This is a development of Raman's suggestion above.
I love the JSON format, but there are two things I want to be able to do with it and cannot:
Paste some arbitrary text into a value using a text editor
Transparently convert between XML and JSON if the XML contains CDATA sections.
This thread is germane to both these issues.
I am proposing to overcome this in the following manner, which doesn't break the formal definition of JSON, and I wonder if I'm storing up any problems if I do this?
Define a JSON-compatible string format as follows:
"<![CDATA[ (some text, escaped according to JSON rules) ]]>"
Write an Unescape routine in my favorite programming language, which unescapes anything between <![CDATA[ and ]]>. This will be called before offering any JSON file to my text editor.
Write the complementary routine to call after editing the file, which re-escapes anything between <![CDATA[ and ]]> according to JSON rules.
Then in order to paste any arbitrary data into the file, all I need to do is signal the start and end of the arbitrary data within a JSON string by typing <![CDATA[ before and ]]> after it.
This is a routine to call before and after text-editing, in Python3:
lang-python3
escape_list = {
8 : 'b',
9 : 't',
10: 'n',
12: 'f',
13: 'r',
34: '"',
} #List of ASCII character codes to escape, with their escaped equivalents
escape_char = "\\" #this must be dealt with separately
unlikely_string = "ZzFfGgQqWw"
shebang = "#!/json/unesc\n"
start_cdata = "<![CDATA["
end_cdata = "]]>"
def escapejson(json_path):
if (os.path.isfile(json_path)): #If it doesn't exist, we can't update it
with open(json_path) as json_in:
data_in = json_in.read() #use read() 'cos we're goint to treat as txt
#Set direction of escaping
if (data_in[:len(shebang)] == shebang): #data is unescaped, so re-escape
data_in = data_in[len(shebang):]
unescape = False
data_out = ""
else:
data_out = shebang
unescape = True
while (data_in != ""): #while there is still some input to deal with
x = data_in.find(start_cdata)
x1 = data_in.find(end_cdata)
if (x > -1): #something needs escaping
if (x1 <0):
print ("Unterminated CDATA section!")
exit()
elif (x1 < x): #end before next start
print ("Extra CDATA terminator!")
exit()
data_out += data_in[:x]
data_in = data_in[x:]
y = data_in.find(end_cdata) + len(end_cdata)
to_fix = data_in[:y] #this is what we're going to (un)escape
if (to_fix[len(start_cdata):].find(start_cdata) >= 0):
print ("Nested CDATA sections not supported!")
exit()
data_in = data_in[y:] #chop data to fix from front of source
if (unescape):
to_fix = to_fix.replace(escape_char + escape_char,unlikely_string)
for each_ascii in escape_list:
to_fix = to_fix.replace(escape_char + escape_list[each_ascii],chr(each_ascii))
to_fix = to_fix.replace(unlikely_string,escape_char)
else:
to_fix = to_fix.replace(escape_char,escape_char + escape_char)
for each_ascii in escape_list:
to_fix = to_fix.replace(chr(each_ascii),escape_char + escape_list[each_ascii],)
data_out += to_fix
else:
if (x1 > 0):
print ("Termination without start!")
exit()
data_out += data_in
data_in = ""
#Save all to file of same name in same location
try:
with open(json_path, 'w') as outfile:
outfile.write(data_out)
except IOError as e:
print("Writing "+ json_path + " failed "+ str(e))
else:
print("JSON file not found")
Operating on the following legal JSON data
{
"test": "<![CDATA[\n We can put all sorts of wicked things like\n \\slashes and\n \ttabs and \n \"double-quotes\"in here!]]>"
}
...will produce the following:
#!/json/unesc
{
"test": "<![CDATA[
We can put all sorts of wicked things like
\slashes and
tabs and
"double-quotes"in here!]]>"
}
In this form, you can paste in any text between the markers. Calling the rountine again will change it back to the original legal JSON.
I think this can also be made to work when converting to/from XML with CDATA regions. (I'm going to try that next!)
You can create a YAML file and convert to JSON. For example:
test.yaml
storage:
files:
- filesystem: root
path: /etc/sysconfig/network/ifcfg-eth0
mode: 644
overwrite: true
contents:
source: |
data:,
IPV6INIT=yes
IPV6_AUTOCONF=yes
... then run yaml2json_pretty (shown later), like this:
#!/bin/bash
cat test.yaml | yaml2json_pretty > test.json
... which produces:
test.json
{
"storage": {
"files": [
{
"filesystem": "root",
"path": "/etc/sysconfig/network/ifcfg-eth0",
"mode": 644,
"overwrite": true,
"contents": {
"source": "data:,\nIPV6INIT=yes\nIPV6_AUTOCONF=yes\n"
}
}
]
}
}
This is the source code of yaml2json_pretty:
#!/usr/bin/env python3
import sys, yaml, json
print(json.dumps(yaml.load(sys.stdin.read(),Loader=yaml.FullLoader), sort_keys=False, indent=2))
More tricks similar to this yaml2json_pretty at: http://github.com/frgomes/bash-scripts
http://www.json.org/ describes JSON format in details. According to it JSON doesn't support "something like CDATA" value type.
To achieve CDATA structure you can apply custom logic to handle string based values (and do it in the same way both for .net and java implementations). E.g.
{
"type" : "CDATA",
"value" : "Value that I will handle with my custom logic on java and .net side"
}

Problem with filling ext grid with JSON values

I'm new in Ext and I have a problem: I'm trying to fill extjs-grid with data:
Ext.onReady(function() {
var store = new Ext.data.JsonStore({
root: 'topics',
totalProperty: 'totalCount',
idProperty: 'threadid',
remoteSort: true,
autoLoad: true, ///
fields: [
'title', 'forumtitle', 'forumid', 'author',
{name: 'replycount', type: 'int'},
{name: 'lastpost', mapping: 'lastpost', type: 'date', dateFormat: 'timestamp'},
'lastposter', 'excerpt'
],
proxy: new Ext.data.ScriptTagProxy({
url:'http://10.10.10.101:8080/myproject/statusList/getJobs/2-10/search-jobname-/sort-asdf/filterjobname-123/filterusername-davs/filterstatus-completed/filtersubmdate-today',
method : 'GET'
})
});
//
var cm = new Ext.grid.ColumnModel([
{sortable:true, id : 'id', dataIndex:'id'},
{sortable:true, id : 'title', dataIndex:'title'},
{sortable:true, id : 'forumtitle', dataIndex:'forumtitle'},
{sortable:true, id : 'forumid', dataIndex:'forumid'},
{sortable:true, id : 'author', dataIndex:'author'}
]);
var grid = new Ext.grid.GridPanel({
id: 'mainGrid',
el:'mainPageGrid',
pageSize:10,
store:store,
// stripeRows: true,
cm:cm,
stateful: false, // skipSavingSortState
viewConfig:{
forceFit:true
},
// width:1000,
// height:700,
loadMask:true,
frame:false,
bbar: new Ext.PagingToolbar({
id : 'mainGridPaginator',
store:store,
hideRefresh : true,
plugins: new Ext.ux.Andrie.pPageSize({
beforeText: 'View: ',
afterText: '',
addAfter: '-',
variations: [10, 25, 50, 100, 1000]
//comboCfg: {
//id: '${ dispview_widgetId }_bbar_pageSize'
//}
}),
displayMsg: 'Displaying items {0} - {1} of {2}',
emptyMsg:'No data found',
displayInfo:true
})
});
grid.render();
});
and the Java part:
#GET
#Path("/getJobs/{startFrom}-{startTo}/search-{searchType}-{searchName:.*}/" +
"sort-{sortType}/filterjobname-{filterJobName:.*}/filterusername-{filterUsername:.*}/" +
"filterstatus-{filterStatus:.*}/filtersubmdate-{filterSubmittedDate:.*}")
#Produces({"application/json"})
#Encoded
public String getJobs(
#PathParam("startFrom") String startFrom,
#PathParam("startTo") String startTo,
#PathParam("searchType") String searchType,
#PathParam("searchName") String searchName,
#PathParam("sortType") String sortType,
#PathParam("filterJobName") String filterJobName,
#PathParam("filterUsername") String filterUsername,
#PathParam("filterStatus") String filterStatus,
#PathParam("filterSubmittedDate") String filterSubmittedDate) {
return "{totalCount:'3',topics:[{title:'XTemplate with in EditorGridPanel',threadid:'133690',username:'kpremco',userid:'272497',dateline:'1305604761',postid:'602876',forumtitle:'Ext 3x Help',forumid:'40',replycount:'2',lastpost:'1305857807',lastposter:'kpremco',excerpt:'Hi I have an EditiorGridPanel whose one column i am using XTemplate to render and another Column is Combo Box FieldWhen i render the EditorGri'}," +
"{title:'IFrame error _flyweights is undefined',threadid:'133571',username:'Daz',userid:'52119',dateline:'1305533577',postid:'602456',forumtitle:'Ext 3x Help',forumid:'40',replycount:'1',lastpost:'1305857313',lastposter:'Daz',excerpt:'For Ext 330 using Firefox 4 Firebug, the following error is often happening when our app loads e._flyweights is undefined Yetthis '}," +
"{title:'hellllllllllllllpwhy it doesnt fire cellclick event after I change the cell value',threadid:'133827',username:'aimer311',userid:'162000',dateline:'1305700219',postid:'603309',forumtitle:'Ext 3x Help',forumid:'40',replycount:'3',lastpost:'1305856996',lastposter:'aimer311',excerpt:'okI will discribe this problem as more detail as I canI look into this problem for a whole dayI set clicksToEdit1 to a EditorGridPanelso when I'}]}";
As a result I'm getting a JavaScript error:
Syntax error at line 1 while loading:
totalCount:'3',topics:[{title:'XTemplate
---------------------^
expected ';', got ':'
Although, when I'm using Proxy's URL:
URL: 'http://extjs.com/forum/topics-browse-remote.php',
which represents same information, I don't have any problems.
Where is my failure????
P.S. Comments for the first answer:
return "{\"totalCount\":\"3\",\"topics\":[{\"title\":\"XTemplate with in EditorGridPanel\",\"threadid\":\"133690\",\"username\":\"kpremco\",\"userid\":\"272497\",\"dateline\":\"1305604761\",\"postid\":\"602876\",\"forumtitle\":\"Ext 3x Help\",\"forumid\":\"40\",\"replycount\":\"2\",\"lastpost\":\"1305857807\",\"lastposter\":\"kpremco\",\"excerpt\":\"Hi I have an EditiorGridPanel whose one column i am using XTemplate to render and another Column is Combo Box FieldWhen i render the EditorGri\"}," +
"{\"title\":\"IFrame error _flyweights is undefined\",\"threadid\":\"133571\",\"username\":\"Daz\",\"userid\":\"52119\",\"dateline\":\"1305533577\",\"postid\":\"602456\",\"forumtitle\":\"Ext 3x Help\",\"forumid\":\"40\",\"replycount\":\"1\",\"lastpost\":\"1305857313\",\"lastposter\":\"Daz\",\"excerpt\":\"For Ext 330 using Firefox 4 Firebug, the following error is often happening when our app loads e._flyweights is undefined Yet, this \"}," +
"{\"title\":\"hellllllllllllllpwhy it doesn't fire cellclick event after I change the cell value\",\"threadid\":\"133827\",\"username\":\"aimer311\",\"userid\":\"162000\",\"dateline\":\"1305700219\",\"postid\":\"603309\",\"forumtitle\":\"Ext 3x Help\",\"forumid\":\"40\",\"replycount\":\"3\",\"lastpost\":\"1305856996\",\"lastposter\":\"aimer311\",\"excerpt\":\"okI will discribe this problem as more detail as I canI look into this problem for a whole dayI set clicksToEdit1 to a EditorGridPanelso when I\"}]}";
I've got the following error:
Syntax error at line 1 while loading:
{"totalCount":"3","topics":[{"title
-------------^
expected ';', got ':'
P.S. #2. When I've added '[' to the begining of the response string and ']' to the end , erros disappered, but grid hasn't been filled with data
You're not returning (valid) JSON. Refer to the JSON site for details, but for instance, all property keys must be in double quotes. (All strings must also be in double quotes; single quotes are not valid for JSON strings.)
So for instance, this is not valid JSON:
{totalCount:'3'}
...because the key is not in quotes, and the value is using single quotes. The correct JSON would be:
{"totalCount":"3"}
...if you really want the 3 to be a string, or:
{"totalCount":3}
...if the 3 should be a number.
People frequently confuse JSON and JavaScript's object literal notation, but they are different. Specifically, JSON is a subset of object literal notation. A lot of things that are valid in object literal notation are not valid in JSON. Any time you're in doubt, you can check at jsonlint.com, which provides a proper JSON validator.
I have found the root of issue.
As I've known Ext send to my web service function with parameter 'callback=[some_callback_name]' (e.g. callback1001). It means that Extjs wanna to get results not just in JSON format, but in format 'callback1001()'. When I've return my data in this format everything became good.
Proof links:
http://www.sencha.com/forum/showthread.php?22990-Json-Invalid-label (response #6)
http://indiandeve.wordpress.com/2009/12/02/extjs-error-invalid-label-error-while-using-scripttagproxy-for-json-data-in-paging-grid-example/

Categories

Resources