This topic is locked

Save data in Multiselectbox

8/8/2010 8:01:20 AM
PHPRunner General questions
W
webdino author

I have a multiselct dropdown, how can I say to PHPR that all data have to save in separate DB Lines and have a reference in one field

so everybody can see that these data is a complete dataset with x entrys

A
ann 8/9/2010

Hi,
use Custom Expression asDefault field option on the Edit as settings dialog on the Visual Editor tab(Lookup wizard field type) to create a row with db field values.

Then use Before record added/updated event on the Events tab to split the row up.

Here is a sample:

$ar=explode(",",$values["DropdownFieldName"]);

$values["DropdownFieldName"]=$ar[0];

$values["FieldName2"]=$ar[1];



where DropdownFieldName, FieldName2 are your actual field names.

W
webdino author 8/9/2010

how to do it when I change this record then?

I can split it and then write it with a reference in another table but then I will mark the selected values when a user will change a master dataset

A
ann 8/9/2010

Hi,
I'm not sure that I understand your question.

Please re-phrase it.

W
webdino author 8/9/2010

I will save x datasetvalues from my default master dataset in a database a 1:n relationsship
example

dataset1 relation1

relation2

relation3 and so on
When I change thist dataset the x selected values must select from PHPR and shown in the multiselect Box. The user can change or demark them ......

How can I save this in a database for PHPR. Now it is one table with 1:1 relationship on another lookup table where PHPR has a lookup

table
ID Name CategorySelectionID

1 Testname 1

2 Testname 1

3 Testname 1
In this example that are 3 datasets but they belong together. For example a doc makes an investigation and a syringe.

Then he will write a billing. He does not write 2 Billings but he makes this 2 treatments on one billing.
The Table to fill the selectbox is

SID Name

1 Testset1

2 Testset2

3 Testset3

W
webdino author 8/12/2010

I don´t know how to say PHPR that it should not save the data in the child table where the master table reference to

W
webdino author 8/12/2010

I looked up in other topics but I don´t understand
When I create an event to save this data in another table, wwhat´s to do when user goes back to edit this dataset.

Then the save values from the add must be selected, when the user wants to mark another value.
how to do this, thats my problem

A
ann 8/12/2010
W
webdino author 8/12/2010

this is helpfull when I save the data, but whats to do wenn I read the data to display in edit mode?

W
webdino author 8/12/2010

is there a template example in the standard templates of PHPR where I can see it?

J
Jane 8/13/2010

Hi,
there is no such template in the PHPRunner.

You need to select these values from database manually in the Before process event and then save list of values in the session variable. Use this variable as default value on the "Edit as" settings dialog.

W
webdino author 8/13/2010

it was very beautifull to add this in new Versions of PHR.

There are so many projects that need to combine a master record which associate to many child members