Jump to content

Kexi/Handbook/Building Simple Databases/Designing Forms/Assigning data sources: Difference between revisions

From KDE UserBase Wiki
Yurchor (talk | contribs)
m add translation tags
Jstaniek (talk | contribs)
No edit summary
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>
====Assigning data sources====
====Assigning data sources==== <!--T:1-->


The fields you inserted have no data source assigned yet, so these are not able to display information from the database. To assign data source, use the <menuchoice>Data Source</menuchoice> tab of the '''Property''' pane.  
<!--T:2-->
The fields you have inserted on the Form have no data source assigned and are not yet able to display information from the database. To assign a data source we will use the '''Data Source''' section of the '''Property Editor''' pane.  


The very first step is to specify the form's data source, i.e. a place the displayed data will be fetched from. As mentioned above, you will use table persons as a data source for your new form.
<!--T:3-->
The very first step is to specify the data source for the Form as a whole. i.e. the location from where all of the displayed data will be fetched. As mentioned above, you will use the '''''Persons''''' table as the data source for the new form.


# Click on the form's surface, as you will alter its properties.
<!--T:4-->
# Switch to the <menuchoice>Data Source</menuchoice> tab and enter persons table name in the '''Form's data source''' drop down list. Alternatively, you can select this name from the drop down list.  
# Click on the form's surface, as you will alter its properties.</translate>
<translate>
<!--T:11-->
# In the '''Data Source''' section enter '''''persons''''' table name in the '''Form's data source''' drop down list. Alternatively, you can select this name from the drop down list.  


You have assigned form's data source. Now you need to do specify widget's data source.  
<!--T:5-->
You have assigned the form's data source. The next step is to specify each widget's data source.  


# Click the first text field widget at the top of the form.
<!--T:6-->
# In the <menuchoice>Data Source</menuchoice> tab of the property pane enter field name name in the '''Widget's data source''' drop down list. Alternatively, you can select this name from the drop down list.  
# Click the first text field widget at the top of the form.</translate>
# Click on next text field widget and enter surname as the data source.
<translate>
# Enter data sources for street, house_number and city text fields in a similar way.  
<!--T:12-->
# In the '''Data Source''' section of the property pane enter field name '''''name''''' in the '''Widget's data source''' drop down list. More conveniently, you can select this name from the drop down list. </translate>
<translate>
<!--T:13-->
# Click on the next text field widget and enter '''''surname''''' as the data source.</translate>
<translate>
<!--T:14-->
# Enter data sources for '''''street''''', '''''house_number''''' and '''''city''''' text fields in a similar way.  


You can now save the form's design (this is not mandatory to test the form in action). To save, click the <menuchoice>Save object changes</menuchoice> toolbar button or use the <menuchoice>File-> Save</menuchoice> (<keycap>Ctrl+S</keycap>) menu command. Upon saving you will be asked for entering the form's name. Enter '''''Persons''''' as caption and click the <menuchoice>OK</menuchoice> button. The form's name will be filled automatically.  
<!--T:7-->
You can now save the form's design (this is not mandatory to test the form in action, but is recommended). To save, click the toolbar <menuchoice>Save</menuchoice> button<!--FIXME no File menu nor shortcut in master/2.4.0 or use the <menuchoice>File-> Save</menuchoice> (<keycap>Ctrl+S</keycap>) menu command-->. Upon saving you will be asked to enter the form's name. Enter '''''Persons''''' as caption and click the <menuchoice>OK</menuchoice> button. The form's name will be filled in automatically.  


This is the right moment for testing your form. Click the <menuchoice>Switch to data view</menuchoice> toolbar button. Unless you made a mistake while entering data sources, you should see form's fields filled with data from the persons table.
<!--T:8-->
This is the right moment for testing your form. Click the <menuchoice>Data</menuchoice> toolbar button. Unless you made a mistake while entering the data sources, you should see the form's fields filled with data from the '''''Persons''''' table.
 
<!--T:16-->
{{Note|
{{Note|
* If you want to remove widget's data source assignment for a form widget, you can use <menuchoice>Clear widget's data source</menuchoice> button near the '''Widget's data source''' drop down list. Similarly, you can use the <menuchoice>Clear form's data source</menuchoice> button near the '''Form's data source''' drop down list.  
* If you want to remove widget's data source assignment for a form widget, you can use the {{Icon|edit-clear-locationbar-rtl}} button in the <menuchoice>Widget's data source</menuchoice> box.<!--FIXME not in master/2.4 <menuchoice>Clear widget's data source</menuchoice> button near the '''Widget's data source''' drop down list. Similarly, you can use the <menuchoice>Clear form's data source</menuchoice> button near the '''Form's data source''' drop down list.--><!--}}-->
* Use the <menuchoice>Go to selected form's data source</menuchoice> button to select appropriate table or query in the '''Project Navigator''', so you can quickly open a table or query being the data source of the form.}}
 
<!--T:15-->
* Use the {{Icon|go-jump}} (Go to selected form's data source) button to select appropriate table or query in the '''Project Navigator''', so you can quickly open a table or query being the data source of the form.}}<!--{{-->


<!--T:9-->
{{Prevnext2
{{Prevnext2
|prevpage=Special:MyLanguage/Kexi/Handbook/Building_Simple_Databases/Designing_Forms/Inserting_widgets_-_text_fields
|prevpage=Special:MyLanguage/Kexi/Handbook/Building_Simple_Databases/Designing_Forms/Inserting_widgets_-_text_fields
Line 33: Line 52:
}}
}}


<!--T:10-->
[[Category:Kexi]]
[[Category:Kexi]]
[[Category:Tutorials]]
[[Category:Tutorials]]
</translate>
</translate>

Latest revision as of 20:26, 25 December 2024

Assigning data sources

The fields you have inserted on the Form have no data source assigned and are not yet able to display information from the database. To assign a data source we will use the Data Source section of the Property Editor pane.

The very first step is to specify the data source for the Form as a whole. i.e. the location from where all of the displayed data will be fetched. As mentioned above, you will use the Persons table as the data source for the new form.

  1. Click on the form's surface, as you will alter its properties.
  2. In the Data Source section enter persons table name in the Form's data source drop down list. Alternatively, you can select this name from the drop down list.

You have assigned the form's data source. The next step is to specify each widget's data source.

  1. Click the first text field widget at the top of the form.
  2. In the Data Source section of the property pane enter field name name in the Widget's data source drop down list. More conveniently, you can select this name from the drop down list.
  3. Click on the next text field widget and enter surname as the data source.
  4. Enter data sources for street, house_number and city text fields in a similar way.

You can now save the form's design (this is not mandatory to test the form in action, but is recommended). To save, click the toolbar Save button. Upon saving you will be asked to enter the form's name. Enter Persons as caption and click the OK button. The form's name will be filled in automatically.

This is the right moment for testing your form. Click the Data toolbar button. Unless you made a mistake while entering the data sources, you should see the form's fields filled with data from the Persons table.

Note

* If you want to remove widget's data source assignment for a form widget, you can use the button in the Widget's data source box.
  • Use the (Go to selected form's data source) button to select appropriate table or query in the Project Navigator, so you can quickly open a table or query being the data source of the form.