Multiple datasources for same SQL DB - google-app-maker

I have an app page that shows information from the same table in 2 places on a page.
In the place A, I want an editable field that is owned by the current user.
In the place B, I want to see the list of entries for all users.
I thought I could somehow have two pointers into the same table by configuring more than one datasource for the table, and bind placeA/B widgets to the two separate datasource.
However, I could not find out how I can bind a panel or widget to a specific datasource within a table.
What bugs me is that clearly the UI allows me to add multiple datasources for a table, so I probably misunderstand what the usercase for multiple datasources are.
My current plan is to ivestigate whether I can create a computed datasource that limits results to just the current user, but I don't understand how I could updated a computed datasource (which is something I want to do).
This is probably less than clear, happy to add clarifying information.
Many thanks in advance for any help

Never mind. App maker behaves as I thought it should be. The two datasources are behaving as two cursors into the same table. For some reason, I could not seem to find the 2nd datasource in the widget dropdown for datasource, but I could find it by selecting "Advanced" and then finding datasource starting from "datasources" instead of "widget.datasource".
Nothing to see here, move along now ;)

Related

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.

A clean solution for dynamic entry table rows in ASP.Net

I'm working on a project in ASP.Net that uses the UpdatePanel to handle all AJAX requests. I'm much more familiar with using jQuery AJAX methods (and strategies) so I'm kind of stumped on finding a clean solution for the functionality I need.
Basically I need a table that allows me to dynamically add as many rows as I want using AJAX. These rows will contain text boxes whose values must be preserved by ASP.Net until I'm ready to submit the form. To further complicate matters there may already be records that exist in the database that should display as well with the values pre-populated and any changes to these fields must also be preserved.
I had started out by using a GridView and setting it's datasource to a list of the database records but unfortunately I believe this means I can't add new rows to the GridView.
Any assistance would be much appreciated. Keep in mind the solution must use ASP.Net controls.
I believe I figured out a solution that seems pretty straightforward.
When the page loads I gather any relevant records from the database and perform a query expression combined with a projection select to create an anonymous type array. When the add new row button is clicked instead of trying to add the row directly or retrieve potentially old data from the database I perform a query expression on the datagrid items themselves and union a new blank item. From there it's just a simple matter of setting the datagrid data source, triggering a databind and updating the update panel.
The only question now is how to identify the rows, particularly new rows that have no database keys yet. I could devise some clever method for generating row ids but I have a feeling that ASP.Net already does this and all I need to do is associate these ids with the anonymous types.

Flex: DataGrid with dynamic columns with data from multiple DB tables

Introduction: I'm using java, oracle, flex, blazeDS etc. The part of the DB that is relevant to the task i am trying to accomplish is illustrated in the image below:
The Task table will also have a field called enabled , which i forgot in the figure below :) This field is used to enable some of the tasks based on various criteria, when an admin user presses a "Generate task list" button in the GUI.
Based on this generation of the task list, the users in the system should see a grid as the one displayed in the figure below :
This task list should display all the enabled task as illustrated above. The first three columns are retrived from the Task table in the DB, while the next columns(Column_4....Column_N) are generated based on the number of users in the User table. These columns should display the users alias. Each user is part of a UserGroup(Group), which i will model in either a separate table or in the User table itself, as illustrated in figure 1. The Numbers in the grid are based on the Time field in the Task_User table, while the first row below the users shows the sum of the times for each user.
Question: Im still learning Flex, and looking for every help i can get on accomplishing my goal :) I figure i have to implement a datagrid with dynamic columns. But how will the dataprovider work in this scenario? For each enabled taskid the grid has to fill the right user columns with time values. Any tips/help would be much appreciated! It is also important that loading this grid doesnt take to long :)
Is it possible to get horizontal and vertical text in the grid(like shown above)?

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.

MS Reportviewer - Save Expanded/Collapsed Nodes in ViewState?

I have a report that's being populated from an ObjectDataSource. The report includes expandable/collapsible nodes per user.
I'm allowing the viewer to filter the report by setting the FilterExpression on the datasource, then calling ReportViewer1.LocalReport.Refresh(). This is done during PostBack.
This filters the results, but the state of the expanded/collapsed nodes is lost. Is there some way to store the expanded/collapsed nodes in the ViewState? Or is there a better way to accomplish this altogether?
I know its been a while since this question was asked, but since i had to go through this recently i want to share my experience with somebody who might be dealing with this.
It's tricky but if you add a multivalued parameter to your report and the values match the values in the toggable fields, then you can write a group expression in the grid (And in the labels so those go away too). Once that is done, you just have to keep track of what is toggled (this is hard, but is possible with javascript).
Basically, there are two of the hidden child controls in the reportviewer control (indexes 4 & 5 in vs2008) that have the name of the event and the id of the table cell clicked, with this you cand build an array in javascript and keep track of the status of all toggable fields.

Resources