JSP, BC4J : Allowing users to choose from List of values when in Insert mode

Hi,
I have a requirement in which the user would be able to select a value from a combobox for populating a field when inserting a new record. The list of values in the combo box is derived from a look up table in the database. How can do this?
Thanks.

Use the version provided in Jdev 3.2. It has two methods:
* Enables a LOV (list of values) for the specified attribute in
* the UI. In the typical case, when an attribute is selected in an
* HTML form, a LOV will be displayed.
* <p>
* This method enables a LOV for one or more of the RowSet's attributes.
* To return all of the RowSet's attributes,
* use the {@link #useLOV(String, String) useLOV} method.
* <p>
* @param sAtttibute name of the attribute for which an LOV
* should be enabled.
* @param voName name of the View Object to which the attribute belongs.
* @param sDisplayAttributes a comma-separated list of the RowSet's attributes
* that will be displayed when the attribute is selected.
* @param sDataAttribute the location from which the attributes' values are
* obtained.
* @see #useLOV(String, String)
public void useListOfValues(String sAttribute , String voName, String sDisplayAttributes, String sDataAttribute)
JSlibNeeded |= WebBean.JSModalPageConstructorLib;
LOVField lovField = new LOVField();
ViewObject vo = qView.getApplicationModule().findViewObject(voName);
ViewObject dupvo = qView.getApplicationModule().findViewObject(voName + "_query");
if(dupvo == null)
dupvo = qView.getApplicationModule().createViewObject(vo.getName() + "_query", vo.getDefFullName());
lovField.setViewObject(getApplicationName() + "." + dupvo.getName());
AttributeDef attr = qView.getViewObject().findAttributeDef(sAttribute);
lovField.setPromptText(getAttributeLabel(qView, attr));
lovField.setDisplayAttributes(sDisplayAttributes);
lovField.setDataAttributes(sDataAttribute);
setFieldRenderer(sAttribute , lovField);
* Enables a LOV (list of values) for the specified attribute in the UI.
* In the typical case, when the specified attribute is selected in an
* HTML form, a LOV will be displayed.
* <p>
* This method enables a LOV for all of the RowSet's attributes.
* To enable a LOV for a subset of the attributes,
* use the {@link #useListOfValues(String, String, String, String)
* useListOfValues} method.
* <p>
* @param sAtttibute name of the attribute for which an LOV
* should be enabled.
* @param voName name of the View Object to which the attribute belongs.
* @see #useListOfValues(String, String, String, String)
public void useLOV(String sAttribute, String voName)
useListOfValues(sAttribute, voName, null, sAttribute);
null

Similar Messages

  • This Question is at least 2.5 years old.  But still an issue.  I have an early 2008 and mid 2010 13 inch macbook pro running iTunes 10.7.  Itunes on both machines doesn't recognize blank cds or allow me to import from a music cd when I insert it.

    I have an early 2008 and mid 2010 13 inch macbook pro running iTunes 10.7.  Itunes on both machines doesn't recognize blank cds or allow me to import from a music cd when I insert it.

    iTunes does not use the .xml it uses the .itl
    If you are sure your old library file migrated across (does the file size and modification dates suggest it has?) start iTunes while holding down the option/alt key and guide it to the .itl file to get it to use that one.

  • Associating a Custome ResultSet with a Choose From List

    Hi Experts,
    I have to Link the Chose from List with a UDO for accessing the records from the Parent Table /Child Table
    How to crack this problem?
    Also I have to associate the Results of a custom query in a choose from list so that when I press TAB over a Text Box I get a Choose From List which displays the Results and I could select one of those rows.
    Plz Hint me for this Problem

    Hello,
    When you create CFL, just set your UDO type with oCFLCreationParams.ObjectType = "My_UDO", the collumn to be displayed in CFL has been determined by Find Service in your UDO definition.
    As per custom query, actually you can set the condition to do so. Direct customed SQL is not supported in CFL. You may refer to the SDK sample for further info after you install SDK component:
    <<C:\Program Files\SAP\SAP Business One SDK\Samples\COM UI\VB.NET\17.ChooseFromList>>
    Private Sub AddChooseFromList()
            Try
                Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
                Dim oCons As SAPbouiCOM.Conditions
                Dim oCon As SAPbouiCOM.Condition
                oCFLs = oForm.ChooseFromLists
                Dim oCFL As SAPbouiCOM.ChooseFromList
                Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
                oCFLCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
                ' Adding 2 CFL, one for the button and one for the edit text.
                oCFLCreationParams.MultiSelection = False
                'Just Set your UDO type.
                oCFLCreationParams.ObjectType = "My_UDO"
                oCFLCreationParams.UniqueID = "CFL1"
                oCFL = oCFLs.Add(oCFLCreationParams)
                ' Adding Conditions to CFL1
                oCons = oCFL.GetConditions()
                oCon = oCons.Add()
                oCon.Alias = "CardType"
                oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
                oCon.CondVal = "C"
                oCFL.SetConditions(oCons)
            Catch
                MsgBox(Err.Description)
            End Try
        End Sub
    Kind Regards
    -Yatsea

  • I need a control which allows a user to choose from specific values (which I specify), NOT 0, 1, 2 etc. [I KNOW I can let him enter 0, 1,2 fro

    m a listbox, and then change the value on the block diagram, but what I want is that on the subvi node itself he can enter the actual values, say 1, 10, 200. Does anyone know how to do this, creatively, since currently a control like this is not available.I need a control in Labview which allows a user to choose from specific values (which I specify), NOT 0, 1, 2 etc. [I KNOW I can let him enter 0, 1,2 from a listbox, and then change the value on the block diagram, but what I want is that on the subvi node itself he can enter the actual values, say 1, 10, 200. Does anyone know how to do this, creatively, since currently a con
    trol like this is not available.

    m a listbox, and then change the value on the block diagram, but what I want is that on the subvi node itself he can enter the actual values, say 1, 10, 200. Does anyone know how to do this, creatively, since currently a control like this is not available.> I need a control which allows a user to choose from specific values
    > (which I specify), NOT 0, 1, 2 etc. [I KNOW I can let him enter 0, 1,2
    > from a listbox, and then change the value on the block diagram, but
    > what I want is that on the subvi node itself he can enter the actual
    > values, say 1, 10, 200. Does anyone know how to do this, creatively,
    > since currently a control like this is not available.
    >
    One way of doing this is to use either a ring or enum where the strings
    presented to the user are "1", "10", or whatever you like. On the
    diagram, the values will be 0, 1, 2, in a compact counting sequence.
    Then do an array index into a constant. If this is done more than one
    place, make the control a typedef so you can keep them consistent an
    d
    make the index be done in a subVI. Then whenever you need this, you
    drop the control and the subVI, out comes the integer, float, or
    whatever it is you want to index.
    Greg McKaskle

  • [SBO 2005] Choose from list on User Table

    Hi all,
    I need an information from the developper that already tried the SDK of BO 2005.
    Is it possible to create Choose from List on user tables ?
    I looked at the WebEx, there is no restriction about it, but when I tried in the demo, I can't figure out how to do it.
    Thanks for your help
    Sébastien

    Thank for your input Edward:
    I do have the sample, but it uses a system table (OCRD, Object Type=2)
    It seems that it works for system object or UDO, but not for simple user table. Am I right ?
    Sebastien

  • Reagrding the choose from list using user tables

    Hi
       I need to link <b>the choose from List to my user defined table</b> and not to system tables. 
    for eg., i have created a  table namely opp. Now i want to link choose from list to this table.
    can anyone help me??
    its very urgent...
    thanks in advance
    Lee

    hi Adele 
      thanks for your concern.i have used this code
                Dim OCFLS As SAPbouiCOM.ChooseFromListCollection
                Dim OConds As SAPbouiCOM.Conditions
                Dim OCond As SAPbouiCOM.Condition
                OCFLS = OForm.ChooseFromLists
                Dim OCFL As SAPbouiCOM.ChooseFromList
                Dim OCPack As SAPbouiCOM.ChooseFromListCreationParams
                OCPack = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
                OCPack.MultiSelection = False
                OCPack.UniqueID = "CFL3"
                OCPack.ObjectType = "OPRQ"
                OCFL = OCFLS.Add(OCPack)
            Catch ex As Exception
                MsgBox(Err.Description())
            End Try
    <b>then i link the choose from list to the Button(choosefromlist) namely OLBut. the code is follws</b>
                            <b>ONewItem = OForm.Items.Item("67")
                            OLBut = ONewItem.Specific
                            OLBut.ChooseFromListUID = "CFL3"</b>
    but this is not working.i.e when i click the choose from list button nothing it is showing.what mistake i have done?please help me
    thanks in advance

  • BP Choose From List became Blank, All users affected

    Dear all:
    I hope anyone had the similar problem before.  Our BP list became blank and B1 has to be restarted from frozen state whenever any users select this function. All users are affected.
    What can be the root cause of this?
    Hope somebody could give solution soon.
    Thanks in advance,
    Gordon

    Dear Gordon,
    Please check the following :
    1 ) whether there are lots of records for the Business Partners?
    2) Whether in the form Settings some Grouping is being done which needs time to display.
    Chances are for the second option. If you check by restore defaults for the Form Settings in Choose from List, it may work.
    Regards,
    Jitin Chawla

  • UDO-Choose From List

    Hi;
    I would appreciate if someone could tell me how to associate an UDO to a choose from list.
    I have looked over the SDK example, but this is for standar SAP objects and I need to associate the choose from list to a customer object. 
    Best regards

    The choose from list (CFL) can be triggered from your edittext - there is some sample code in the DI API help file that shows this.  Have a look for 'Adding a choose from list object' in the help file.  Remember that where they set ObjectType="2", you should use the name of your UDO.
    As can also be seen in the help file, CFL objects allow you to add conditions to determine what rows are displayed.  In the example it shows selecting only where CardType = 'C'.  The columns displayed can be tailored by the user at runtime, where they can select from any columns that are on your main UDO table.
    There are a few limitations.  At present CFL's do not allow you to directly specify a SQL query.  Only data from the single table related to the 'ObjectType' is displayed.  If you want a more complex query that displays data from multiple tables when you press tab, a formatted search may be more powerful.  If you search the forums you should find one of my previous posts (probably about a year ago) where I showed how to link a formatted search to the tab keypress and have it behave in a very similar manner to a CFL.
    John.

  • Is it possible to populate a Choose From List manually?

    Hi
    I've got a requirement in a SDK screen that needs to be written to have a Choose From List contained on a Matrix column that should allow the selection of Item Masters as well as the selection of specific data contained within a User Defined Table. Whenever using ChooseFromLists I've always only ever used them to link to a object such as Items, Sales Order etc. and not a combination, or even to a User Defined Table. Is this even possible.
    If not I guess the only way around it would be to create a form mimicking the ChooseFromList which I could populate with what ever I like?
    Thanks
    Steve

    Hi Steven,
    Yes, Its possible which behaves as system CFL.
    Design the form like cfl having grid, choose button, cancel button and edittext of find. When you tab on edittext on form open the CFL form and after load form fill the grid by Datatable using sql query. Write code for select grid line on click of grid. Write the code on choose button which retrive value from grid.
    Thanks,
    Mahesh

  • Removing a Choose From List

    Hi
    I have a matrix containing numerous columns, one of which is a combo type column and one which is an edit box column containing a choose from list linking to the Item Master.
    What I need to happen is if the user selects a particular option from the combo column then the edit box column cell associated with that row will no longer allow the user to use the choosefromlist function and will not validate the value entered with an item. So basically I need to temporarily remove the choosefromlist functionality from this particular cell.
    The way I though of doing this was simply using a SAPbouiCOM.EditBox in order to select the particular cell and then try to set the .ChooseFromListUID property to "", however this does not work.
    Is there any way that this can be done?
    Thanks a lot
    Steve
    Edited by: Steven Tryner on Jun 9, 2009 4:41 PM

    Yeah I tried implementing this method into my code however the problem I had was stopping the cell from being automatically being validated against an Item, as it does with a choosefromlist. So if the text entered into the cell is not an Item the user can't navigate to any other cell until a valid itemcode is entered.
    Is there any way around this?
    Thanks

  • Choose From List used in UDO (B1 2004)

    Hi,
    in the presentation "Creating a UDO of document type.pps" (slide 53+55) provided with the SDK 2004 they use the Choose From List to select business partners and/or items in their UDO form when adding a new document. Does anyone know, how this has to be done? The sample, from the presentation is not provided in the sample codes.
    Do I have to use an implementation DLL for my UDO to use this functionality?
    My problem is, that it takes too long (about 5 times longer than with the system CFL) to get all items in my custom defined matrix.
    thanks,
    Markus

    Hi Markus,
    You cannot use the built-in CFL in version 2004. It is only exposed from version 2005. The only suggestion is to look at optimizing your matrix. All CFLs in the system uses DB Datasources which makes populating the grid faster than using User data sources.
    Hope it helps,
    Adele

  • Choose From list in Matrix UDF

    i create a UDF in Sales Order Row, I want to assign choose From list in the Matrix for the UDF once user click on tab button.
    How can i assign the Choose from list for the UDF column?

    Hi,
    Try this code for adding CFL.             
                   SAPbouiCOM.ChooseFromListCollection oCFLs = null;
                    SAPbouiCOM.Conditions oCons = null;
                    SAPbouiCOM.Condition oCon = null;
                    oCFLs = oForm.ChooseFromLists;
                    SAPbouiCOM.ChooseFromList oCFL = null;
                    SAPbouiCOM.ChooseFromListCreationParams oCFLCreationParams = null;
                    oCFLCreationParams = ( ( SAPbouiCOM.ChooseFromListCreationParams )( SBO_Application.CreateObject( SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams ) ) );
                    oCFLCreationParams.MultiSelection = false;
                    oCFLCreationParams.ObjectType = "object id ";
                    oCFLCreationParams.UniqueID = "CFL1";
                    oCFL = oCFLs.Add( oCFLCreationParams );
                   oColumn.ChooseFromListUID = "CFL1";
                  //where oColumn is the instance of that column.
    Hope u will get help....
    Thanks and Regards,
    Lalit

  • Choose From List From a UDT in SAP Business One 2005 A

    Hi All
    How to develop a Choose From List from a <b>User Defined Table</b> (not from System Tables) in SAP Business One 2005 A.
    I need the Choose From List should display the records stored in the UDT.
    Any Idea ?
    Thanks in Advance.
    Regards.
    Asutosh.

    Hi Asutosh,
    You can add a CFL to a User Defined Object, not a simple User Defined Table.
    In order to do it you only have to set the object type of the CFL to the code of your UDO.
    Here you have a simple:
    oCFLCPuo = SB1_App.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
    oCFLCPuo.ObjectType = "MY_UDO_CODE"
    oCFLCPuo.UniqueID = "UserObjectCFL"
    oCFLuo = oForm.ChooseFromLists.Add(oCFLCPuo)
    Hope it helps
    Trinidad.

  • Problem in Choose from list.

    Hi,
    As I tried CFL for a user defined form, when I select an item from CFL and it is displaying in the relevant field.  And when I save the data it is perfectly saving with the message of "Operation has been completed successfully".  But the data is not saving in the field in which is the CFL is activating. 
    It would be appreciated, if any one can give the solution please.
    The steps I' ve followed as,
    1.  In the screen painter I' ve added the choose from list thru' the collection folder.
    2.  Then the choose from list id is attached and give the allias in the item's specific property.
    3. Then I' ve written code in the load form function as follows.
                Oform.DataSources.UserDataSources.Add("EditDS", SAPbouiCOM.BoDataType.dt_SHORT_TEXT)
                txtaccode.DataBind.SetBound(True, "", "EditDS")
    4. In the item event
            If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then
                Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent
                oCFLEvento = pVal
                Dim sCFL_ID As String
                sCFL_ID = oCFLEvento.ChooseFromListUID
                Dim oForm As SAPbouiCOM.Form
                oForm = SBO_Application.Forms.Item(FormUID)
                Dim oCFL As SAPbouiCOM.ChooseFromList
                oCFL = oForm.ChooseFromLists.Item(sCFL_ID)
                If oCFLEvento.BeforeAction = False Then
                    Dim oDataTable As SAPbouiCOM.DataTable
                    oDataTable = oCFLEvento.SelectedObjects
                    Dim val As String
                    Dim val1 As String
                    Dim val2 As String
                    Dim val3 As String
                    Try
                        Try
                            val = oDataTable.GetValue(0, 0)
                            val1 = oDataTable.GetValue(1, 0)
                            If (pVal.ItemUID = "txtaccode") Then
                                oForm.DataSources.UserDataSources.Item("EditDS").ValueEx = val
                                txtaccode.Value = val
                                oForm.DataSources.UserDataSources.Item("EditDS1").ValueEx = val1
                            End If
                        Catch ex As Exception
                            Exit Sub 'For Exception raised for Cancel Button
                        End Try
                    Catch ex As Exception
                        SBO_Application.MessageBox(ex.Message)
                    End Try
                End If
            End If
        End Sub

    Checks if  the property TableName in the field is pointed to the table to store de data.
    Go to  Example: How to binding CFL  to a UDO in a customized System Form. and rate it
    regards

  • Choose from List for UDT

    I have made a UDT
    and I want to create a choose From List  of that table
    I know how to create choose frm list  for system tables
    like making Business partner  choose from list
    but I'm not able to make choose frm list for UDT
    please someone answer my question

    HI Riya,
    You can link a CFL to a User Defined Object but not a plain User Defined Table. A full list of options can be found in the UI help under BoLinkedObject Enumeration.
    Thanks,
    Lisa
    SAP Business One Forums

Maybe you are looking for

  • DVI To Video Adapter on XP using Boot Camp

    I bought a DVI To Video Adapter for my MacBook pro. Though is works fine on the Mac OsX, when I tried to use it on Windows XP (using Boot Camp) all I got was a black-flickering image on my TV. Anyone- anything-? Thanx MacBook Pro   Mac OS X (10.4.6)

  • Report: Link

    Hello Everyone, I have an application , which has a report region of type SQL Query Region Source: select id, name from tableA I would like to make the name column as a link so that when the user clicks on a particular name, it should open up a form/

  • Need a way to track the Demand/Supply in MRP

    Hi We have this scenario: Business is using a third party system to book the Orders which are practically the Forecast in Oracle. These orders are linked to a unique tracking number in the third party system (similar to Project /Task in Oracle). We a

  • Getting javascript error while logging in EP

    Hi,    I have installed EP and after that I got the login screen. Now I logged in as "administrator" and see the 3 roles Content Administration, User Administration and System Administration    But while the screen comes there are many script error p

  • Regarding Conversion of the Charecter field Into Lowercase in an ALV REPORT

    HI ALL, I have created an editable alv Report. In which i have a coloumn with charecter field where i can enter 64 charecters. when ever i have enter and moved to another Tab its converting into Capital Letters. I need to stop it conversion. Can any