jqGrid problem, expecting jQuery.jgrid but $.jgrid exists instead - java

I'm using jqGrid for a JIRA plugin and have included the jquery and jqgrid libraries as web resources.
I've set up a column in jqGrid as required and when I try to submit the form with the respective column empty I get an error in firebug: jQuery.jgrid is undefined
jQuery.jgrid is null but $.jgrid has the correct data.
Does anyone know how I can set up jqgrid so that it points to the $.jgrid without having to change all the source code? or any other way round this?
Thanks

That is really weird. Maybe this will work:
jQuery.fn.jgrid = $.jqgrid;
You should try that, but I'm really not shure if it will work.

Related

Getting the Header Values visible in SortableTableView in ISchwarz23's library

I've tried to use this library to get a table view but when i try to do so using the below code, the table headers are not shown at all. Can someone please offer me a helping hand here..
TableView tableView = (TableView) findViewById(R.id.tableView);
tableView.setColumnCount(4);
tableView.setHeaderAdapter(new SimpleTableHeaderAdapter(this,"Header", "is", "not","visible!"));
tableView.setDataAdapter(new SimpleTableDataAdapter(this,DATA_TO_SHOW));
Try download the Latest release - SortableTableView v2.5.0

How to hit the rest endpoint that has `:.*` as a part of the path param field

I am using the Stash's REST API in my project. My task is to get the tag details for a specific tag. After checking the Stash's REST API documentation, I found the correct endpoint that I should be using. It is
/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/tags/{name:.*}
Please see this link for the Stash's REST API documentation.
There is one more endpoint /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/tags
With this endpoint I am able to retrieve all the tags. The StashTag object looks something like this.
{
"id": "refs/tags/v4.0.0",
"displayId": "v4.0.0",
"latestChangeset": "234dadf41742cfc2a10cadc7c2364438bd8891c5",
"latestCommit": "234dadf41742cfc2a10cadc7c2278658bd8891c5"
"hash" : "null"
}
My first problem is, I don't know which field to use as the parameter for {name:.*}. Should it be the displayId or Id or anything else.
The second problem is, I don't understand what it means to have : (colon) followed by a . (dot) in the endpoint /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/tags/{name:.*}.
Can someone explain me what is the purpose of :. in the path param and how to hit this kind of an endpoint. Also an example of the complete endpoint would be nice.
So far I have tried hitting
https://stashtest.abc.com/rest/api/1.0/projects/KARTIK/repos/kartiks-test-repository/tags/v4.0.0
https://stashtest.abc.com/rest/api/1.0/projects/KARTIK/repos/kartiks-test-repository/tags/refs/tags/v4.0.0
None of these endpoints work.
Any help is appreciated.
The {name:.*} is really just saying that the field name can be anything. Chalk this one up to poor documentation on their part. Think of it like Regex field, because that's exactly what it is. I'm sure at one point they had something like ^[0-9] then went back and changed it when they realized using only tag numbers would omit anyone using their lightweight tag features.
Remove the v from your tag version and see if that helps. If it does not, I would also recommend creating a lightweight tag (something like mytag) and seeing if you can hit it that way (i.e., /kartiks-test-repository/tags/mytag).
But looking at that documentation is telling me that your v in your tag name is throwing off the REST call.

Check fails even if it exists in scala

I have recorded a session in scala. One request is failing even though I can see that tag in View source and Inspect Element. I tried all the other hidden fields but seems this one is not found. Here is the script:
val scn = scenario("Scenario Name")
.feed(csv("user_credentials.csv"))
.exec(http("request_1")
.get("/userLogin")
.headers(headers_1)
.check(regex("""<input id="javax.faces.ViewState" """).saveAs("ViewState_id"))
).pause(1)
.exec(http("request_999")
.post("/userLogin")
.headers(headers_1)
.param("""loginForm""", """loginForm""")
.param("""errorMsg""", """""")
.param("""c_username""", "${username}")
.param("""javax.faces.ViewState""", "${ViewState_id}")
.param("""goButton""", """goButton""")
)
The error which I'm getting is,
c.e.e.g.h.a.GatlingAsyncHandlerActor - Request 'request_1'
failed : Check 'exists' failed, found None
I found the tag <input id="javax.faces.ViewState" ..../> in source but this script is not able to find it. I tried testing with other fields and some hidden fields also, all other components are found except this. How to solve this issue?
I suspect the problem is that the id of your ViewState object is not actually javax.faces.ViewState - the name will be javax.faces.ViewState, but in the JSF implementations that I've seen, the id is something like j_id1:javax.faces.ViewState:0.
The simplest solution would be to follow the instructions at https://github.com/excilys/gatling/wiki/Handling-JSF for handling JSF in Gatling. Or, you could search for the ViewState element by name, rather than id - something like:
.check(css("""input[name="javax.faces.ViewState"]""", "value").saveAs("ViewState_id"))
Should do the trick.

JQuery EasyUI TreeGrid Dynamic Data Loading

I'm new to jQuery and am not quite sure how to do the following:
I'm using EasyUI TreeGrid and want to display dynamic data rather than providing static data from a .json file. Currently, the code I'm using is as follows:
$(function(){
$('#test').treegrid({
url:'treegrid_data.json',
and so on. Instead, is there any way I can pass an ArrayList or bean object or something directly?
Thanks in advance.
instead of getting the static json file.. point the url to a page where you are getting a dynamic value.. say dynamic.php
url:'dynamic.php',
....
and do your stuff like mysql connect.. or getting the dynamic datas in dynamic.php and return it as json....
dynamic.php
//do your stuff like getting dynamic datas in array..
$dynamicarray= $yourDynamicDataArray..
echo json_encode($dynamicarray);
this should do...
Figured it out...instead of pointing to a static json file, specify the url as url: 'dynamic.jsp' or url: 'dynamic.java' pointing towards a jsp or servlet respectively(since we are developing a web application). In that page simply get the json string, say, as an attribute and print it using out.println(jsonString). Do not include any HTML tags whatsoever or you won't get the desired output.

Url Encoding problem in Java and Solr

I am working in Solr and making some filter quires. One of my filter is consists of a space
for eg:- "fq=listing_type:New home"
But this is giving error. No result is comming out.
I also tried "fq=Listing_type:New+home"
This was not giving error. But no results are comming out. Event there is some xml which have thse values.
Can anyone tell me where is my error?
Here you see the schema.xml
Have you tried with fq=listing_type:"New home" ??? Why dont you index this field as "NewHome" ?

Categories

Resources