PDA

View Full Version : Importing VFP form with a problem



gerardo@hbaron.com
2013-05-07, 06:55
I was able to import a vfp form with a button, that had a messagebox with a hello world message in the click event, but I added a grid linked to a dbf in my hard drive, and I wasn´t able to see the grid when I reimported the form.

yvonne.milne
2013-05-07, 07:16
Hi Gerardo,

If you Submit a Ticket and attach the scx/sct to the ticket we can take a look.

Thanks,

Yvonne

ACRISOFT
2013-05-10, 13:03
Hi

I also tested .scx importer.

Looks like it's progressing, but seems far from achievement.

I would like to suggest that Lianja team test several .scx forms with several components and codes including embedded activeX and dataenvironment.

Only this way the importer project will succeed.

Also, creating an automatic importer to import forms from a folder create a new lianja page from each of them.

Moises



Hi Gerardo,

If you Submit a Ticket and attach the scx/sct to the ticket we can take a look.

Thanks,

Yvonne

K!k3
2014-06-04, 19:45
When I imported a form.

the scp file is a text file with all the properties and methods of any components.

Its easy to understand!

I have a doubt; Where is the FORM properties?
If I need modify the form's properties and methods; how can I do it?

Thanks

Victor Navarro
Barranquilla, COLOMBIA
3008102508
ICQ 279 364 380
Face: +573008102508 (http://www.facebook.com/victorenrique.navarrohoyos)
MSN: eres_un_vago@hotmail.com
Mail: eres_un_vago@yahoo.es (mailto:eres_un_vago@yahoo.es)
Whatsapp: +573008102508
Skype: eres_un_vago (skype:eres_un_vago?chat)
PIN: 7A3F5E60

K!k3
2014-07-26, 14:04
Well, when I import a form, I can see any details in the description, but, how can I modify the methods and properties, but when run, yes they is it, but, if need change something, when is this data?

Thanks again

Victor Navarro
Barranquilla, COLOMBIA
3008102508
ICQ 279 364 380
Face: +573008102508 (http://www.facebook.com/victorenrique.navarrohoyos)
MSN: eres_un_vago@hotmail.com
Mail: eres_un_vago@yahoo.es (mailto:eres_un_vago@yahoo.es)
Whatsapp: +573008102508
Skype: eres_un_vago (skype:eres_un_vago?chat)
PIN: 7A3F5E60

CharlieDenver
2019-04-11, 10:09
Greetings
Just trying to get may head round a few things

As a test I created a form in VFP, three buttons and a text box, buttons change text in text box on click(), very simple runs fine
Opened Llainja, created a new desktop app (vfp)
Select Import VFP form, choose form - message beautyfing code
After a short pause Llainja crashes
re launched and tried again and it says xyz.scp already exists do I want to overwrite it, if I do overwrite the same thing happens - Lianja crashes

If I don't overwrite it, I can see a file under app files / forms called xyz.scp which I can open, and I can see the code with various classes defined
I can run that and I can see the form running
So the code is building the form on the fly - fine with that

Apart from the crashing element ?
I want to learn to replicate that form using the page builder

I have a canvas and a commandbuton and a label controltype with a name of Field2 and a fullname of page1.section2.field2
Could someone help me with the syntax to reference that... so as to change the label caption to "Something" ... in the click event of the commandbutton
I did try page1.section2.field2.caption="Something" etc

Also is there a good source of syntax information for referencing form controls etc

Many Thanks

yvonne.milne
2019-04-11, 10:53
We have had reports of some issues with vfp_beautify in the current version, this has been fixed in the forthcoming Lianja 5.0. For now, please do the following before importing your VFP project or files:

Go to the Library workspace and edit the Script File vfp_import_xcx.prg and comment out lines 341 and 342, then save:

//Lianja.showMessage("Beautifying code", 175)
//vfp_beautify(m.cOutputFile)

Regards,

Yvonne

CharlieDenver
2019-04-11, 11:13
Apart from the crashing element ?
I want to learn to replicate that form using the page builder

I have a canvas and a commandbuton and a label controltype with a name of Field2 and a fullname of page1.section2.field2
Could someone help me with the syntax to reference that... so as to change the label caption to "Something" ... in the click event of the commandbutton
I did try page1.section2.field2.caption="Something" etc

Also is there a good source of syntax information for referencing form controls etc

Many Thanks

barrymavin
2019-04-11, 11:26
There is a ton of documentation. Each forum has “Essentials” which will guide you.

In this forum that you have posted you will see above “Development Essentials”. Click that and look at the Lianja object model.

https://www.lianja.com/community/forumdisplay.php?80-UI-Essentials

https://www.lianja.com/community/forumdisplay.php?82-Development-Essentials

Look in each forum at each Essentials and it will help get you up to speed.

yvonne.milne
2019-04-11, 11:32
(I was too slow, but some more links here)

Use Lianja.get() or synonyms:

Working with the Lianja Object Model (https://www.lianja.com/doc/index.php/Working_with_the_Lianja_Object_Model)

Note that for Canvas Advanced Controls, you can use a unique name rather than a hierarchical name.

There are some example Apps with Canvas Sections, including:

Lianja Custom Canvas Demo (lianjcustomcanvas) (Desktop, Lianja/VFP)
Lianja Canvas Section Web UI Demo (example_webapp3) (Web, JavaScript)

Attributes Documentation (https://www.lianja.com/doc/index.php/Category:Attributes)

Regards,

Yvonne

CharlieDenver
2019-04-11, 12:36
** I just found it **
setAttribute
It's knowing where to look !
Thankyou



Thanks Yvonne,
I will get going I'm sure, sometimes a little nudge goes a very long way
I've been through the object model and I can return all the items and values fine, and am fine with unique names etc all good there ...
with the imported VFP form code I can see how that changes label captions at run time and I'm 100% ok with VFP
However, when it comes to the page builder, which is where I want to be, I can't find any reference to change to the value of an item at run time say in the commandbutton click procedure
Am I missing something that's really obvious ?


Like in VFP is just thisform.label1.caption='XYZ' etc

yvonne.milne
2019-04-11, 12:47
Lianja.get("mypage.mysection.mylabel").caption = 'XYZ'

or, providing you have a unique name in the Canvas Section,

Lianja.get("mylabel").caption = 'XYZ'

Regards,

Yvonne

CharlieDenver
2019-04-11, 12:56
I get it now, perfect, thanks, Giant steps

CharlieDenver
2019-04-12, 06:22
Hi
Where can I find the example apps please -> Lianja Custom Canvas Demo (lianjcustomcanvas) (Desktop, Lianja/VFP)

Also , I'm wondering how to set the initial value at run time of a label as the below INIT event isn't doing it

proc page1_section2_XYZButton_click()
Lianja.get("MyLabel").caption = 'XYZ'
endproc

proc page1_section2_ABCButtton_click()
// Lianja.get("Mylabel").setAttribute("caption","ABC")
Lianja.get("MyLabel").caption = 'ABC'
endproc

proc page1_section2_MyLabel_init()
//Lianja.get("MyLabel").setAttribute("caption","***")
Lianja.get("MyLabel").caption = '***'
endproc

yvonne.milne
2019-04-12, 07:09
Included in the App Builder. 'Lianja Custom Canvas Demo' is the App title in the Home workspace, under 'Demo Desktop Apps'. Or open it from the Apps workspace - the App name is 'lianjcustomcanvas' under 'Demo Desktop Apps'.

Regards,

Yvonne

CharlieDenver
2019-04-12, 07:48
Thanks Yvonne
I don't have Demo Desktop Apps in the home workspace for some reason, I've found it though - thanks

I was wondering how to set the initial value at run time of a label as the below INIT event isn't doing it
can you point me to any info about the sequence of how the apps load


proc page1_section2_XYZButton_click()
Lianja.get("MyLabel").caption = 'XYZ'
endproc

proc page1_section2_ABCButtton_click()
// Lianja.get("Mylabel").setAttribute("caption","ABC" )
Lianja.get("MyLabel").caption = 'ABC'
endproc

proc page1_section2_MyLabel_init()
//Lianja.get("MyLabel").setAttribute("caption","***" )
Lianja.get("MyLabel").caption = '***'
endproc

yvonne.milne
2019-04-12, 08:04
If you open the (default) Project, you will see all the demo Apps.

Event Sequences (https://www.lianja.com/doc/index.php/Custom_Delegates#Event_Sequences)

Is there a reason why you are setting the captions programmatically rather than setting the attribute in the Page Builder?

Regards,

Yvonne

CharlieDenver
2019-04-12, 12:51
Yes, I was hoping I could control what the captions say when the page loads either based on public variables, or variables I pass the page, using the INIT() events
I'm so used to working in VFP I'm on a steep curve to get to grips with what I can and can't do (I'm fairly sure I can do this ?)
I've constructed many Generic forms that serve many purposes, so I'm just trying to understand If I can migrate that methodolgy to Lianja

I'm happy to look at the demo apps of course, but specifically I'm in evaluation and I need to get to some basic things quite quickly so I can make a call

The INIT of the label does allow for code to be added ?

I'll have a look trough the event sequences and see if that helps my understanding
I can only appologise if this is a pain but I can't justify the premium training costs right now


Phillip

*PS I could import the forms and run them as scripts, but I'm really keen to use the page builder so I can incorporate other Lianja features
Plus I'm not 100% sure how my grids will convert as I have a lot of dynamic change code, I've made big steps but time is of the essence


It may be my linear - procedural mind state , I'm happy to get other views

josipradnik
2019-04-12, 19:37
Hi,

Ready event is the best for doing this.

More info: http://www.lianja.com/community/showthread.php?2785-Answers-Events-sequence

and forum answers collection by topics: http://www.lianja.com/community/showthread.php?2717-Answers&p=12352&viewfull=1#post12352

barrymavin
2019-04-12, 21:05
There are always a variety of ways to do the same thing in Lianja.

Development in Lianja is mostly declarative. The appearance and behavior of the UI is affected by attributes that you specify in the app inspector. You then respond to events by specifying delegates.

Many textual attributes can contain {macros} that are substituted when the UI element e.g a section is refreshed. These macros can contain variable names, expressions or parameterized function calls.
https://www.lianja.com/doc/index.php/Understanding_Macros

You can therefore have captions that are dynamic.

Data binding inherits business rules and metadata such as captions, input masks, validation, data mapping, tool tips, autosuggestions, choice lists, etc from those defined in the table.

Metatypes can be associated with UI elements and are applied globally across all UI elements in your app which have them specified.

I do realize that as a VFP coder much of this is not familiar to you so you are trying to do what you have always had to do in VFP but that would be a mistake and will not work if you are going to build web or mobile apps also or write delegates in javascript rather than VFP.

It is worthwhile browsing the “Development Essentials”, “Scripting Essentials”, “Data Essentials”, and “UI Essentials” here in the forums to get more familiar with the Lianja Platform overall. It will save you time in the long term. Older forum posts may add to confusion as Lianja has often been enhanced with new features and functionality since they were posted.

As you can see on the forums, we are preparing “Online Training” which is a short video series for all of the training courses embedded here in the forums. These will be free and will be made available gradually once Lianja 5 has been released.

Lianja 5 is a significant leap in performance and productivity which is why it has taken a while to complete and QA. With reference to reusable components it supports the visual design of UI components in the canvas designer and the ability to use these components as custom sections and gadgets, grid cell renderers, dialog panel renderers etc. importantly these work across desktop, web and mobile apps.

I hope that helps.

CharlieDenver
2019-04-13, 04:05
Thankyou for that ...