Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Set Value in JavaEdit Inside JavaTable
#1
Solved: 11 Years, 4 Months ago
I would like to know how can I set a value for a JavaEdit inside the JavaTable. I've tried the following but it's not working.

Code:
JavaWindow("...").JavaTable("...").SetCellData "0", "0", "value"
Reply
#2
Solved: 11 Years, 4 Months ago
Hi,

Remove the "" for row,column.

Try as given below :

Examples:
Code:
JavaWindow("...").JavaTable("...").SetCellData 0, 0, "value"
JavaWindow("...").JavaTable("Table Example").SetCellData 2, 4, "CostCenter"
Reply
#3
Solved: 11 Years, 4 Months ago
I tried to remove the double quotes but it still does not work. There is a JavaEdit field in the JavaTable, does this have any effect? Thank you!
Reply
#4
Solved: 11 Years, 4 Months ago
Hi yonobev,

Oh Okay !!!

If you mean to say that "JavaEdit is located inside the JavaTable's Cell", then try as given below.

Code:
JavaWindow("...").JavaTable("...").ChildItem(0,0,"JavaEdit",0).Set "test Value"

Do let us know if it's working fine , I hope it wouldSmile
Reply
#5
Solved: 11 Years, 4 Months ago
Hi,

It is still not working. I tried to record the script again, but when I played, it does not work.

Regards!
Reply
#6
Solved: 11 Years, 4 Months ago
HI,
You can stet the value in a java edit inside java table using childitem

Code:
set jedit=JavaWindow("...").JavaTable("...").ChildItem(row number,column number,"JavaEdit",Index).Set "test Value"

here rownumber and column number is nothing but the place where javedit is placed in Javtable and Index is the index of the propert i.e java edit

Note: u might have used the row=0 and column=0 please change this value w.r.t youe javaedit and try with this

Thanks,
Venkat.Batchu

Type error
find the below one:

Code:
JavaWindow("...").JavaTable("...").ChildItem(row number,column number,"JavaEdit",Index).Set "test Value"
Reply
#7
Solved: 11 Years, 4 Months ago
There could be a issue of polymorphisim. For the Row and column try with Cint and see if that helps.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#8
Solved: 11 Years, 4 Months ago
(11-15-2009, 01:30 PM)basanth27 Wrote: There could be a issue of polymorphisim. For the Row and column try with Cint and see if that helps.

I have pretty same issue, when I record the steps it looks like this:

Code:
JavaWindow("name").JavaDialog("name").JavaTable("name").SetCellData "#0","Area","01     ANTENNA"

But when I re-run it does not actually select a value but only kind of activates de list or something related (as before running the code above the row / column shows as gray but after, it becomes white), see below:

the list:
   

before running the line above:
   

and after: running the line above
   


The list when looking at it using the Spy Tool has JavaEdit object inside - these are those records listed under the list (a JavaEdit object for each record)..
Reply
#9
Solved: 11 Years, 4 Months ago
Just before that statement you can emulate a click. Essentially the first click will select and then the second click will Set the data as required.
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#10
Solved: 11 Years, 4 Months ago
(10-12-2017, 03:30 PM)Ankur Wrote: Just before that statement you can emulate a click. Essentially the first click will select and then the second click will Set the data as required.

Hi Ankur, this is actually something which I tried and worked, the difference is that I actually used the JavaList objects inside each table's cell instead of the JavaEdit ones, see the code sample below:
Code:
'grid/table:
JavaWindow("AppMain").JavaDialog("myDialog").JavaTable("tblName").Highlight
'Column 1:
JavaWindow("AppMain").JavaDialog("myDialog").JavaTable("tblName").ClickCell 0, "col1_Title", "LEFT"
'List inside column 1:
JavaWindow("AppMain").JavaDialog("myDialog").JavaList("listName").Select valueForCol1

'Column 2:
JavaWindow("AppMain").JavaDialog("myDialog").JavaTable("tblName").ClickCell 0, "col2_Title", "LEFT"
'List inside column 2:
JavaWindow("AppMain").JavaDialog("myDialog").JavaList("listName").Select valueForCol2

'Column 3:
JavaWindow("AppMAin").JavaDialog("myDialog").JavaTable("tblName").ClickCell 0, "col3_Title", "LEFT"
'List inside column 2:
JavaWindow("AppMain").JavaDialog("myDialog").JavaList("listName").Select valueForCol3

'click OK button:
.JavaButton("text:=OK").Click
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Access to JavaCombobox in JavaTable cell? jarkkop 2 3,742 10-17-2018, 09:32 PM
Last Post: riyaz
  Objects inside WpfList shinji458 23 22,294 11-08-2017, 10:54 PM
Last Post: lotos
  Want to read the data from excel and set read value in the JavaTable rajeevk7 0 2,312 07-10-2017, 04:20 PM
Last Post: rajeevk7
  Working on javatable reddyraam10 0 1,769 02-07-2017, 08:12 AM
Last Post: reddyraam10
  Get numbers inside all webelements in webtable and sort them pradeep537 1 2,816 08-04-2016, 01:24 AM
Last Post: Ankur

Forum Jump:


Users browsing this thread: 1 Guest(s)