App Maker Relations Not A Datasource Option - google-app-maker

So I have two databases (Database A and Database B), with a ONE to MANY relationship.
I have a page (that used to work) where I had an Accordion Widget for Database A and one for Database B on the same page.
So if I highlighted an entry in Accordion A (Database A), then I would see all the associated entries for Database B displayed in Accordion B.
When I clicked the next entry in Accordion A, Accordion B would update appropriately. I was able to achieve this by setting the Datasource for Accordion B as Database B (relation).
This doesn't seem to be an option any more.
Is there a way to achieve the same thing via a different method?

Here are our docs on this: https://developers.google.com/appmaker/models/datasources#relation_datasources
I think the reason you aren't seeing the Database B (relation) option anymore is we only show that if the inherited data source is Database A. As all relation data sources need a parent data source to be based on (that's how they know to which item to show relations for). So for your case, the solution is probably to set the data source of the entire page to Database A, then go to set the relation accordion's data source, now you should see Database B(relation).
Sometimes you really just want to specify the relation datasource directly rather than have it be based on the parent, in this case you can click "advanced" in the data source chooser, and choose the relation specifically. I think the path in this case is something like:
datasources.databaseA.relations.databaseB

To be able to select "Database B (relation)" as datasource "Accordion B"'s parent widget datasource should be set to "Database A".
Please select "Accordion B", use breadcrumbs above the visual page editor to find parent widget, select it and verify that datasource is set to "Database A".

Related

Is there a way to make a specific item in a multiselect disabled?

I'm really just wondering if anyone has stumbled across this...
In the Widgets API documentation for the Multiselect widget in Google App Maker, the "Styles" section includes a style name for a disabled item:
.app-MultiSelect-Item.disabled Style for the disabled item or items.
I have a case where I'm adding options and values to a multiselect by script based on data pulled from elsewhere. The initial values include the currently selected set of choices, but based on other actions taken by the user, they may not be eligible (via our internal rules and processes) to make that choice anymore.
If there's a way to set a specific item as disabled, I'm envisioning being able to style it with a strike through to communicate that even though that choice is selected now, it's not available as a new choice, and it's going to be removed from the other data source.
So it might be like this:
X Choice A
_ Choice B
X Choice C
_ Choice D
Thoughts?

Changing the function of dynamic links in info parts

I am trying to let an info part's dynamic link work so that it only opens the queried values in a list on the new form.
Basically now, if i click Installation No. on the form part below.
Then this form opens up with all the Installations, not only the related Installations.
What i want to happen is when the Installation No is clicked then the list should look like when the "more" button is clicked or like the image below.
It seems like this is the standard function but i want to know if there is a way to change it.
Does anyone know a solution to this or know if there is any?
Dynamic links should work on info part forms provided prerequisites are met:
A data relationship exists between two tables, usually as one-to-many (one parent row relates to many child rows).
Each table has a field of the same extended data type.
In the parent table, the extended data type field values uniquely identify each row.
The extended data type has a relation defined on it for the field in the parent table.
Each table is a data source for one of the two forms.
The parent form contains a button that launches the child form.

set default value for detail in master/detail relationship form widget dialog button

I have a master/detail relation similar to the relations sample provided.
In my example department has a one to many relationship with employee
I have a form widget(department) which has a button to insert an employee.
when I click on that button the correct dialog form is displayed but I am allowed to enter any department which I do not want.
I am looking to have the relation defaulted to the "parent" widget where it was clicked and ideally not be editable.
It's hard to give an exact answer without seeing your app, but you should probably replace the dropdown in the form with a label, that will make it not editable. You can bind the value of the label to the relation just like the value of the dropdown was bound.
A slightly easier option would be disabling the dropdown (look for the Enabled probably in the property inspector). But that could be confusing for your users since they might think it should be editable.
(Alternatively, you could just remove the field altogether if it's not important to show the relation.)
I think this only answers the "not editable" part of your question, if you want it to be pre-filled you either need to do some scripting, or use relation data sources.
I suggest using relation data sources, so right now you probably have something like:
app.datasources.Emp.create(), which creates a new employee.
Instead, you can use widget.datasource.relations.Emp.create(), which will create a new employee which has a relation to the current item in widget.datasource. If this button is placed in your department form widget, then that means it will create an employee related to whatever department is shown in the form.
Note that none of this stops users from changing the department of an employee, it just changes the UI. In lots of cases that is enough, but you may also want to add some server-side security controls if it's important to limit which users can create employees, change departments, etc: See https://developers.google.com/appmaker/security/secure-app-data

Drupal Webform textfield dynamic growing list

Just curious...
I have a project where people can input their cooking recipes. I would like to build a webform that will have a textfield and when it is filled in a new textfield appears below. A "growing textfield list". Let me try to show it here:
Ingredient #1 _________________________________ [add]
When you type and ingredient click "add" you then are going to see:
Ingredient #1 Potatoes_________________________
Ingredient #2 _________________________________ [add]
Sorry for not knowing the proper markup. However if anyone knows:
a) the proper term for this ( I call a growing textfield list )?
b) how to do it with webform in drupal?
There are two ways of doing this without any programming:
If you are using the Webform module (not sure if by webform you mean the node form or the Webform module) then you can try the Webform Add More module which enables what you want. The only downside is that it works only with fieldsets so you'll have to put your textfield in a fieldset and enable the add more functionality on that fieldset.
If you are using CCK then it's really simple: just add a new textform field and set it's number of values to be "Unlimited". However I would use something like Hierarchical Select which would allow users to reuse ingredients, add new ones and it would also allow you to categorize them.

How to add table in Entity Framework?

I have a project that I made in Asp.net with Entity Framework.
Now I want to add one or more tables in the database and one or more stored procedures.
But entities not shows the new table.
How to show this?
Open edmx file, right click anywhere in the modal and select "Update Model from Database" and follow the instructions and choose the desired tables and SPs.
Sometimes even after following these steps, your model will not get updated, close Visual Studio and restart it again. This has happened many times for me.
Sharique's answer is the good one. But I noticed a thing: when the Mapping Details window is active(near Error List, Output) and if you are trying to add a new Entity (right click the design surface, Add -> Entity), the popup dialog, "Add Entity" it won't show.

Resources