Page 1 of 1
Rename a listview entry
Posted: Mon May 08, 2023 6:29 pm
by papiosaur
Hello all,
i would like to rename a text entry in a listview but don't work.
my line is:
moai.DoMethod("listview", "rename", "active", column6$)
Hollywood writes me string expected in argument 5, what i need more, in example i see "..." but don't work.
I have problems with functions : domethod("listview', .... ) because there no examples, and i don't understand variables.
Thanks for your help!
Re: Rename a listview entry
Posted: Mon May 08, 2023 6:38 pm
by plouf
provide a MinimunExampleCode with a listview you want to rename to see whats wrong
i suspect your position ->"active" ?! is wrong usually should be a number 0,1 etc
Re: Rename a listview entry
Posted: Mon May 08, 2023 8:08 pm
by papiosaur
Hi plouf,
i would like just rename a path in my entry of the column6 when i click on button named "modifydestpath",
i have a poppath which return a path with the variable destpath$.
I would like rename the entry of the column6$ by destpath$.
Code: Select all
Case "Pressed"
Switch msg.ID
Case "modifydestpath"
moai.domethod'("listview", "rename", "active", column6$)
Endswitch
Re: Rename a listview entry
Posted: Mon May 08, 2023 8:15 pm
by plouf
the code should work when i copy paste it .
i still see that you use "Active" and not something like
moai.DoMethod("listview", "Rename", 1, column6$)
thats why a code that it should work, but FULLY code is necessary to check
i.e. do you have only 1 column ? what error provides etc
Re: Rename a listview entry
Posted: Mon May 08, 2023 9:06 pm
by papiosaur
i have 6 columns.
Something bizarre, if i write
moai.DoMethod("listview", "rename", "active", 1, 2, 3, 4, 5, despath$)
i have string 1 in column 1, etc.. and destpath$ in column 6 (it that i want)
I think there is a bug in RapaGui because normaly only column 6 is "EDITABLE"... Andreas?
But how to rename only column 6 ? I have tried this
moai.DoMethod("listview", "rename", "active", , , , , , destpath$)
but don't work...
Re: Rename a listview entry
Posted: Mon May 08, 2023 9:38 pm
by jPV
Documentation tells:
"If the listview has multiple columns, you need to pass a new name for every column. It is not possible to rename only a single column entry - this method always affects the complete row so you need to pass as many strings as there are columns in your listview."
So, enter as many strings as you have columns in the listview. If you don't have other columns stored elsewhere, you can always do GetEntry to get the existing data before passing it back with Rename.
Like:
Local c1$, c2$, c3$, c4$, c5$, c6$ =
moai.DoMethod("listview", "GetEntry", "Active")
moai.DoMethod("listview", "Rename", "Active", c1$, c2$, c3$, c4$, c5$, destpath$)
Re: Rename a listview entry
Posted: Mon May 08, 2023 9:54 pm
by papiosaur
Thanks jPV!
sorry, i didn't the first lines...