PDA

View Full Version : That old devil callled Edit



SpringBox
2019-09-17, 13:03
Hi Guys

We want to put all pages of an appp in to edit mode following an add so data can be completed. Pressing add or edit on the actionbar does not do that - only the current page goes into edtmode if fullpageedit is .T.

We obviouly don't want pages always to be in editmode unless we are adding/editing

We can put pages in to editmode programatically but how do we test for edit status in js as we move from page to page? How can we test if save has been pressed on the action bar or do we need to do this programatically too?

Is there a way for all pages in an app to be in editmode/not in editmode at once?

We would like to make this simple if possible.

Thanks in advance


Simon

barrymavin
2019-09-17, 23:57
Hi Simon,

Pages are independent and have their own actionbar. They contain sections typically bound to data and have their state maintained as you navigate back and forward between them. There are various attributes which affect how they maintain their view of data.

The ability to perform CRUD operations on the sections of a page is controlled by clicking icons in the action bar of a page (the normal way) or programmatically.

If you want to enter a lot of data you should be using a tabview section in one page not multiple pages. Think of these pages as web pages in a browser. This tabbed UI is common in web apps.

SpringBox
2019-09-18, 06:24
Aha !!

SpringBox
2019-09-18, 12:14
Thanks Barry

Rewritten using js tabview section and the record pointer is now stable - thank you.

Page / section Editmode still only puts the first tab in the section to editmode so looks like we will still have to do each tab in the section separately.

We have tried :

Lianja.showDocument("page:pagecustomer?action=editmode");
Lianja.showDocument("section:sectioncustomer?action=editmode"); both only put 1st tab in to edit mode


Lianja.showDocument("section:tabcustomer?action=editmode"); works but needs calling for each section


Biggest problem is we are still having the same refresh & save issues though. We must have missed something fundamental and have spent 1/2 day trying to sort this one issue without success.

When we make changes by manually typing in, we can save via actionbar save as you would expect.

However when fields are updated in the tab section in code :

Lianja.getElementByID("pagecustomer.tabcustomer.txtadl3").text = addrDetails.adl3; works fine - display updated


How do we then save it?

If we press on the actionbar :

refresh - it reverts
save - it reverts
update - it reverts
Toggle edit mode - it reverts

So we cannot easily save ANY data changed via code, only what is typed in. Your example_pclookup app exhibits the same behaviour. Data is unsaveable.

Do we have to commit the data before saving in some way?

So, how do we save data changed via functions? If we are having these issues, surely others must have had them too.

Thanks

Simon

barrymavin
2019-09-18, 12:37
If you are having issues with the pre-release version which we have given you access to please submit tickets as we can't debug your app on the forums.

Package it up as an lpk and attach to your ticket so it can be investigated.

Also provide details of whether you are you are referring to desktop or web app.

barrymavin
2019-09-18, 12:42
Also, have you checked the page as full page edit?

SpringBox
2019-09-18, 12:43
Hi Barry and thanks for the reply

This is being run/tested on desktop at the moment but we are writing it to be a mobile app on an iPad once all done.

We appreciate that you cannot debug an app on the forums and we only post here when we have researched extensively and run out of options or hair to pull out !!

Will submit a ticket. What is an lpk file?

Does the example_pclookup behave differently for you?

Cheers

Simon

SpringBox
2019-09-18, 12:46
Full page edit .T.
Refresh when activated .T.

Thanks

Simon

barrymavin
2019-09-18, 12:55
Lianja packages are fundamental to app distribution as they are cross platform.

https://www.lianja.com/doc/index.php/Lianja_Package_Manager

I would also recommend browsing through the online documentation at your leisure.

SpringBox
2019-09-18, 16:47
Hi Barry

Sent by email

Thanks in advance

Simon