60 Posts
ggl082
7 years ago
Topic

Hi,

   In a form, I have a group of radio button to select for example 2 criterias:

1) Meter

2) Kilometer

Below I have an Groupx displayed in table and I want to update dynamicaly title of colum of groupx depending of selected criterias.

With Meter:

Radio Button

(x) Meter       ( ) Kilometer

GroupX

Distance                   Meter

BoxField                   Boxfield

With Kilometer:

Radio Button

( ) Meter (x) Kilometer

GroupX

Distance                   Kilometer

BoxField                   Boxfield

If radio button change, title of column must change and boxfield of unity must be set to 0 whatever the number of GroupX in the table.

If it is not possible to change title of column, a free text field could be added after boxfield as below

Radio Button

( ) Meter (x) Kilometer

GroupX

Distance         Value

BoxField         Boxfield  Kilometer

In each case I can't know from groupX the value of radio button group that is into the form.

Is it possible to perform this behaviour?

Thank you in  advance for your help.

Gérard

Get a Book for SEBLOD
4229 Posts
Kadministrator
7 years ago
1
Level 1

Hi,

I think easiest way would be to create 2 groupX fields e.g. groupXKm or groupXMl with same storage with 2 different groups inside them, e.g. groupkilometers, groupmiles, each using appropriate distance measure (and both instances of fields using the same storages), This way fields would show different labels, but would store to the same field.

Then you can use conditional to show either groupXKm or groupXMl

60 Posts
ggl082
7 years ago
0
Level 2

Hi,

 Thank you Klas for your answer. Effectivly is a good solution, but in this case, if I change of criteria, all data of groupx are not kept. In my case I want keep only the first column. The user can create some entry in the Groupx and decide after to change the criteria and so when the GroupX corresponding to criteria is displayed, the value of the first column are not copied.

So, my idea was to save each GroupX in different column, launch automatically a save when user change criteria (by JS perhaps?), save context by before store and update GroupX by AfterStore. But in this case, is GroupX will be immediatly updated by data set by AfterStore? I'm aware than this solution is not very simple, perhaps there are another solution less complex, but I have no other idea at this time.;(

Gerard

4229 Posts
Kadministrator
7 years ago
1
Level 1

On change you could copy data from one to other instance using javascript, should be fairly simple.

60 Posts
ggl082
7 years ago
0
Level 2

Hi Klas,

  It was the solution. Thank you Klas

Get a VIP membership