How does one do a dynamic table in IBM Notes 8.5.3 or 9.0.1? - domino-designer-eclipse

I'm writing a Notes Client application. Web compatibility is a secondary concern. The language is LotusScript.
The specification: a form to enter lines from receipts. The lines are all saved as part of the same document so that they can be signed as an atomic unit.
When a line is added, it is to be formatted into a table for presentation. Ultimately, this architecture is like an input/datastore/presentation split.
I've managed to get the data stored and signed, and I think I've managed to get it deserializing properly (the LotusScript debugger makes it difficult to see, but it looks right). The problem now is the UI.
Looking at the Programmable Table, it is always a tabbed table with only one row shown per tab. I need a programmable table which can dynamically have rows added to it for display, without forcing new tabs to be created.
This suggests that I would need to use a Rich Text field to contain a table, but thus far my attempts to get anything to display when I try to update a Rich Text field in edit mode have failed. I am forced to conclude that it is impossible.
I cannot figure out how I'm supposed to do a dynamically-displayed list of tabular data like this. Any advice?

Most people just create a table with one row and N columns, with a multi-valued field in each column, and use code to append values to each of the fields in parallel. You don't get borders between rows this way or the ability to do variable formatting of cells, and you have to be careful to avoid letting data length exceed column widths in order to keep everything aligned properly.
If you truly want a dynamic table for presentation with all the bells and whistles that you can get in terms of cell formatting, then the Midas Rich Text API from Genii Software is a commercial solution that can do the job.

I blogged about this a couple of years ago: http://blog.texasswede.com/dynamic-tables-in-classic-notes/
This is a non-XPages solution, but of course you can also use XPages to achieve the same/similar result. It does not use tabs, as each row is a separate table.

Alternatively, you can build your Rich Text Table in another NotesDocument, which you then save. Then use NotesUIDocument.ImportItem (which is undocumented, but present in the R8.5 mail template) to update your NotesUIDocument.
Don't forget to delete the other NotesDocument when you're done.
Another option is to build the table in HTML in computed text, and re-open the document every time you modify it. I have inherited a system that does that, and I hate it...so be warned :)

Related

Creating data source in Tableau

While creating data source in Tableau I want to choose 20 fields out of 100 fields from the table? How to select only 20 fields from the table?
Hide fields you don't want to use. That is the most efficient approach. Tableau will then leave those fields out of the select clause in any queries and exclude those fields from any extracts.
Here is one way to hide fields.
Connect to the data source and stay in the data connection pane
Switch to list view to see the fields listed one per row (for convenience) by clicking the icon to the left of the sort fields switch
Select the fields you don't wish to use, multiple selection is useful here
Right click or use the caret menu (little black triangle) to hide those fields
P.S. Tableau will always leave fields out of the select statement that you don't reference (i.e. don't put on a shelf). So if you are using a live connection instead of an extract, hiding fields can help reduce the number of fields you have to look at on the data pane, but isn't necessary to improve performance. For extracts, hiding fields can reduce the size of the extract and the time to refresh it.
You might think could help performance by writing custom SQL to only request a subset of the columns, but you would most likely be hurting performance instead by defeating the query optimization that Tableau performs.

How do I create an Access Form for Table 1 where two Table 1 fields have different data from a single field in Table 2?

