Thanks i try
Il 18/05/20 20:12, Douglas von Roeder ha scritto:
Ferdinando:
I tried doing that some time ago but was not able to swap choice list.
I had to switch to using fields and a popup menu.
Here’s my comment in the code:
C_TEXT(<>FB0294_T)
//Modified by: dvonroeder 20131231 {0294}
//Bailed on choice lists but I'm using this "fake" list to force
//4D to display the graphic for a choice list
and
C_TEXT(<>FB0298_T)
//Modified by: dvonroeder 20140128{0298}
//Well, that just doesn't work anymore (V13?). Will use fields instead.
OBJECT SET CHOICE LIST NAME([AUModelItems]BaseItemName;"AU_BlankList")
OBJECT SET CHOICE LIST NAME([AUModelItems]EvaluationSymbol;"AU_BlankList")
This was 4D V13 so this may be doable in newer versions.
The approach that I ended up taking was to switch to using fields in
the list box. That allowed me to assign a blank list to the field so
4D would display the graphic for a choice list. The code in the form
method responded to the On click event and I create the dropdown menu
on the fly.
This is the code that as proof of principle:
C_TEXT(<>FB0294_T)
//Modified by: dvonroeder 20131226 {0294}
//To control data entry, the DataItem columns have a choice list called
//"DataItems" which is also set as the required choice list
//C_TEXT($nameInListEditor_T)
//$nameInListEditor_T:="AU_DataItems"
//
//C_TEXT($columnName_T)
//$columnName_T:="Item1_Name"
//
//OBJECT SET CHOICE LIST NAME(*;$columnName_T;"")
//
//
//
//C_LONGINT($listRef_L)
//$listRef_L:=New list
//
//C_LONGINT($index_L)
//For ($index_L;1;10;1)
//
//APPEND TO LIST($listRef_L;String($index_L);$index_L)
//
//End for
//
//$itemPosn_L:=Find in list($listRef_L;String(Make_Random (1;10));1)
//
//If ($itemPosn_L>0)
//
//DELETE FROM LIST($listRef_L;$itemPosn_L)
//
//End if
//
//SAVE LIST($listRef_L;$nameInListEditor_T)
//AU_DataItems
//C_TEXT($nameInListEditor_T)
//$nameInListEditor_T:="AU_DataItems"
//
//C_TEXT($columnName_T)
//$columnName_T:="Item1_Name"
//
//OBJECT SET CHOICE LIST NAME(*;$columnName_T;$nameInListEditor_T)
//
//$columnName_T:="Item2_Name"
//OBJECT SET CHOICE LIST NAME(*;$columnName_T;$nameInListEditor_T)
//This is updated dynamically in the LB FC
//$columnName_T:="EvalSymbol"
//OBJECT SET CHOICE LIST
NAME(*;$columnName_T;<>ListNameEvalSymbolText_T)
Fields vs arrays - I’ve done a lot of AreaList Pro work using fields
and arrays and my general rule is to use fields, if possible. In
addition to being faster when working with more than a few thousand
rows, there’s a lot less code when using fields. I’d assume that it’s
the same with list boxes.
--
Douglas von Roeder
949-910-4084
On Mon, May 18, 2020 at 10:45 AM stardata.info <http://stardata.info>
via 4D_Tech <[email protected] <mailto:[email protected]>> wrote:
Hi All,
I use a Listbox with arrays, and I need to insert a value in a row.
I need to change the contents of the list associated to the row that
i've need to change. Someone know how i can do?
Thanks
Ferdinando
**********************************************************************
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive: http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:[email protected]
<mailto:[email protected]>
**********************************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive: http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:[email protected]
**********************************************************************