Micro Focus QTP (UFT) Forums
Set Value in JavaEdit Inside JavaTable - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Set Value in JavaEdit Inside JavaTable (/Thread-Set-Value-in-JavaEdit-Inside-JavaTable)



Set Value in JavaEdit Inside JavaTable - yonobev - 11-10-2009

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"



RE: Set Value in JavaEdit Inside JavaTable - sreekanth chilam - 11-10-2009

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"



RE: Set Value in JavaEdit Inside JavaTable - yonobev - 11-11-2009

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!


RE: Set Value in JavaEdit Inside JavaTable - sreekanth chilam - 11-11-2009

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


RE: Set Value in JavaEdit Inside JavaTable - yonobev - 11-11-2009

Hi,

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

Regards!


RE: Set Value in JavaEdit Inside JavaTable - venkatbatchu - 11-12-2009

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"



RE: Set Value in JavaEdit Inside JavaTable - basanth27 - 11-15-2009

There could be a issue of polymorphisim. For the Row and column try with Cint and see if that helps.


RE: Set Value in JavaEdit Inside JavaTable - lotos - 10-12-2017

(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:
[attachment=1430]

before running the line above:
[attachment=1428]

and after: running the line above
[attachment=1429]


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)..


RE: Set Value in JavaEdit Inside JavaTable - Ankur - 10-12-2017

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.


RE: Set Value in JavaEdit Inside JavaTable - lotos - 11-08-2017

(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