I’m absolutely stumped by what I suspect is probably simple for those experienced with Access. I’m brand new to Access (2010) and studying a lot, but unfortunately still confused by many basic concepts. I’m embarrassed to admit that I have spent about 40 hours trying (unsuccessfully) to solve the specific issue below. Please forgive me if I haven’t included enough detail here - I’m not sure how much someone needs to know to address this. I’m happy to edit and/or provide more information.
My question:
How do I create a Form for creating new records / editing existing records in Table1 where two fields in Table1 have different values from a single field in Table2? (I have better detail below)
I want the Form to have all the records from Table1. I have tried many different ways with queries, sub-forms, etc., but can’t pull it off. I’m fairly certain the issue is related to how I address Table2. Ideally, the user would be able to select from dropdowns in the form for the two fields to be updated in Table1.
I am including screenshots of a mockup of my intended Form concept, the object Relationships as I currently have them, the design and datasheet views of Table1 and the design and datasheet views of Table2.
“Table1” above is “t_PEOPLE” in the images while “Table2” is “t_COLORS.”
The object relationship types are currently one-to-many with enforced referential integrity (cascade update related fields) and the join properties are "include ALL records from 't_PEOPLE' and only those records from 't_COLORS' where the joined fields are equal."
I'm happy to send the actual database file if that helps.
I will be very grateful for any guidance - thank you!!
The general approach to this is as follows:
A) If I understand what you're trying to do here, your t_colors table is usually referred to as a Reference table or Lookup table. You need to make one form to add, edit, and delete records in this t_colors table. How the user accesses that form varies. I'll get to that in a minute.
B) The form for your People table needs to have drop down menus for your two color selections. In the dropdown menus' RowSource, you will use a query that looks up values in your t_colors table.
C) Depending what you are using your colors for in t_people, you should consider making a third table with PeopleID and ColorID in it. It would then link to both t_people and t_colors. This would allow you to have multiple colors specified for a single person, and you wouldn't be limited to two. In your People form, you would use a subform for these colors. The subform would probably need to be a datasheet form or a continuous form. If you are using a datasheet form for your people form, then you would need to use a datasheet form for the colors subform.
If the user wants to use a color that isn't already in your t_colors table, you need to give them a way of inserting that color. There are various approaches to this. You could use a union query in the dropdowns RowSource that shows a "" option. If selected you would bring up your Colors form and when they close the colors form you have to requery your dropdown menu. Or you could insert the color for them using VBA when they enter a value that is "Not In List" (an event that Combobox's have).
Please note that the relationships you've defined are not overly helpful or important in this case. Yes, they can be helpful when it comes to using the Update Cascade or Delete Cascade features. But quite truthfully, relationships are basically for programmers, to make sure you get an error if and when referential integrity is violated. Users should never see these errors and properly designed forms will prevent them from occurring. The main reason to use them is that it will force you to design your forms properly by giving you an error when something is wrong, hopefully during your own testing phase of the project.

ASP.Net: Is the order of Request.Form elements defined?

