on 09-25-2008 8:25 AM
hi, i changed the type of one column in my matrix from EDIT to LINKBUTTON. but know, when i start my form, i cannot manually insert a value in this column.
i have a new row in the matrix, which is empty. but when i insert a value in this cell and leave it with TAB, the value disappears.
what can i do instead?
Hi...
If Ur using CFL uid or link button object = 2 means
example:
u bind cardcode means that only store in matrix or display.if u want to enter manuly is not possible.
Regards...
Billa 2007
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have added an example for columns here:
Use the pval.Row (or in the linked example: "oCflEvent.Row") property to identify the Matrix-Row in the CFL-column. It can be used to update the right row in a Matrix with UserDataSources or DataTable or DBDataSource with the CFL-value.
Adding the CFL to a column is described in my last answer above...
Thank you it finally worked. But, only in DEBUG environment!!
that is my code:
if (oData != null)
{
if (cflID == "Nutzer" || cflID =="Projectcod")
{
string sErg;
cflBefore = oDBFB2.GetValue("U_abc_Nutz", pVal.Row);
if (cflID == "Nutzer")
{
sErg = oData.GetValue(0, 0).ToString();
oDBFB2.SetValue("U_abc_Nutz", pVal.Row, sErg);
}
else
{
sErg = oData.GetValue(0, 0).ToString();
oDBFB2.SetValue("U_abc_Proj", pVal.Row, sErg);
}
oForm = SBO_Application.Forms.Item(FormUID);
UpdateCells(oForm, pVal.Row, sErg, cflID);
}
}
private bool UpdateCells(SAPbouiCOM.Form oF, int iRow, string sCode,string sColumn)
{
SAPbouiCOM.Matrix oMatrix = (SAPbouiCOM.Matrix)oF.Items.Item("Beleg").Specific;
SAPbouiCOM.Cell oCell;
SAPbouiCOM.EditText oText;
SAPbouiCOM.Column oCol;
try
{
oCol = oMatrix.Columns.Item(sColumn);
oCell = oCol.Cells.Item(iRow);
oText = (SAPbouiCOM.EditText)oCell.Specific;
oText.String = sCode;
oCol = null;
oCell = null;
oText = null;
System.GC.Collect();
}
catch (Exception ex)
{
return false;
}
return true;
}
when i make an addon, it doesn't get the value back!?!
Have you debugged the code? What does not work:
1. Getting the CFL Data from the DataTable:
sErg = oData.GetValue(0, 0).ToString();
(this should also work with sErg = oData.GetValue("CardCode", 0).ToString(); if it's a Bus.-Partner for example)
2. or setting the data:
oDBFB2.SetValue("U_abc_Nutz", pVal.Row, sErg)
Why do you write the data two times? First time as oDBFB2.SetValue and second time in UpdateCells via EditText.String?
If it's only at your customers side then one way could be to make a special version of your AddOn with MessageBoxes at each step of the CFL-event and show the relevant variables in the MessageBox to find out where the CFL-value is lost.
And you may have a look at the descriptions of the updates in the B1-download-area. Maybe there's some CFL related fix since PL19?
Sorry, I don't know at the moment - only some questions (sometimes questions can help...;-)
Have you debugged the code? What does not work:
1. Getting the CFL Data from the DataTable:
sErg = oData.GetValue(0, 0).ToString();
(this should also work with sErg = oData.GetValue("CardCode", 0).ToString(); if it's a Bus.-Partner for example)
2. or setting the data:
oDBFB2.SetValue("U_abc_Nutz", pVal.Row, sErg)
Why do you write the data two times? First time as oDBFB2.SetValue and second time in UpdateCells via EditText.String?
If it's only at your customers side then one way could be to make a special version of your AddOn with MessageBoxes at each step of the CFL-event and show the relevant variables in the MessageBox to find out where the CFL-value is lost.
And you may have a look at the descriptions of the updates in the B1-download-area. Maybe there's a CFL related fix since PL19?
Hi Philipp,
do you DataBind the Column? Without DataBind a LinkedButton Column does not work as expected.
In case of a column for Businespartner-CardCodes I would do somewhere on form load (or already saved in .xml/.srf):
oForm.DataSources.UserDataSources.Add("UDS_CARDCD", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 15)
oMtx.Columns.Item("24").DataBind.SetBound(True, "", "UDS_CARDCD")
...if a UserDataSource fits your needs (a DataTable-Bind or a DBDataSource should work too)
Cheers,
Roland
(DataBind-Preacher)
PS.: ups...a minute too late
Edited by: Roland Toschek on Sep 25, 2008 10:08 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ok, well i don't know how to describe it.
the column is bound to a user table, yes. it displays the values of the table, that is good like it is. but i also want, that it is possible to insert values to the matrix. and after "update" the values shall be transferred to the db. that worked fine, when the types of all columns were EDIT.
but now, since the type of 2 columns are LINKBUTTON, i am not able to insert values to these columns manually.
to make it more clear, i have a matrix and the first column is the employee. it is now of type linkbutton with a choosefromlist. it shall be possible to choose an employee. which also doesn't work right. because the choosefromlist opens when i insert a *, but then when i choose an employee nothing happens except for closing of the choosefromlist.
what did i do wrong?
a try and catch block??
it is user action! the user puts in a value in this field, but when he leaves the cell it disappears. the values, which are already in the table, are displayed correctly!
maybe i did something wrong in the screen painter?!
Edited by: Philipp Igler on Sep 25, 2008 10:46 AM
>
> to make it more clear, i have a matrix and the first column is the employee. it is now of type linkbutton with a choosefromlist. it shall be possible to choose an employee. which also doesn't work right. because the choosefromlist opens when i insert a *, but then when i choose an employee nothing happens except for closing of the choosefromlist.
>
> what did i do wrong?
>
it is now of type linkbutton with a choosefromlist. it shall be possible to choose an employee.
Just to clarify things: You know that LinkedButton (orange arrow) and ChooseFromList are different things?
Maybe you should deactivate all CFL-related things to check the LinkedButton functionality seperatly first....
yeah, look. i have a matrix with columns and the type of two of these columsn is "it_LINK_BUTTON"". furthermore this 2 columns also have a cfl attached. to one is the employee data and to the other the project data linked.
the linkbuttons work! so i can see the arrows in the cells and can navigate to the corresponding data. AND when i insert a "*" in these columns the cfl opens correctly.
BUT i have two problems:
First problem is, that when i chose a record of the cfl it won't be transfered to my cell in the form.
Second problem is, that when i insert a value manually without the cfl and the leave the cell with TAB, the value disappears. but when i leave the cell by clicking on a different cell, the value keeps in and the arrow appears correctly.
>
> First problem is, that when i chose a record of the cfl it won't be transfered to my cell in the form.
Do you catch the CFL-Not-BeforeAction Event for...
...getting the selected CFL-Vals from the provided DataTable and...
...add them to your Matrix (this must be done by code - not automatically) ?
Hello Phillip,
for problem No. 1 I've written an example here:
Problem No.2:
I only can reproduce this when I omit the DataBinding of the CFL-EditText-Field or -Column.
When CFL works correctly with "empty-field-and-TAB" then the behaviour for manually entered numbers is...
...entering an existing (in DB) code into the CFL-Field and leaving the field also activates the CFL-Event
(if the CFL-event-code fills additional fields then this is also done here - see my Service-MTX-example at the link above).
...entering a wrong (not existing) No. opens the CFL-PopUp with empty lines.
Maybe you forgot sth. when defining the CFL (on form initialize/load) for the MTX-Column?
This is what I do (I've tried to extract the essential things from my code - could be a little bit shorter ;):
Dim FormCfls As SAPbouiCOM.ChooseFromListCollection = oForm.ChooseFromLists
Dim LinkedObj As SAPbouiCOM.BoLinkedObject = SAPbouiCOM.BoLinkedObject.lf_Items
Dim CflCol As SAPbouiCOM.Column = oMtxSrv.Columns.Item("xy")
Dim CflUidCol As String = "CFL_ITNO1" ' CFL-UID for identifying the CFL at the CFL-Event
Dim CflAliasCol As String = "ItemCode" ' the main DB-column for CFL
Dim oCons As SAPbouiCOM.Conditions = Nothing ' set if needed
Dim oCfl As SAPbouiCOM.ChooseFromList
Dim oCflCreationParams As SAPbouiCOM.ChooseFromListCreationParams
oCflCreationParams = SboCon.SboUI.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
oCflCreationParams.MultiSelection = False
oCflCreationParams.ObjectType = LinkedObj
oCflCreationParams.UniqueID = CflUidCol
oCfl = FormCfls.Add(oCflCreationParams)
'### OPTIONAL:
'# restrict shown ChooseFromList-items by conditions
If Not oCons Is Nothing Then
oCfl.SetConditions(oCons)
End If
'#
'###
CflCol.ChooseFromListUID = CflUidCol
CflCol.ChooseFromListAlias = CflAliasCol
Make sure that col is bounded to a data source.
Vasu Natari.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.