displayonly tablecontrol ( dropdownbox )

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

HarryDeBoer
Ebase User
Posts: 118
Joined: Tue Oct 23, 2012 7:01 am
Location: The Netherlands

displayonly tablecontrol ( dropdownbox )

#1

Postby HarryDeBoer » Wed Jun 12, 2013 8:57 am

Hi,

I have a tablecontrol with a column w dropdownbox. When the tablecontrol is editable it shows the description values in the dropdownbox.

When you set displayonly() to a tablecontrol, it doesnot show the visible values (descriptions) that stood in the dropdownbox, but the values in the database (table). How can this be achieved?

Regards, Harry
[/img]
0 x
Kind regards,

Harry

Hovik
Moderator
Moderator
Posts: 184
Joined: Tue Sep 11, 2007 8:58 am

#2

Postby Hovik » Wed Jun 12, 2013 12:06 pm

Harry,

First of all, the same principles apply whether the dynamic list is in a table column or in a form field

I'm not sure what you're trying to achieve.

Database table has entries:

Desciption1 ID1
Desciption2 ID2
etc

Question1. When the user selects a Desciption, do you want to store the Desciption or the ID in that field.

Question2. When the dropdown has a value and is displayonly, what do you want to show in the field.
0 x

Steve
Moderator
Moderator
Posts: 421
Joined: Fri Sep 07, 2007 3:44 pm
Location: Sandy, UK
Contact:

#3

Postby Steve » Wed Jun 12, 2013 2:36 pm

Hi Harry,

I think you want to display the Description/Display value instead of the <b>actual</b> value when the table control is read only?

You will have to show a different column and substitute the value with the display value from the List:

Create a before table event that processes the values and write script as follows:

Code: Select all


function convertReadOnlyColumn&#40;&#41;
&#123;
  //hide table.MY_TABLE.MY_VALUE field control
  // show table.MY_TABLE.DISPLAY_COL field control
  //..
  //..

  var rows = tables.MY_TABLE.rows;
  while &#40; rows.next&#40;&#41; &#41;
  &#123;
    table.MY_TABLE.DISPLAY_COL.value = table.MY_TABLE.MY_VALUE.getList&#40;&#41;.getDisplayValue&#40;table.MY_TABLE.MY_VALUE.value&#41;;
  &#125;
&#125;
Note:
You will need to display table.MY_TABLE.DISPLAY_COL instead of table.MY_TABLE.MY_VALUE.

I think this should work.

Steve
0 x

Steve
Moderator
Moderator
Posts: 421
Joined: Fri Sep 07, 2007 3:44 pm
Location: Sandy, UK
Contact:

#4

Postby Steve » Wed Jun 12, 2013 3:42 pm

If you are using Dynamic Lists, then you can map the display field to a table column and the actual value to a table column. Then show the column value required.

Steve
0 x

HarryDeBoer
Ebase User
Posts: 118
Joined: Tue Oct 23, 2012 7:01 am
Location: The Netherlands

#5

Postby HarryDeBoer » Thu Jun 13, 2013 8:14 am

Hi Steve,

yes I want to show the display value instead of the actual value. Thanks for your solution. One question: we build our lists in code (js) ..xxx.createCustomlist(). Does your soultion also apply for those lists?

Regards, Harry
0 x
Kind regards,

Harry

Steve
Moderator
Moderator
Posts: 421
Joined: Fri Sep 07, 2007 3:44 pm
Location: Sandy, UK
Contact:

#6

Postby Steve » Thu Jun 13, 2013 8:29 am

Hi Harry,

Yes this will apply for custom lists.

Kind regards

Steve
0 x


Who is online

Users browsing this forum: No registered users and 11 guests