I have a table which uses a large number of form fields (the HTML variety - i.e. without runat=server). When a postback occurs, these populate the Requests.Form object, and they appear to be inserted in the same order as they're defined in the page HTML.
Is this behaviour documented and consistent across browsers? I'd like to be able to access the elements by index, which would provide a simple way to find the fields, given that they may be inserted or deleted on the client side.
Edit:
Each row in the table has a hidden field which contains the row ID. This field is named according to the order it was displayed at render time. e.g. the first row has a field like <input type="hidden" name="row0" value="RowID_555252" />, and so on.
Of course the row numbers will be wrong as soon as a row is inserted or deleted in the middle of the table, so the only solution I can think of is to use Javascript to update the row numbers of the entire table whenever the rows move about. The backend would then retreive rows in order by scanning Request.Form for row0, row1, etc until the element is NULL.
Is this behaviour documented ...
Yes it is.
The overall algorithm is here: http://dev.w3.org/html5/spec/constraints.html#concept-form-submit and this defines that it uses a form data set built using the algorithm at http://dev.w3.org/html5/spec/constraints.html#constructing-the-form-data-set.
While that algorithm is quite complicated, in essence it says that the form elements will be put into the form data set in node order. That's not quite the same thing as what they were in the page HTML, for instance, the elements can be moved by JavaScript.
There are further algorithms to turn the form data set into query strings or HTTP content but these too preserve the node order.
There are known to be web pages that depend on this order. (The HTML5 parser has a strange quirk where input elements of most types, placed inside tables but not inside table cells are ejected from the table through a process known as foster parenting, but input elements of type "hidden" are not ejected in this way. This happens because that's the only way to preserve the legacy submit ordering behaviour of browsers.)
...and consistent across browsers?
The whole algorithm of what gets submitted is definitely not consistent - for example, the submissions resulting from clicking on an input element of type "image" are known to vary significantly.
I believe that the order of the submitted elements may well be consistent across browser implementations. However, I would not rely on it being so, and encourage you to find a more robust solution.
Is this behaviour documented and consistent across browsers?
No, it is not documented and it is not guaranteed to be consistent across browsers. That this is how it occurs happens to be an implementation detail of the browser/s you have used.
You could of course use the index, but you cannot assume that this will correspond to the order of the form elements. Furthermore, it is brittle - what happens if you add a new field at the start of the form? Your logic completely breaks.

Dojo datagrid and treegrid help - datagrid has a reformating flash?

I'm having a bit of a time trying to get Dojo grids (1.5) to play nice. Specifically I've spent about two weeks of work trying to implement a grid that allows for our result set data to collapse into rows, where rows can be expanded. Data comes in as a full set in JSON format, using ItemFileReadStore as the store. Any subsequent sorts or pagings are handled by GETing a new json from the application, and passing in new query parameters in the url.
The nested data was only two layers deep - a top layer to always be displayed and an array of child data with identical structure as the top layer. Each node has a unique ID and a cluster ID - on a parent node the unique ID and cluster ID will match.
I was initially very excited with TreeGrid - but I couldn't see how I could format it to do what I needed - namely eliminate the 'summary row' and one extra row full of null cells (???) that I just couldnt figure out how to remove unless I focused the query to only one cluster. I studied the test examples, built many test pages myself, tried to understand the forestModel, which for what I could tell was unnecessary... I found so little documentation, and sources I found online hinted that TreeGrid might not be reliable...
So I decided I would try to implement the expandable/collapsible rows in dataGrid.
I flattened the JSON data and added another attribute to indicate being a top level node ('alwaysShow' = true). I built my grid programaticaly and applied grid.filter() to pull only those top level nodes. I modified that filter by extending the ItemFileReadStore _FetchItems "filter" method to allow for OR querying instead of AND, and also modified it to allow for keys to point to arrays - when a top level node (small +/- icon in the cell) is clicked, the cluster ID of the parent node is added to the grid.filter.allowed[] and the filter is updated, allowing nodes with that cluster_id value to be displayed.
This worked fine on my small test set of five records (although id say a little slugish...) - but now I am pulling ~900 rows back from the application, and on expanding large clusters (~80 rows) I am seeing a very long flash of blue and white on the filter updates. I've spent most of my day trying to step through in firebug to find where its happening, but the dojo logic is so spread out. Seems to be happening before the call to _Grid.js defaultUpdate.
Its so bad that I am considering trying again with TreeGrid. Im also considering just doing this by hand... Im kicking myself for spending so much time trying to get Dojo to work to begin with. I would also consider a commercial "JSON->table with collapsible row" library if anyone has any recommendations...
Any suggestions or insights? Familiarity with the flashing problem or how I could adapt TreeGrid to my needs? I'm aware this is a bit of a rant... Many thanks for any help.
-robbie
EDIT: I eventually gave up trying to get Dojo to do what I needed and coded it myself in less than a day. Not the best use of three weeks...
EDIT:
I just found a solution that works for me, I have added the following CSS:
.dojoxGridSummaryRow {
visibility: collapse
}
Basically the summaries are probably still created but they are not visible nor taken into account in the table layout. That's good for me. Hope this will solve your issue.
This won't help but just to let you know that:
"- but I couldn't see how I could format it to do what I needed - namely eliminate the 'summary row' "
is the very EXACT same thing I'm trying to achieve and did not find the solution even though this looks like a very simple feature... Will let you know if I found a solution...

Can you have a Dynamic Data Field which consists of a list of fields?

This is a purely theoretical question (at least until I start trying to implement it) but here goes.
I wrote a web form a long time ago which has a configurable section for getting information. Basically for some customers there are no fields, for other customers there are up to 20 fields. I got it working by dynamically creating the fields at just the right time in the page lifecycle and going through a lot of headaches.
2 years later, I need to make some pretty big updates to this web form and there are some nifty new technologies. I've worked with ASP.NET Dynamic Data just a bit and, well, I half-crazed plan just occurred to me:
The Ticket object has a one-to-many relationship to ExtendedField, we'll call that relationship Fields for brevity.
Using that, the idea would be to create a FieldTemplate that dynamically generated the list of fields and displayed it.
The big questions here would probably be:
1) Can a single field template resolve to multiple web controls without breaking things?
2) Can dynamic data handle updating/inserting multiple rows in such a fashion?
3) There was a third question I had a few minutes ago, but coworkers interrupted me and I forgot. So now the third question is: what is the third question?
So basically, does this sound like it could work or am I missing a better/more obvious solution?
Did you try creating a FieldTemplate that had a "ListView" of all the Fields? (the ListView would use Dynamic Data to determine which FieldTemplate to display for each field.)
I don't see why this would not be possible. Although, "out of the box", you may have to hit "edit" on each row of the new FieldTemplate's ListView to edit the values. It would be like replacing the "Order Details" link in the Orders List, with an inline List of the "Order Details".
1.) Not very nicely. Can you imagine showing a DateTime, Integers, Phone numbers, Urls, etc with just ONE user control, like text.ascx? Why not have multiple field templates and use UIHint to specify usage per column?
2.) Yes.
3.) Define basically?
regarding one to many relationships, you might have a look at the ListDetails.aspx Page Template in Dynamic Data. Hope this helps.

Resources