View Full Version : Interface Questions
mikemeer
2012-08-06, 11:01
Hi All,
1) How would I structure a page to show a list of searchable criteria that could be entered BEFORE the data is retreived? If I have over 300,000 order records, I don't want to pull that many records from SQL.
2) How do I change the appearance of the buttons on the bottom? It is very hard to tell if a button (say delete) is disabled.
3) If I turn "off" a field via roles/permission, will the associated label disappear too?
Thanks,
Mike
lianjasupport
2012-08-06, 11:28
1. You need to build a custom query form as a custom canvas then have some buttons that do the retrieval and then change the datasource on a grid (assuming you want to populate a grid).
2. The "FormBar" at the botton of the screen is a standard attribute and can be hidden/disabled. If the user does not have delete permission the button should be grayed out. If it isn't thats a bug.
3. Yes the field (caption and control) will not be visible. Thats also true for apps, pages and sections. Its all role/permission based.
sidenote: it sounds like we need a new attribute (Don't load data when app first loaded) that will prevent the grids being populated automatically when the App is loaded. This would provide the functionality that you are mentioning i.e. build a query and the call refresh() on the grid from a commandbutton click delegate.
lianjasupport
2012-08-06, 11:29
Note also that you can "hide the section header at runtime" so its only there at design time. So when you switch into runtime view you will see your sections all laid out vertically above each other just like a normal "Form".
lianjasupport
2012-08-06, 12:54
Mike, there is also a "Filter" attribute on a grid section. In beta9R5 (due this week) if you set the filter value to either .f. or 1=0 then no data is retrieved.
You can change the filter in a delegate just by referencing the grid contained within the section using the Lianja Object Model e.g.
mygrid = Lianja.getElementByID("mygridsection").grid
mygrid.filter = "overdue_amount > 0"
mygrid.refresh()
1. You need to build a custom query form as a custom canvas then have some buttons that do the retrieval and then change the datasource on a grid (assuming you want to populate a grid).
2. The "FormBar" at the botton of the screen is a standard attribute and can be hidden/disabled. If the user does not have delete permission the button should be grayed out. If it isn't thats a bug.
3. Yes the field (caption and control) will not be visible. Thats also true for apps, pages and sections. Its all role/permission based.
sidenote: it sounds like we need a new attribute (Don't load data when app first loaded) that will prevent the grids being populated automatically when the App is loaded. This would provide the functionality that you are mentioning i.e. build a query and the call refresh() on the grid from a commandbutton click delegate.
In our "big" app the search criteria in "advanced" mode fill 4 pages of a pageframe. We'll be putting that in a section of its own, and putting the Grid in a section of its own. Click the custom search button and the Criteria section is made visible. Click the Find criteria, and if records are located, the criteria section goes away, and the grid section becomes visible. It's not supposed to be this easy. :) The Grid section will be the parent for the data section (s) below, of course. Once it has records in it, the Grid section will be able to be minimized, but will remain available for further selections.
Hank
mikemeer
2012-08-06, 16:50
Hank,
What kind of app are you building? Has it been deployed yet? I would love to hear more about it.
Mike
sidenote: it sounds like we need a new attribute (Don't load data when app first loaded) that will prevent the grids being populated automatically when the App is loaded. This would provide the functionality that you are mentioning i.e. build a query and the call refresh() on the grid from a commandbutton click delegate.
I think this should be delegated to the cursoradapter[s], as perhaps some need to load data to spec the options to select from.
my 0.02€
thomas
lianjasupport
2012-08-07, 08:55
Yes we are considering this i.e. adding a custoradaptor attribute to a section. We always have to take care not to tie the whole App into the desktop though, thats always the challenge. There are also other casual developers who dont need nor understand the whole concept of cursoradptors.
The overall concept behind Lianja is to treat "Sections" as a visual representation of "Database Tables". The sections being related together visually so it merges the concepts of relational database and visual elements which may or not be SQL data i.e. they can contain web content or other.
Anyway as I say we are looking into the best way to provide this without making it too complex to use and understand.
Yes we are considering this i.e. adding a custoradaptor attribute to a section. We always have to take care not to tie the whole App into the desktop though, thats always the challenge. There are also other casual developers who dont need nor understand the whole concept of cursoradptors.
The overall concept behind Lianja is to treat "Sections" as a visual representation of "Database Tables". The sections being related together visually so it merges the concepts of relational database and visual elements which may or not be SQL data i.e. they can contain web content or other.
Anyway as I say we are looking into the best way to provide this without making it too complex to use and understand.
+1 for a cursoradapter source for a section. That way we're not pulling foreign tables down for FK descriptions. Combined with the new "dialog button" attribute from which to make a new selection from the parent table, that will solve a lot of speed issues in tables with lots of FK's, as all our main tables have.
Since you're parsing the SQL anyway, I imagine there's a graph that shows from what table each field derives; that information could be use to access the DD information for that field. Just thinking out loud...
My .0248379$ (not wanting to underspend Thomas <s>)
Hank
Yes we are considering this i.e. adding a custoradaptor attribute to a section. We always have to take care not to tie the whole App into the desktop though, thats always the challenge. There are also other casual developers who dont need nor understand the whole concept of cursoradptors.
The overall concept behind Lianja is to treat "Sections" as a visual representation of "Database Tables". The sections being related together visually so it merges the concepts of relational database and visual elements which may or not be SQL data i.e. they can contain web content or other.
Anyway as I say we are looking into the best way to provide this without making it too complex to use and understand.
UNderstood. A section property overriding the default property of the used datastore interface in Javaspeak ;-)
Datastore property set to something besides the default or none/null will trump the section property,
thus giving you the option to have Python dicts or list of dicts as datastore, or arrays of JSON/JS objects in web apps...
Should work, esp. if you keep behaiviour and data separate (as the data in the cursor has [nearly] no own behavior).
regards
thomas
lianjasupport
2012-08-07, 14:00
Yes you can do all that now with custom or canvas sections but to provide drag and drop form and or grid sections that won't work. So it's a trade off between ease of development and what you mention. We will think more about this. Cursoradpators can handle data access but they have no known methods for querying columns etc that is data source independent.
Yes you can do all that now with custom or canvas sections but to provide drag and drop form and or grid sections that won't work. So it's a trade off between ease of development and what you mention. We will think more about this. Cursoradpators can handle data access but they have no known methods for querying columns etc that is data source independent.
re: datasource independent -- I plead confusion. :) The cursoradapter can connect to any ODBC datasource. Obviously I'm missing something. If you could enlighten my ignorance, I would be very appreciative, again.
re: won't work on form or grid sections: similar confusion and request. I would see the cursoradapter as the datasource, and the cursoradapter alias as the table.
tia,
Hank
lianjasupport
2012-08-07, 16:37
Let me explain the problem then.
In the "Page Builder" the "Databases", "Tables" and "Columns" on the left hand side.
Double click a database displays the tables.
Click a table displays the columns.
Ok right...
Drag a "Table" onto a page and voila a form section (or grid if Ctrl+drag).
So..
Having an empty form section and specifying a cursoradapter... Where are the fields and what fields should be displayed and where? Furthermore, the way that Lianja lets you work with live data (a snapshot of your data) allows you to visually see exactly how the App will look against the "real live data" when we enable the ODBC connection string in runtime mode.
Yes, the cursoradaptor when opened connects via odbc and executes some select statement BUT that way is the opposite way that Lianja allows you to drag from an existing database table and none of this fits into the Database/Table/Columns UI panels. What happens if you build a Form section against a certain CursorAdaptor then change it? So these things have to be taken into consideration.
IOW CursorAdaptors represent "Virtual tables" which is what SQL SELECT statements give us -- and CursorAdaptors do not belong to a database container.
On top of this every ODBC datasource has a different way of querying its tables and its constraints. There is no real standard for this. MSSQL for example requires tables to be qualified with a schema name and we have to take care of that. Other databases e.g. oracle operate differently again.
So in a nutshell, just providing a "CursorAdaptor" attribute is all fine and dandy but you would lose a lot of the functionality.
OTOH you can do what you want with a Custom and Canvas sections.
I'm not saying its not possible, I'm just saying at this moment in time its is not and we are still looking into the best way to provide this functionality so it is seamless and does not break product nor the methodology behind building Apps.
jcmca1@yahoo.com
2014-08-23, 15:13
I am having trouble with the interface, and developing 'pages'.
Firstly, this below, was posted in a reply by the development team:
"The overall concept behind Lianja is to treat "Sections" as a visual representation of "Database Tables". The sections being related together visually so it merges the concepts of relational database and visual elements which may or not be SQL data i.e. they can contain web content or other."
I am trying, as my first effort, to make a simple log in screen. I have 4 memvars, and one table with users, and some fields with stuff they must get right before being able to log in, such as date of birth, last 4 social security numbers, and a password. I started off adding a 'form' to the 'page', and then textboxes to that form, but the system tells me I first need to add a canvas. Adding a canvas creates another 'section', which, if bearing in mind what the development team above wrote, is not what I want. All I want is a blank page, 4 entry fields, a button for 'loging in', and a lable, of which I can programatically change the caption with either a successful, or unsuccessful login message. In VFP it is the simplest thing to do, but here it goes completely against what the development team states above. Can we actually program in Lianja, or is it just a drag and drop tool for desktop users wanting to visually see what data they have?
Thanks.
hmischel@diligentsystems.com
2014-08-24, 22:55
Hi JMCA1,
In Lianja that are many ways to skin the cat, from Drag and Drop to doing almost everything via code.
It's so flexible, that it can sometimes be daunting or confusing.
For what you are trying to accomplish, try the following.
Add a page and call it page1
Add a canvas section to the page and call it section1.
Note* - To add items to a canvas, you use the advanced menu on the bottom of the app builder.
Add a label to the page. Make sure it is highlighted, then double click it to get the field attributes and name it label1. Change it's caption to "test". Move it to where you like.
Add a textbox the same way. Change its name to textbox1. You can keep or hide the caption.
Add a commandbutton the same way. Make sure you click the edge of the commandbutton until it is highlighted, then double click it to see the field attributes.
scroll down the custom delegates until you see the click event. Click on the two dots on the right. An editor will open for you to add your code.
It will look like this.
// Event delegate for 'click' event
proc page1_section1_field3_click()
// insert your code here
endproc
change it to look like this
// Event delegate for 'click' event
proc page1_section1_field3_click()
//get references to your object
myTextbox = Lianja.get("page1.section1.textbox1")
myLabel = Lianja.get("page1.section1.label1")
//Assign the value from the textbox to the label
myLabel.caption = myTextbox.text
endproc
Then when you save and run the application, it will replace the label with the value from the textbox.
754
Hope that helps.
Herb
ps - it worth taking the time to understand how the different sections work.
Hi Herb,
Your attachment seems to be invalid.
You may want to try again.
Cory
barrymavin
2014-08-25, 11:03
I can see it when I click in the link.
That's interesting.
When I click the link, I get:
Invalid Attachment specified. If you followed a valid link, please notify the administrator.
Me too..
ciao
Fabio
That's interesting.
When I click the link, I get:
hmischel@diligentsystems.com
2014-08-25, 13:37
Oops - I will re-attach it tonight.
It was just a screenshot of the form.
I will re-attach it tonight.
The overall point being that it is very simple to add controls and reference them via code. Which I think was the question.
Herb
hmischel@diligentsystems.com
2014-08-26, 06:14
756
jcmca1@yahoo.com
2014-08-29, 14:11
Thanks, Herb - I will try again this weekend. I did get the whole page laid out when I tried previously, but couldn't get anything to work. I will look at what you said on where to put the code, etc.
Can you point me to a section where I can read up about inputting into variables, etc? I have not come across anywhere where there is info on lianja.get(), and this seems to be key.
Many thanks again!
John
Hi John,
look up Lianja on the Lianja wiki.
It's short for lianja.getelementbyid(). It's a concept known to those coming from the Javascript/web world: it traverses the app tree (in this case) to find the named object.
I believe as you went through the videos there were at least a couple uses of it. This article http://www.lianja.com/doc/index.php/Working_with_the_Lianja_Object_Model (http://www.lianja.com/doc/index.php/Working_with_the_Lianja_Object_Model) has a good description of it. This is one of the articles in the Lianja Developers Guide, which has other very useful articles in it.
Hank