[Solved] Cursor is not in field (dialog in Calc, BASIC)

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
sevalav
Posts: 91
Joined: Mon Apr 16, 2012 12:37 am

[Solved] Cursor is not in field (dialog in Calc, BASIC)

Post by sevalav »

I posted here the same problem:
http://www.oooforum.org/forum/viewtopic ... highlight=
but in this forum I can not attached the document. So, I am now here.
My problem is that cursor is not in field SifraArtikla, in my dialog (in Calc) after this code. When I again push the same code, then cursor is there. Can somebody help me about this?
I am using Oo 3.3 Win.

Code: Select all

Sub CLEARFIELDS
SifraArtikla = prozorRACUNI.getControl("NumericField1")
NazivArtikla = prozorRACUNI.getControl("TextField1")   
Kolicina = prozorRACUNI.getControl("NumericField2")
MPcena = prozorRACUNI.getControl("NumericField3")
OsnovicaZaPDV = prozorRACUNI.getControl("NumericField8")
StopaPDV = prozorRACUNI.getControl("NumericField9")
ObracunatPDV = prozorRACUNI.getControl("NumericField10")
MPvrednost = prozorRACUNI.getControl("NumericField12")
Lager = prozorRACUNI.getControl("NumericField13")
TipArtikla = prozorRACUNI.getControl("TextField3")

NazivArtikla.getModel().SetPropertyToDefault("Text")
Kolicina.getModel().SetPropertyToDefault("Value")
MPcena.getModel().SetPropertyToDefault("Value")
OsnovicaZaPDV.getModel().SetPropertyToDefault("Value")
StopaPDV.getModel().SetPropertyToDefault("Value")
ObracunatPDV.getModel().SetPropertyToDefault("Value")
MPvrednost.getModel().SetPropertyToDefault("Value")
TipArtikla.getModel().SetPropertyToDefault("Text")
Lager.getModel().SetPropertyToDefault("Value")
SifraArtikla.getModel().SetPropertyToDefault("Value")
SifraArtikla.setFocus() ' <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< this line is important
End Sub
Attachments
Example.ods
(25.88 KiB) Downloaded 153 times
Last edited by Hagar Delest on Tue May 29, 2012 9:48 pm, edited 1 time in total.
Reason: tagged [Solved].
Apache OpenOffice 4.1.0, Win
User avatar
JohnSUN-Pensioner
Volunteer
Posts: 876
Joined: Fri Jan 14, 2011 1:21 pm
Location: Kyiv, Ukraine

Re: Cursor is not in field (dialog in Calc, BASIC)

Post by JohnSUN-Pensioner »

Try this (Pokušajte ovo)
Cursor is not in field.PNG
I may not have a lot to give but what I got I'll give to you...
Apache OpenOffice 4.1.5, LibreOffice 6.4.4.2 (x64) on Windows 7
If you think that I did not answer your question, make allowances for my imperfect English
sevalav
Posts: 91
Joined: Mon Apr 16, 2012 12:37 am

Re: Cursor is not in field (dialog in Calc, BASIC)

Post by sevalav »

Thanks, that is solution! (Hvala, to je rešenje!)
Apache OpenOffice 4.1.0, Win
Post Reply