Display the combination of 2 fields in the Listbox

Hi,
I have used the list box for displaying customer name from the database table(MySQL). I can assign one field as value field and one is display field in the listbox.
But I want to display the combination of both fields (Firstname and Lastname) in the listbox.
my code in Bean:
tbldoctorsRowSet2.setDataSourceName("java:comp/env/jdbc/CustDataSource");
        tblcustomersRowSet2.setCommand("SELECT CUST_ID, CONCAT(LAST_NAME, FIRST_NAME) AS FULLNAME  FROM  tblcustomers");
        tblcustomersRowSet2.setTableName("tblcustomers");
        tblcustomersDataProvider2.setCachedRowSet((javax.sql.rowset.CachedRowSet)getValue("#{AdminSettings.tblcustomersRowSet2}"));JSF Jsp file
<ui:listbox binding="#{AdminSettings.listbox}" converter="#{AdminSettings.listbox1Converter}" id="listbox"
                            items="#{AdminSettings.tblcustomersDataProvider2.options['tblcustomers.CUST_ID,FULLNAME']}"I got NullPointerException at the runtime.
Please tell me how do i display the combination of the fields in the list box.
thank you

Hi,
myself Tushar Parekh From Mumbai. I am also new to this tech but had faced same problems few days back so I am string to give u hint which will can u
tbldoctorsRowSet2.setDataSourceName("java:comp/env/jdbc/CustDataSource");
tblcustomersRowSet2.setCommand("SELECT CUST_ID,ONCAT(LAST_NAME, FIRST_NAME) AS FULLNAME FROM tblcustomers");
tblcustomersRowSet2.setTableName("tblcustomers"); tblcustomersDataProvider2.setCachedRowSet((javax.sql.rowset.CachedRowSet)getValue("#{AdminSettings.tblcustomersRowSet2}"));
***** WRITE THIS METHID IN Your Bean where u have written above code:
Start--------------------
public SelectItem[] getlistHashMap() {
HasMap ItemHashMap = new HashTable();
ItemsHashMap.put(new Integer(tblcustomers.CUST_ID,tblcustomers.FULLNALE));
}catch(Exception E) {
System.out.println("Exceptio occur while tring to fill combo is " + E);
this.getItemsHashMap().put(new Integer(1),"Exception In Fetching");
System.out.println("Exception in LAMaintainBean At Line 191");
End---------------------
and then In JSF Jsp file
<h:selectOneMenu id="listbox" value="#{AdminSettings.listbox}">
<f:selectItems value="#{AdminSettings..listHashMap}"/>
</h:selectOneMenu>
try this....
<ui:listbox binding="#{AdminSettings.listbox}" converter="#{AdminSettings.listbox1Converter}"
id="listbox" items="#{AdminSettings.tblcustomersDataProvider2.options['tblcustomers.CUST_ID,FULLNAME']}"

Similar Messages

  • How do I take two separate non numeric fields in a acrobat form and combine the data to display in a third separate field?

    How do I take two separate non numeric fields in a acrobat form and combine the data to display in a third separate field?

    You have to use custom JavScripting to concatenate the first 2 fields. You cannot use the first 2 calculation options because they force the values of the fields to a numeric value or ignore string values.
    Possible scripts for the 3rd field are:
    event.value = this.getField("Text1").valueAsString + " " + this.getField("Text2").valueAsString;
    or
    event.value = this.getField("Text1").valueAsString.concat( " ",  this.getField("Text2").valueAsString);
    If you do not want change the separator or not show the separator when on or the other field is empty, you will need to add more code to adjust for change.
    The above scripts will also concatenate number because the field values are read as strings and not numbers.
    There is also a generalized user written function to concatenate up to 3 fields with a separator that adjust for missing data.

  • How to display the fields in ALV Output without using Field catalog?

    How to display the fields in ALV Output without using Field catalog?
    Could you pls tell me the coding?
    Akshitha.

    Hi,
    u mean without building field catalog. is it? I that case, we can use the FM REUSE_ALV_FIELDCATALOG_MERGE.
    data: itab type table of mara.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    i_program_name = sy-repid
    i_structure_name = itab
    CHANGING
    ct_fieldcat = lt_fieldcat[]
    EXCEPTIONS
    inconsistent_interface = 1
    program_error = 2
    OTHERS = 3.
    *Pass that field catalog into the fillowing FM
    call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_grid_title            = 'REPORTING'
                is_layout              = gt_layout
                it_fieldcat             = lt_fieldcat[]
           tables
                t_outtab                = itab.

  • How to display the editable fields in output of an ALV report?

    Hi all,
    I have a requirement of displaying values in ALV Grid format and above this grid display i have to put some fields , that are editable.
    I know making ALV grid fields as editable, but here requirement is to display some fields before displaying the ALV grid dispaly and to enable these fields editable to user and when printing this the values entered by user also has tobe printed.
    Please help me on solving this problem? Is it possible to do this with ALV function modules?
    Thanks,
    Vamshi.

    Hi all,
    Thanks for your replies.
    But this is not  my requirement. I mentioned in my question that i too know how to edit the fields in ALV grid report.
    Here my requirement is .
                                             name :_____________
                                             amount:____________
    alv grid display
    Like above i need to display.  after name the user can be enter value and after amount also the user can be enter some value at output . But this is not the header of ALV .
    Is this possible in classical ALV or Classical report? If not please specify alternative?
    Thanks,
    Vamshi.

  • How to display the field name in the tabulated view for a content query web part

    I have added a content query web part changed the web part file to include custom columns imported and reffered itemstyle.xsl
    to include the tabulated view for the content query.
    However the way it is displayed is such that only the content is displayed.
    As i am using a tabular view wto display the data, i want to display their field names as well.

    Hi  ,
    According to your description, my understanding is that you need to display the field in the tabulated view for a content query web part.
    For your issue, please refer to the code as below:
    <xsl:template name="VendorCustomStyle" match="Row[@Style='VendorCustomStyle']" mode="itemstyle">
    <html>
    <table width="100%">
    <xsl:if test="count(preceding-sibling::*)=0">
    <tr>
    <td width="8%" valign="top"><div class="item"><b>Vendor ID</b></div></td>
    <td width="12%" valign="top"><div class="item"><b>Vendor Name</b></div></td>
    <td width="50%" valign="top"><div class="item"><b>Vendor Description</b></div></td>
    <td width="10%" valign="top"><div class="item"><b>Vendor Country</b></div></td>
    <td width="10%" valign="top"><div class="item"><b>Vendor Date</b></div></td>
    <td width="10%" valign="top"><div class="item"><b>Created By</b></div></td>
    </tr>
    </xsl:if>
    <tr>
    <td width="8%" valign="top"><div class="item"><xsl:value-of select="@VendorID" /></div></td>
    <td width="12%" valign="top"><div class="item"><xsl:value-of select="@Title" /></div></td>
    <td width="50%" valign="top"><div class="item"><xsl:value-of select="@Vendor_x005F_x0020_Description" disable-output-escaping="yes" /></div></td>
    <td width="10%" valign="top"><div class="item"><xsl:value-of select="@Vendor_x005F_x0020_Country" /></div></td>
    <td width="10%" valign="top"><div class="item"><xsl:value-of select="@Vendor_x005F_x0020_Date" /></div></td>
    <td width="10%" valign="top"><div class="item"><xsl:value-of select="@Author" /></div></td>
    </tr>
    </table>
    </html>
    </xsl:template>
    For more information, please have a look at the blog:
    http://www.codeproject.com/Articles/756834/Customizing-the-Content-Query-Web-Part-and-Item-St
    http://msdn.microsoft.com/en-us/library/ms497457.aspx
    http://clarksteveb.hubpages.com/hub/Customized-Content-Query-Web-Part-CQWP-in-SharePoint-2007-with-results-Tabbed-Grouped-and-in-an-HTML-Table
    http://blog.sharepointexperience.com/customitemstyle/
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • How to display the return value of a function in a text field

    Hi,
    I have 2 textfields in a page.
    i> Empno
    ii> Salary
    The requirement is,
    i. Enter an Employee No.
    ii. On click of the 'SUBMIT' button a process would be executed which calls a function (or procedure with out parameter) which returns the Salary of the given Employee.
    iii. Need to display the salary to the 2nd textfield (Salary).
    Here is my process:
    i. If procedure call-- :P2_X is a page text field and out parameter.
    begin
    Pri_test_PROC(:P2_EMPNO,:P2_X);
    end;ii. If Function call --
    begin
    :P2_X:=Pri_test_PROC(:P2_EMPNO);
    end;
    Issue:
    The process is not getting executed and returning the process error message.
    Could anyone please give me a pointer, how to overcome the issue. Or if this is not the right way, then what is the work around.
    Regards
    Antara

    Antara,
    1. Clue about the error - yes, when I see the error message.
    2. What happens if you try to create a procedure like this:
    CREATE OR REPLACE PROCEDURE fetch_sal (in_emp IN NUMBER, out_sal OUT NUMBER)
    IS
    BEGIN
       FOR c IN (SELECT sal
                   FROM emp
                  WHERE empno = in_emp)
       LOOP
          out_sal := c.sal;
       END LOOP;
    END;and then run this in SQL Plus:
    DECLARE
       v_sal   VARCHAR2 (20);
    BEGIN
       fetch_sal (7839, v_sal);
       DBMS_OUTPUT.put_line (v_sal);
    END;What do you get displayed?
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • How to fetch the data & display the data if fields got the same name in alv

    hi frnds, i need ur help.
    how to fetch the data & display the data if fields got the same name in alv grid format.
    thanks in advance,
    Regards,
    mahesh
    9321043028

    Refer the url :
    http://abapexpert.blogspot.com/2007/07/sap-list-viewer-alv.html
    Go thru the guide for OOPs based ALV.
    Use SET_TABLE_FOR_FIRST_DISPLAY to display the table:
    CALL METHOD grid->set_table_for_first_display
     EXPORTING
    I_STRUCTURE_NAME = 'SFLIGHT'     “Structure data
    CHANGING
    IT_OUTTAB = gt_sflight.          “ Output table
    You can also implement
    Full Screen ALV, its quite easy. Just pass the output table to FM REUSE_ALV_GRID_DISPLAY. 
    For controlling and implementing the FS-ALV we have to concentrate on few of the components as follows :
    1. Selection of data.
    2. Prepare Layout of display list.
    3. Event handling.
    4. Export all the prepared data to REUSE_ALV_GRID_DISPLAY.
    Regd,
    Vishal

  • How to display the PK which is it alreday database sequence in a text field

    hi alllllllllllllll how to display the PK which is it alreday database sequence in a text field in form instance???

    2 ways,
    1) select the item in your SQL query and call it item_display - then you can treat it as a normal item with no impact on the database.
    2) Set the item to a display only item.
    Hope this helps,
    Russell

  • Reg. displaying the comparison BOM fields in a single line in CS14

    Dear Experts,
    My requirement is that whenever CS14 is executed for Primary BOM with Secondary BOM comparison, when the Differentiated/Summarized Comparison button is selected, the comparison BOM Fields should appear in a single line. Currently SAP standard displays in two lines. in first line, primary BOM and next line, Secondary BOM. This functionality must be changed. I found Customer Exit PCSD0004 to achieve this. But how to do? Can anyone share your experience?
    Thanks
    Ramesh Manoharan

    Hi mroshaw76 ,
    That should be eazzzzyy :)
    <?for-each-group:/Parent;Product?>
    <?Parent?>  --- this will display the car
    Colors of the <?Product?> : <?for-each@inlines:current-group()?><?value?><?end for-each?>
    <?end for-each?>Note the element name are case-sensitive.

  • Want to display a space after last field in the output txt file

    hi
    I want to display a space after last field in the output txt file which is generaed by my program on utility server the last field lengyt we have defined is four and in database it is of three characters and requirement is to disppaly the last fourth field as space in the output file w hich is not shown as the txt file automatically gets closed at the third place as it is the last field in the record and ind atabase records are of therss char only but user wants to display this fourth position in the notepad output file as space ( which is last field in the output file)
    eg
    name house  street country
    record output coming in file
    ram   h3      street3  thn      now this thn which is last field the notepad get closed at thn only
    i want to display one space in last field for the whole of output file
    ie ram      h3   street3  thn(space)
        sham   h4  street4   sgp(space)  so on......
    we need to show this space in the output file as blank
    regards
    Arora

    hi Atish
    i am using
    loop at gt_sagadr_outtab into wa_sagadr_outtab
    move wa_sagadr_outtab-country to wa_sagadr_text+223(226).
    endloop
    in this last field ie country i need to display the last 226 as blank as only country key is two char in database so the last space is not shown
    i am not unsing the fM as tolb by  you
    and afterwards
    i am usning
    Concatenate 'Sagadr_' sy-datum sy-uzeit '.dat' into gv_filename_sagadr.
    CALL FUNCTION 'FILE_GET_NAME'
      EXPORTING
      CLIENT                        = SY-MANDT
        LOGICAL_FILENAME              = gc_lfile
        OPERATING_SYSTEM              = SY-OPSYS
        PARAMETER_1                   = gc_param1
        PARAMETER_2                   = gc_send
        PARAMETER_3                   = gv_filename_sagadr
      USE_PRESENTATION_SERVER       = ' '
      WITH_FILE_EXTENSION           = ' '
      USE_BUFFER                    = ' '
      ELEMINATE_BLANKS              = 'X'
      IMPORTING
      EMERGENCY_FLAG                =
      FILE_FORMAT                   =
        FILE_NAME                     =  gv_filepath_sagadr
    EXCEPTIONS
      FILE_NOT_FOUND                = 1
      OTHERS                        = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    and lastly
    open dataset gv_filepath_sagadr for output in text mode encoding default.
        if sy-subrc eq 0.
         loop at gt_sagadr_text into wa_sagadr_text.
         transfer wa_sagadr_text to gv_filepath_sagadr.
         endloop.
        endif.
       close dataset gv_filepath_sagadr.
        if sy-subrc = 0.
        message S002 with gv_filepath_sagadr. "Files & created on Application server
        endif.
    SO NOT SURE WHERE TO USE THE CODE AND HOW

  • How to display the field "Country" in the Address Book UI ?

    How to display the field "Country" in the Address Book UI ?

    Using an add-on, MoreFunctionsForAddressBook gives you that opportunity.

  • How to display the fields in effective

    i have 10 fields names as name,add,code,no.seats......
    I have two choices those are Table, and other one is add fields and JScrollpane to a panel and display it.
    Can any one have other choices to display the fields effectively.

    You are only limited by your imagination. What sort of answer are you looking for?

  • Display the entire path to the term in the field option programmatically

    hi,
     I am having hundreds of doc libs with a  taxonomy column .now i want to change the property diaplay format:
    Display the entire path to the term in the field option, programmatically.
    can anyone pls help how to achieve this. i am thinking of writing  a consoel appln which iterates through all the sub sites on my site collec and  all doclibs and want to access this taxonomy columns and change this  display format .
    but i am stuck with whats the property responsible for this.
    help is appreciated! 

    hi Benjamin,
    Please try IsPathRendered Property of the taxonomy field. It is a Boolean field which related to display format of a taxonomy field.
    FALSE - Display term label in the field
    TRUE - Display entire path of the term in the field
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.taxonomy.taxonomyfield.ispathrendered(v=office.14).aspx
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • Can we display the field name vertically

    Hi BI Experts ,
    Iam using Bex Analyzer to run reports.
    1.in report i want to display the field name vertically. is there any possibilities.
    2.i had tried using format cells in excel settings , but i have to make settings every time after running the report.
    3. i need this settings should be done before running the report and user can see the report such a way that field name should be displayed vertically.
    Please suggest me is there any way to do this.
    Thanks
    Tulsi

    Hello,  
    You can create a workbook, do the necessary format and turn off the format refresh in the Bex Tool bar property. You can turn off the same in Query Property.
    [Thanks|http://chandranonline.blogspot.com/]
    [Chandran|http://chandranonline.blogspot.com/]

  • List view to include a column or field which would display the sequence number in a view

    I have a view for a list which displays items following any condition or sorting. Now, i would like to display the list items in such  a way that
    the auto incremented numbers are displayed as an arbitary field which would display the numbers such that
    its just going to display items in sequence. Is there anything that can be done in sharepoint designer for the list to accomodate a column/field which would display the sequence numbers.
    Thanks

    There are columns such as
    Name, Goals
    and  it should be arranged in descending order of Goals and it could be paginated but also a column should be displayed for ranks e.g
    Name Goals Rank
    A          40     1
    B          39     2
    C          30     3
    So, the idea is the ways it is sorted in descending order, if we possibly have a counter then we could display the ranking of the items.
    Thanks

Maybe you are looking for

  • MTO not considering available raw materials

    Here there are some available raw materials in unrestricted use. When any new sales order is generated for MTO finished material it is generating a new purchase requisition for the same raw material ( since that raw material is not assigned to the sa

  • Single Row Returns More than 1 row

    I have this query that displays the HOME telephone number of an EMP, however I have to put that Select on the field, since that field is HOME phone. The Outputs are: Name Address Birthday Home Phone Mobile Phone Salary Manager My input is: ID How am

  • Email subject line

    i want to change subject line of email which r used for notification.wat can b done??

  • Storing data in a Text File.

    Hi All, I want to create a text file in my current directory,and store the data into it.Could anybody help me in this.

  • Layout generation with VSS

    Hello all, I am in the process of designing a phase locked loop based frequency synthesizer. I successfully simulated the PLL. The PLL chip was simulated using the Phase frequency detector/charge pump and the divider provided in VSS element browser.