Date in InputField/TextView

Hi all,
I was wondering if anyone knows how a date value gets formatted to a string before it's displayed in an InputField or TextView. I believe the conversion uses the current session locale you can obtain by calling WDResourceHandler.getCurrentSessionLocale(). However, using DateFormat.getDateInstance and passing it the locale and any of the predefined styles does not produce the same results. Even using WDResourceHandler.formatDate yields different results. I'm in Australia and for this locale I get dates displayed in format d/MM/yyyy and if I switch to US locale, I get dates in format M/d/yyyy. Is there any means to obtain the pattern and/or SimpleDateFormat (if they use one) they use in Web Dynpro internally. I need this to be able to display dates consistently.
Thanks,
Martin

Hi guys,
Thanks for your answers. Not sure we understood each other completely. What I meant was this. I know how to format a date value to my desired pattern. The problem is, I don't know what my desired pattern is. I'm trying to write an application that should be internationalized. For the start, it should work both with Australian and US customers. So there's different date formats involved. When I bind a date attribute to a textview element Web Dynpro formats it for me automatically. If the language setting in the browser are US, it formats it using this pattern (as specified by SimpleDateFormat) "M/d/yyyy". If I switch to en_AU, then it uses format "d/MM/yyyy". Now these patterns don't seem to be the default ones that you can get by calling java.text.DateFormat.getDateInstance(). I was wondering if there is any way to retrieve the date format pattern that Web Dynpro is using by default (and that is locale specific) so that I can use it elsewhere.
Thanks,
Martin

Similar Messages

  • How to display data in inputfields whenuser entersdata inanother inputfield

    Hi all,
    i have a requirement that i have three fileds named
    1)costcentre , 2)description 3)function.
    when user enters value on cost centre description and function should be displayed.?
    can u tell me how to acheive this functionality.? and kindly for reference can u send me the logic in step by step.?
    can u tell me should i use inputfield ui elements for these . and beside inputfields i should provide a searchhelp icon. ?
    kindly send me the how to achieve this functionality.
    Thanks & Regards,
    Naveen

    hi naveen,
    my first suggestion is that please check se11 and check whether /BIC/AGLDCPRTS00
    is a transp. table ......i guess it is not so. rite?
    now,
    you make a node first in the context....add attribute to this node now add attribute to it ....
    once you start adding the attribute a pop up screen comes...here you are making a mistake by choosing type ref to...instead use type....in the type assignment field and in type define the data type.......
    also look here you will find field for search help...in input help mode choose dictionary help and enter the name of search help you want to provide....
    now regarding the code
    write this code onEnter method of thefirst  input field....._also note that my node name is node....ERNAM LAEDA  AENAM are my attributes in the node_ you will read the first attribute by code wwizard ...
    DATA LO_ND_NODE TYPE REF TO IF_WD_CONTEXT_NODE.
        DATA LO_EL_NODE TYPE REF TO IF_WD_CONTEXT_ELEMENT.
        DATA LS_NODE TYPE WD_THIS->ELEMENT_NODE.
        DATA LV_ERNAM TYPE WD_THIS->ELEMENT_NODE-ERNAM.
    *   navigate from <CONTEXT> to <NODE> via lead selection
        LO_ND_NODE = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_NODE ).
    *   get element via lead selection
        LO_EL_NODE = LO_ND_NODE->GET_ELEMENT( ).
    *   @TODO handle not set lead selection
        IF LO_EL_NODE IS INITIAL.
        ENDIF.
    *   get single attribute
        LO_EL_NODE->GET_ATTRIBUTE(
          EXPORTING
            NAME =  `ERNAM`
          IMPORTING
            VALUE = LV_ERNAM ).
    now you will get the value entered in first input field and
    DATA LS_NODE TYPE WD_THIS->ELEMENT_NODE.
          DATA LV_LAEDA TYPE WD_THIS->ELEMENT_NODE-LAEDA.
    *     navigate from <CONTEXT> to <NODE> via lead selection
          LO_ND_NODE = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_NODE ).
    *     @TODO handle non existant child
    *     IF lo_nd_node IS INITIAL.
    *     ENDIF.
    *     get element via lead selection
          LO_EL_NODE = LO_ND_NODE->GET_ELEMENT( ).
    *     @TODO handle not set lead selection
          IF LO_EL_NODE IS INITIAL.
          ENDIF.
    *     @TODO fill attribute
    *     lv_laeda = 1. "  "you will set the value for second field here......either hardcode it or use logic
    *     set single attribute
          LO_EL_NODE->SET_ATTRIBUTE(
            NAME =  `LAEDA`
            VALUE = LV_LAEDA ).
            DATA LS_NODE TYPE WD_THIS->ELEMENT_NODE.
            DATA LV_AENAM TYPE WD_THIS->ELEMENT_NODE-AENAM.
    *       navigate from <CONTEXT> to <NODE> via lead selection
            LO_ND_NODE = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_NODE ).
    *       @TODO handle non existant child
    *       IF lo_nd_node IS INITIAL.
    *       ENDIF.
    *       get element via lead selection
            LO_EL_NODE = LO_ND_NODE->GET_ELEMENT( ).
    *       @TODO handle not set lead selection
            IF LO_EL_NODE IS INITIAL.
            ENDIF.
    *       @TODO fill attribute
           lv_aenam = 1. "you will set the value for third field here......either hardcode ity or use logic
    *       set single attribute
            LO_EL_NODE->SET_ATTRIBUTE(
              NAME =  `AENAM`
              VALUE = LV_AENAM ).
    thanks and regards,
    sahai.s

  • How to fill data to inputfield?

    Hi,
    I have 2 inputfield, which get from the dictionary at Graphical Screen Painter. eg. Name and Contact Number.
    The Name have Search help function, which allow me to choose the value for the Name inputfield without manually input. I need to populate the contact number base on the value selected in the search help. How do i go about it?
    Regards,
    Rayden

    Hi ..
    Check this Code .. it should help.
    Change the Same code as per Module pool.
    ***Function modules related to Search Helps In POV event..
    F4IF_INT_TABLE_VALUE_REQUEST
    F4IF_FIELD_VALUE_REQUEST
    F4UT_PARAMETER_VALUE_GET
    F4UT_PARAMETER_RESULTS_PUT
    F4IF_SHLP_EXIT_EXAMPLE.
    How to Generate F4 Help in Screens POV
    REPORT zsel_f4help .
    *---Report with selection screen and to display the list of
    possible entries for field 'B' as per the value in field 'A'.
    PARAMETERS: p_vbeln TYPE vbak-vbeln,
    p_posnr TYPE vbap-posnr.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_posnr.
    DATA: BEGIN OF help_item OCCURS 0,
    posnr TYPE vbap-posnr,
    matnr TYPE vbap-matnr,
    arktx TYPE vbap-arktx,
    END OF help_item.
    DATA: dynfields TYPE TABLE OF dynpread WITH HEADER LINE.
    dynfields-fieldname = 'P_VBELN'.
    APPEND dynfields.
    **Read the Values of the SCREEN FIELDs
    CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
    dyname = sy-cprog
    dynumb = sy-dynnr
    translate_to_upper = 'X'
    TABLES
    dynpfields = dynfields
    EXCEPTIONS
    invalid_abapworkarea = 1
    invalid_dynprofield = 2
    invalid_dynproname = 3
    invalid_dynpronummer = 4
    invalid_request = 5
    no_fielddescription = 6
    invalid_parameter = 7
    undefind_error = 8
    double_conversion = 9
    stepl_not_found = 10
    OTHERS = 11.
    **Find out the Value of P_VBELN
    READ TABLE dynfields WITH KEY fieldname = 'P_VBELN'.
    p_vbeln = dynfields-fieldvalue.
    **Convert the Value into internal format
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = p_vbeln
    IMPORTING
    output = p_vbeln.
    **Fetch the correponding itemnos from VBAP
    SELECT posnr matnr arktx INTO TABLE help_item
    FROM vbap
    WHERE vbeln = p_vbeln.
    **Generate the F4 help with internal table values
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    retfield = 'POSNR'
    dynprofield = 'P_POSNR'
    dynpprog = sy-cprog
    dynpnr = sy-dynnr
    value_org = 'S'
    TABLES
    value_tab = help_item.
    reward if Helpful.

  • Javascript Error in InputField Date Type

    Hi,
    We have migrated the Enterprise Portal Application EP5SP6 to NW2004s SP6.Everything works fine except one issue in a Manager Reports, Where we are using Date type InputField.
    Code used:
    <hbj:inputField
    id="otherdate1"
    type="DATE"
    showHelp="TRUE"
    size="10"
    maxlength="10"
    jsObjectNeeded="true"
    disabled="TRUE"
    >
    <%
    JSP-scriptlet-START----
    otherPeriodFrom=myContext.getParamIdForComponent(otherdate1);
    JSP-scriptlet-END----
    %>
    </hbj:inputField>
    Javascript Error : Line : 3958 code: 2 Error: 'Undefined' is null or not an object
    Above Error appears when the below option in IE is selected.And also, Error appears only when the user enters the date.Also, I cannot ask users to uncheck the settings in IE as most of the users doesn't have administrator access to their amchines
    Error doesn't seem to appear when user selects the date from DataPicker component irrespective whether the below option in IE is selected or not.
    IE Setting option :
    Display a Notification about Every Script Error
    I'm not able to find what could be the problem in EP 7.0 as it works perfectly in EP5.0.
    Any ideas would be appreciated !!
    Thanks,
    Jojo

    Sent an OSS message to SAP.SAP found the problem and fixed the issue and will be available in NW2004s SPS9.
    Jojo

  • Synchronize InputFields with DateNavigators First and Last Selected Dates

    Hello,
    I have two InputFields (StartDateInputField and EndDateInputField) which are bounded to context attributes (StartDate and EndDate) of type Date. There is also a DateNavigator, whose firstSelectedDate and lastSelectedDate properties are also bounded to those context attributes.
    Whenever I select dates in DateNavigator then those dates are visible automatically in InputFields, but, on the other hand when I select dates in InputFields, the changes are not visible in DateNavigator.
    I thought its sufficient to bind these controls to the same context attributes, but apparently its not working.
    Is there a way to accomplish this?
    Best regards,
    Ladislav Pomezny

    Hi Ladislav,
    Define onEnter action for InputField UI element (action handler implementation can be with empty body). But, in this case synchronization will be done only when you type smth in InputFiled and after press Enter. No other way to fire event from InputField.
    Best regards, Maksim Rashchynski.

  • Inputfield Date Help

    hi all,
    i have a requirement in which i have declared a inputfiled type date and getting this field filled through pop up help using the below code.
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <htmlb:content design="design2003" >
      <htmlb:page title=" " >
        <htmlb:form>
          <htmlb:label for     = "HDATE"
                       text    = "From Date"
                       tooltip = "Enter from date" />
          <htmlb:inputField id       = "HDATE"
                            value    = "<%= sy-datum %>"
                            showHelp = "X"
                            type     = "date"
                            disabled = "FALSE" />
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    now  i wanted to execute an additional function when the help button is clicked so i declared it in as
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <htmlb:content design="design2003" >
      <htmlb:page title=" " >
        <htmlb:form>
          <htmlb:label for     = "HDATE"
                       text    = "From Date"
                       tooltip = "Enter from date" />
          <htmlb:inputField id       = "HDATE"
                            value    = "<%= sy-datum %>"
                            showHelp = "X"
                        onValueHelp = "sapHelpDate('HDATE', parameters);function();"
                            type     = "date"
                            disabled = "FALSE" />
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    The function sapHelpDate is the default function which is called when onValueHelp is not mentioned.
    Could anyone please throw some light on this function?
    by doing the above i am able to execute my separate function along with the pop up coming for the date,but the icon for the date help is changed and i am not able to show it same as in default case.
    could any one help me with this.
    thanks in Advance
    regards,
    Arvind.

    used BSP replace and find to replace the class and the icon was same as before

  • Can i have html code for date select options (SEARCH HELP)

    Hi frinds,
    I have a BSP Page with input as date.
    Can i have html code for date select options (SEARCH HELP)
    Moosa

    Hi
    Please find the sample code below.
    FROM DATE
          <htmlb:inputField id        = "dd"
                            width     = "45%"
                            type      = "DATE"
                            showHelp  = "X" <- Search help
                            alignment = "CENTER"
                            maxlength = "10"
                            disabled  = "TRUE"
                            value     = "<%= w_FROMDATE %>" />
    TO DATE
          <htmlb:inputField id        = "dd"
                            width     = "45%"
                            type      = "DATE"
                            showHelp  = "X"
                            alignment = "CENTER"
                            maxlength = "10"
                            disabled  = "TRUE"                      
    value     = "<%= w_TODATE %>" />
    Thanks
    kalyan

  • How to set the default date behavior

    Hi,
    I am using type date in inputfield.In F4 help i am getting thecalender.Now my calender is behaving based on the SAP user date settings.How can i override the user setting date to my F4 calender.Is there any options to specify the date format as mm/dd/yyyy to calender attributes.
      Regards
      USman

    USman,
        Have you tried converting the date to your mm/dd/yyyy format before it is
    sent back to the screen?
    HTML:
    <htmlb:inputField id       = "startDate"
                type           = "date"
                required       = "false"
                size           = "7"
                maxlength      = "10"
                firstDayOfWeek = "0"
                showHelp       = "X"
                value          = "<%= model-sdate %>" />
    DO_HANDLE_EVENT:
    inputfield ?= CL_HTMLB_MANAGER=>GET_DATA(
            request = runtime->server->request
            name    = 'inputfield'
            id      = 'startDate' ).
        IF inputfield->value IS NOT INITIAL.
          call method model->convert_to_sap_date
            EXPORTING
              in_date  = inputfield->value
            IMPORTING
              out_date = model->sdate.
            IF model->sdate IS INITIAL.
               me->messages->add_message(
                   condition = 'start'
                   message   = 'Start Date is invalid'
                   severity  = me->messages->CO_SEVERITY_ERROR ).
            ENDIF.
        ELSE.
          me->messages->add_message(
               condition = 'start'
               message   = 'Start Date is required'
               severity  = me->messages->CO_SEVERITY_ERROR ).
        ENDIF.
    method CONVERT_TO_SAP_DATE .
      CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
        EXPORTING
          DATE_EXTERNAL            = in_date
        IMPORTING
          DATE_INTERNAL            = out_date
        EXCEPTIONS
          DATE_EXTERNAL_IS_INVALID = 1
          OTHERS                   = 2.
    endmethod.

  • Input Field Date Problem in EP7.0

    Hi,
    We have migrated the Enterprise Portal Application EP5SP6 to NW2004s SP6.Everything works fine except one issue in a Manager Reports, Where we are using Date type InputField.
    Code used:
               <hbj:inputField
           id="otherdate1"
           type="DATE"
           showHelp="TRUE"
           size="10"
           maxlength="10"
           jsObjectNeeded="true"
           disabled="TRUE"
      >
    <%
    JSP-scriptlet-START----
      otherPeriodFrom=myContext.getParamIdForComponent(otherdate1);
    JSP-scriptlet-END----
    %>
      </hbj:inputField>
    <b>Javascript Error : Line : 3958 code: 2 Error: 'Undefined' is null or not an object</b>
    Above Error appears when the below option in IE is selected.And also, Error appears only when the user enters the date.
    Error doesn't seem to appear when user selects the date from DataPicker component irrespective whether the below option in IE is selected or not.
    <b>IE Setting option : 
    Display a Notification about Every Script Error</b>
    I'm not able to find what could be the problem in EP 7.0 as it works perfectly in EP5.0.
    Any ideas would be appreciated !!
    Thanks,
    Jojo

    Hello,
    Interesting to see the migration from EP5 to EP7 went well (except one issue).
    Would it be possible to share thoughts on how you did the migration? Migration tools used? Lessons learned? ...
    Thanks in advance
    Best regards
    Stephie
    Message was edited by: deman Stephie

  • Can we do input field readonly and it will takes data only from F4

    Hi  experts,
    I want user only fill data in inputfield by F4, not manualy , can we do somwthing for that.
    Thanks & Regards
    Prashant Gupta

    Hi Prashanth,
       We can handle your requirement. I will give one example and it is working.   
        Address -  Node
         Firtst_Name-    Node  attribute    and this attribute will have DDIC search help.
       Create Input field 'FIRSTNAME' for this attribute in screen with transparent container  'TC' and bind the above context to the UI element.  Now this UI element is Context is 'ADDRESS.FIRSTNAME'.
    Now add the below code in MODIFYVIEW hook method.The below code will add search help with read only input field but for display mode again you have to disable the search help for this field. i have not written code for that.
      DATA: lo_first_name       TYPE REF TO cl_wd_input_field,
            lo_first_name_new   TYPE REF TO cl_wd_input_field,         " New input field
            lo_transp_cont      TYPE REF TO cl_wd_transparent_container. " TC container
            lo_new_container    TYPE REF TO cl_wd_transparent_container.
      DATA: lv_bound_value      TYPE string,
            lv_read_only        TYPE wdy_boolean.
       IF iv_first_time EQ abap_true.
    lo_first_name_input ?= io_view->get_element( id = 'FIRST_NAME' ).
    lo_first_name_input->set_width( '0' ).
    lv_bound_value = lo_first_name_input->bound_value( ).  "ADDRESS.FIRST_NAME"
        Create new dynamic Input Field
          CALL METHOD cl_wd_input_field=>new_input_field
            EXPORTING
              bind_value = lv_bound_value     
              id         = 'FIRST_NAME_NEW'
              read_only  = abap_true
              view       = io_view
            RECEIVING
              control    = lo_first_name_new.
        Create new dynamic Transparent Container
          CALL METHOD cl_wd_transparent_container=>new_transparent_container
            EXPORTING
              id      = 'TC_NEW'    " New container
              view    = io_view
            RECEIVING
              control = lo_new_container.
          " I used flow layout thats why i am using the flow layout
          cl_wd_flow_layout=>new_flow_layout( container = lo_new_container ).
          cl_wd_matrix_data=>new_matrix_data( element = lo_new_container ).
      " Get old field container
       lo_transp_cont ?= io_view->get_element( id = 'TC' ). 
       IF NOT lo_transp_cont IS INITIAL.
        "Using a new Transparent Container both Fields for FIRST_NAME are shown as only one Field
            cl_wd_flow_data=>new_flow_data( element     = lo_first_name_new ).
            lo_new_container->add_child( the_child = lo_first_name_new ).
            " remove the child means old FIRT_NAME
            lo_first_name ?= lo_transp_cont->remove_child( id = 'FIRST_NAME' ).
            cl_wd_flow_data=>new_flow_data( element = lo_first_name ).
            lo_new_container->add_child( the_child = lo_first_name ).
          lo_transp_cont->add_child( index      = 2
                                     the_child  = lo_new_container ).
       ENDIF.
    endif.
    Regards,
    Devi

  • Web dynpro  passing data

    Good day all,
    I have create a window with multiple views. On allows me to select a material number and the second is suppose to display the data in a textview.
    They are bound with the navigation links. How do I get the second view to only display the information of the number selected?

    Martin is right,
    Any data context node on the next view should also be mapped to the component controller, so when you are changing views you just have to use your material number to invoke the method of the component controller that gets your detailed data, its as easy as this:
    before you fire you plug you can use the following:
    wd_comp_controller->get_material_details( matnr = lv_matnr ).
    Inside your component controller you should have a method called "get_material_details" and an importing parameter called matnr.
    once the logic is run to get the details, bind your data to the component controllers Material details context node, this node should also be mapped to the view of the second screen.
    So now when the second view opens the data will magically be there
    Good luck,
    Shaunny B

  • WD4A: F4 help on InputField, auto description to be populated!!

    Hi Experts,
       I have a VIEW with UI elemnt InputField & TextView. InputField we enter customer-code and on the event ENTER, fetch the customer description  populate them on TextView.
    I enabled F4 help on the InputField, we select a CODE here and Copy it to the InputFIeld, for description to be displayed i HAVE to HIT enter AGAIn on this input field( Which customer hates ).
    How can i populate the customer description automatically after i select customer code in F4 help????
    Any Event i can catch??

    Well you can't really directly hook into the standard DDic Value Help event. You would have to change to a Programmed Search Help to have that level of control.  But that is probably more work than necessary.
    Note: I've never tested this approach.  You will have to give it a try and see if the order of event handling will work:
    Instead consider moving your logic from the onEnter to WDDOMODIFYVIEW.  This way it will be executed for any event.  Leave the onEnter event handler, just with no logic in it so that it still triggers a round trip event.  In the WDDOMODIFYVIEW, just check to see if the value in context attribute bound to the input field has changed, if so fire the logic to populate the name into the other field.  That way any server side event (include the F4) will trigger the logic.

  • Strategy for implementing drpdownlistbykey in header / detail relationship

    Quite often I have header details relationships that I want to display.  The volumes of data are typically small, so rather than make multiple trips to the database I choose to load all the data into context during the init routine.  Implementing an efficient way to dispay this data and keep the header details relationship syncronized on the screen is where I am looking for suggestions.
    A good example would be selecting a user from a list and displaying details of that user in a series of text views.
    Currently to implement this, I load all the user detail into separate elements within a node. Simultaniously I load a value set with key information which is then used by a drop down list.   A series of text views are bound to attributes in the context outside the detail node.  These attributes contain the currently selected user detail information.  When a user is selected from the drop down list, the select event fires, and a search is performed of all the detail node elements for that key.  Once found, the user detail information is copied from the appropriate element to the corresponding 'current value' attributes.
    This process seems a bit cumbersome to me.  I am wondering if there are more efficient ways to manage this routine scenario.  Possibly there is a way of binding the text views directly to the attributes in the detail node and switching the element that is currently displayed?  I am just not aware of any way to do that.
    Any suggestions would be greatly appreciated
    -Sheldon

    Say you have a context node "Users", cardinality 0:N, with attributes like "Name" etc.
    Use a DropDown<b>ByIndex</b> element, bind property "texts" to attribute "Name". Assign an empty action to the "onSelect" event.
    Create a form for the details, bind the contained InputField, TextView, whatever to the attributes inside node "Users".
    Then you can select a user from the dropdown list (which displays the user names) and the detail form automatically displays the data of the (lead-)selected context element.
    Armin

  • Prblm in HTMLB..onClientClick Eventing..Please help..urgent :|

    Hello All,
    I have 2 jsp files named:
    1> <b>NewOrder.jsp</b> -> This file uses HTMLB Taglib style. includes form and set its layout to gridlayout. It further includes/calls another jsp called "i1_NewOrder.jsp"
    2> <b>i1_NewOrder.j</b>sp -> This includes all the GUI elements like inputfield, textview, etc. This forms a TableView.
    <u>Question</u>:
    I have added a button in i1_NewOrder.jsp and have fired an event using <b>AddLine.setOnClientClick("javascript:AddLines()");</b>
    Now, an alert is being executed (refer to the code below), which has been written in NewOrder.jsp file.
    <i><b>What I want is that when I click on this button (say "AddNewLine"), a new row should be added in the TableView that is being built up using i1_NewOrder.jsp file.</b></i>
    <i><b>How can I get a reference of TableView from i1_NewOrder.jsp to NewOrder.jsp</b></i>??
    If you se the code, I have tried to do this, but failed
    <u>Code</u>:
    1> <u>NewOrder.jsp</u>
    <%@ taglib uri="tagLib" prefix="hbj" %>
    <%@ page import="com.sapportals.htmlb.*" %>
    <%@ page import="com.sapportals.htmlb.enum.*" %>
    <%@ page import="com.sapportals.htmlb.table.*" %>
    /*<script language="JavaScript">
    function AddLines()
    {     var rowcnt;
         alert("Hi");
         rowcnt = tvOrderDetails.getRowCount();
         document.write(rowcnt);
         rowcnt++;     
    </script> */
    <jsp:useBean id="beanOrderDetails" scope="session" class="com.sap.NewOrderAssignment.BeanOrderDetails" />
    <hbj:content
         id="contextNewOrder">
         <hbj:page
              title="New Order">
              <hbj:form
                   id="formNewOrder">
                   <hbj:gridLayout
                        id="gridNewOrder"
                        debugMode="False"
                        width="100%"
                        cellSpacing="2">
                        <%@ include file="i1_NewOrder.jsp"%>
                   </hbj:gridLayout>
              </hbj:form>
         </hbj:page>
    </hbj:content>
    2> i1_NewOrder.jsp
    <%
    //****** define the cells **********//
    GridLayoutCell cellEmpty = new GridLayoutCell(" ");
    GridLayoutCell cellLabelEmpty = new GridLayoutCell(" ");
    GridLayoutCell cellGeneralOrderInfo = new GridLayoutCell(" ");
    GridLayoutCell cellDetailsOrderInfo = new GridLayoutCell(" ");
    GridLayoutCell cellLabelYourOrderNo = new GridLayoutCell(" ");
    GridLayoutCell cellLabelCustomer = new GridLayoutCell(" ");
    GridLayoutCell cellLabelOrderDate = new GridLayoutCell(" ");
    GridLayoutCell cellLabelAddress = new GridLayoutCell(" ");
    cellLabelAddress.setVAlignment(CellVAlign.TOP);
    GridLayoutCell cellLabelRequestedDelDate = new GridLayoutCell(" ");
    GridLayoutCell cellLabelCompletedelivery = new GridLayoutCell(" ");
    GridLayoutCell cellLabelGIM = new GridLayoutCell(" ");
    GridLayoutCell cellLabelDeliveryAddress = new GridLayoutCell(" ");
    GridLayoutCell cellInputYourOrderNo = new GridLayoutCell(" ");
    GridLayoutCell cellinputRequestedDelDate = new GridLayoutCell(" ");
    GridLayoutCell cellTvCustomer = new GridLayoutCell(" ");
    GridLayoutCell cellTvOrderDate = new GridLayoutCell(" ");
    GridLayoutCell cellTvAddress = new GridLayoutCell(" ");
    GridLayoutCell cellTvDeliveryAddress = new GridLayoutCell(" ");
    GridLayoutCell cellCBCompleteDelivery = new GridLayoutCell(" ");
    GridLayoutCell cellCBGIM = new GridLayoutCell(" ");
    GridLayoutCell cellTVOrderLines = new GridLayoutCell(" ");
    GridLayoutCell cellButtonAddLine = new GridLayoutCell(" ");
    //****** define design values for cells **********//
    // Design values for labels
    //****** define the visible gui elements and assign to the cell **********//
    //order details
    TableView tvOrderDetails = new TableView("tvOrderDetails");
    tvOrderDetails.setModel(beanOrderDetails.getOrderLines());
    tvOrderDetails.setSelectionMode(TableSelectionMode.MULTISELECT);
    cellTVOrderLines.setColSpan(6);
    cellTVOrderLines.setContent(tvOrderDetails);
    //General order info: header>
    TextView tvGeneralOrderInfo = new TextView("General Order Information");
    cellGeneralOrderInfo.setColSpan(6);
    cellGeneralOrderInfo.setContent(tvGeneralOrderInfo);
    //General order details>
    TextView tvDetailsOrderInfo = new TextView("Order details");
    cellDetailsOrderInfo.setColSpan(6);
    cellDetailsOrderInfo.setContent(tvDetailsOrderInfo);
    //label Your order number
    TextView labelYourOrderNo = new TextView("Your order number");
    cellLabelYourOrderNo.setWidth("150");
    cellLabelYourOrderNo.setContent(labelYourOrderNo);
    //Input Your order number
    InputField inputYourOrderNo = new InputField("InputYourOrderNo");
    cellInputYourOrderNo.setWidth("200");
    cellInputYourOrderNo.setContent(inputYourOrderNo);
    //label Customer
    TextView labelCustomer = new TextView("Customer");
    cellLabelCustomer.setWidth("150");
    cellLabelCustomer.setContent(labelCustomer);
    //Textview customer
    TextView tvCustomer = new TextView("tvCustomer");
    cellTvCustomer.setContent(tvCustomer);
    //label Order date
    TextView labelOrderDate = new TextView("Order Date");
    cellLabelOrderDate.setContent(labelOrderDate);
    //Text view order date
    TextView tvOrderDate = new TextView("tvOrderDate");
    cellTvOrderDate.setContent(tvOrderDate);
    //last check
    //Label address
    TextView labelAddres = new TextView("Address");
    cellLabelAddress.setContent(labelAddres);
    //text view address
    TextView tvAddress = new TextView("Tjaskerlaan");
    cellTvAddress.setContent(tvAddress);
    //Label Requested delivery date
    TextView labelRequestedDelDate = new TextView("Requested Delivery Date");
    cellLabelRequestedDelDate.setContent(labelRequestedDelDate);
    //Label Complete delivery
    TextView labelCompleteDelivery = new TextView("Completed Date");
    cellLabelCompletedelivery.setContent(labelCompleteDelivery);
    //Checkbox Complete delivery
    Checkbox cbCompleteDelivery = new Checkbox("cbCompleteDelivery");
    cellCBCompleteDelivery.setContent(cbCompleteDelivery);
    //Label Complete GIM
    TextView labelGIM = new TextView("GIM");
    cellLabelGIM.setContent(labelGIM);
    //Checkbox GIM
    Checkbox cbGIM = new Checkbox("cbGIM");
    cellCBGIM.setContent(cbGIM);
    //Label delivery address
    TextView labelDeliveryAddres = new TextView("Delivery Address");
    cellLabelDeliveryAddress.setContent(labelDeliveryAddres);
    //text view address
    TextView tvDeliveryAddress = new TextView("Tjaskerlaan");
    cellTvDeliveryAddress.setContent(tvDeliveryAddress);
    // listbox delivery addresses
    ListBox lbDeliveryAddress = new ListBox("lbDeliveryAddress");
    cellTvDeliveryAddress.setContent(lbDeliveryAddress);
    Button AddLine = new Button("AddLine","Add New Line");
    cellButtonAddLine.setContent(AddLine);
    //AddLine.disabled=true;
    <b>AddLine.setOnClientClick("javascript:AddLines()");</b>
    //****** add cells to grid **********//
    gridNewOrder.addCell(1, 1, cellGeneralOrderInfo);
    gridNewOrder.addCell(2, 1, cellLabelYourOrderNo);
    gridNewOrder.addCell(2, 2, cellInputYourOrderNo);
    //gridNewOrder.addCell(2, 3, cellEmpty);
    gridNewOrder.addCell(2, 4, cellLabelCustomer);
    gridNewOrder.addCell(2, 5, cellInputYourOrderNo);
    gridNewOrder.addCell(2, 6, cellEmpty);
    gridNewOrder.addCell(3, 1, cellLabelOrderDate);
    gridNewOrder.addCell(3, 2, cellTvOrderDate);
    //gridNewOrder.addCell(3, 3, cellEmpty);
    gridNewOrder.addCell(3, 4, cellLabelAddress);
    gridNewOrder.addCell(3, 5, cellInputYourOrderNo);
    gridNewOrder.addCell(4, 1, cellLabelRequestedDelDate);
    gridNewOrder.addCell(4, 2, cellInputYourOrderNo);
    //gridNewOrder.addCell(4, 3, cellEmpty);
    gridNewOrder.addCell(4, 4, cellLabelEmpty);
    gridNewOrder.addCell(4, 5, cellInputYourOrderNo);
    gridNewOrder.addCell(5, 1, cellLabelCompletedelivery);
    gridNewOrder.addCell(5, 2, cellCBGIM);
    //gridNewOrder.addCell(5, 3, cellEmpty);
    gridNewOrder.addCell(5, 4, cellLabelDeliveryAddress);
    gridNewOrder.addCell(5, 5, cellTvDeliveryAddress);
    gridNewOrder.addCell(6, 1, cellLabelGIM);
    gridNewOrder.addCell(6, 2, cellCBGIM);
    gridNewOrder.addCell(6, 3, cellEmpty);
    gridNewOrder.addCell(6, 4, cellLabelEmpty);
    gridNewOrder.addCell(7, 4, cellLabelEmpty);
    gridNewOrder.addCell(6, 6, cellEmpty);
    gridNewOrder.addCell(8, 1, cellEmpty);
    gridNewOrder.addCell(9, 1,cellDetailsOrderInfo);
    gridNewOrder.addCell(10, 1,cellTVOrderLines);
    gridNewOrder.addCell(11,1,cellButtonAddLine);
    %>

    Hi Ritu,
             First up all I don't see any code where exactly you have added a button in the table.
             Secondly as a general thing,looking on to ur scenario you have initialize the table on the event of clicking the button ie)in ur getNewRow() just initialize your code for building an empty row of the table.
    Regards,
    guru

  • Problem in HTMLB..setOnClientClick()..Urgent Help....:)

    Hello All,
    I have 2 jsp files named:
    1> NewOrder.jsp -> This file uses HTMLB Taglib style. includes form and set its layout to gridlayout. It further includes/calls another jsp called "i1_NewOrder.jsp"
    2> i1_NewOrder.jsp -> This includes all the GUI elements like inputfield, textview, etc. This forms a TableView.
    Question:
    I have added a button in i1_NewOrder.jsp and have fired an event using AddLine.setOnClientClick("javascript:AddLines()");
    Now, an alert is being executed (refer to the code below), which has been written in NewOrder.jsp file.
    What I want is that when I click on this button (say "AddNewLine"), a new row should be added in the TableView that is being built up using i1_NewOrder.jsp file.
    How can I get a reference of TableView from i1_NewOrder.jsp to NewOrder.jsp??
    If you se the code, I have tried to do this, but failed
    Code:
    1> NewOrder.jsp
    <%@ taglib uri="tagLib" prefix="hbj" %>
    <%@ page import="com.sapportals.htmlb.*" %>
    <%@ page import="com.sapportals.htmlb.enum.*" %>
    <%@ page import="com.sapportals.htmlb.table.*" %>
    /*<script language="JavaScript">
    function AddLines()
    { var rowcnt;
    alert("Hi");
    rowcnt = tvOrderDetails.getRowCount();
    document.write(rowcnt);
    rowcnt++;
    </script> */
    <jsp:useBean id="beanOrderDetails" scope="session" class="com.sap.NewOrderAssignment.BeanOrderDetails" />
    <hbj:content
    id="contextNewOrder">
    <hbj:page
    title="New Order">
    <hbj:form
    id="formNewOrder">
    <hbj:gridLayout
    id="gridNewOrder"
    debugMode="False"
    width="100%"
    cellSpacing="2">
    <%@ include file="i1_NewOrder.jsp"%>
    </hbj:gridLayout>
    </hbj:form>
    </hbj:page>
    </hbj:content>
    2> i1_NewOrder.jsp
    <%
    //****** define the cells **********//
    GridLayoutCell cellEmpty = new GridLayoutCell(" ");
    GridLayoutCell cellLabelEmpty = new GridLayoutCell(" ");
    GridLayoutCell cellGeneralOrderInfo = new GridLayoutCell(" ");
    GridLayoutCell cellDetailsOrderInfo = new GridLayoutCell(" ");
    GridLayoutCell cellLabelYourOrderNo = new GridLayoutCell(" ");
    GridLayoutCell cellLabelCustomer = new GridLayoutCell(" ");
    GridLayoutCell cellLabelOrderDate = new GridLayoutCell(" ");
    GridLayoutCell cellLabelAddress = new GridLayoutCell(" ");
    cellLabelAddress.setVAlignment(CellVAlign.TOP);
    GridLayoutCell cellLabelRequestedDelDate = new GridLayoutCell(" ");
    GridLayoutCell cellLabelCompletedelivery = new GridLayoutCell(" ");
    GridLayoutCell cellLabelGIM = new GridLayoutCell(" ");
    GridLayoutCell cellLabelDeliveryAddress = new GridLayoutCell(" ");
    GridLayoutCell cellInputYourOrderNo = new GridLayoutCell(" ");
    GridLayoutCell cellinputRequestedDelDate = new GridLayoutCell(" ");
    GridLayoutCell cellTvCustomer = new GridLayoutCell(" ");
    GridLayoutCell cellTvOrderDate = new GridLayoutCell(" ");
    GridLayoutCell cellTvAddress = new GridLayoutCell(" ");
    GridLayoutCell cellTvDeliveryAddress = new GridLayoutCell(" ");
    GridLayoutCell cellCBCompleteDelivery = new GridLayoutCell(" ");
    GridLayoutCell cellCBGIM = new GridLayoutCell(" ");
    GridLayoutCell cellTVOrderLines = new GridLayoutCell(" ");
    GridLayoutCell cellButtonAddLine = new GridLayoutCell(" ");
    //****** define design values for cells **********//
    // Design values for labels
    //****** define the visible gui elements and assign to the cell **********//
    //order details
    TableView tvOrderDetails = new TableView("tvOrderDetails");
    tvOrderDetails.setModel(beanOrderDetails.getOrderLines());
    tvOrderDetails.setSelectionMode(TableSelectionMode.MULTISELECT);
    cellTVOrderLines.setColSpan(6);
    cellTVOrderLines.setContent(tvOrderDetails);
    //General order info: header>
    TextView tvGeneralOrderInfo = new TextView("General Order Information");
    cellGeneralOrderInfo.setColSpan(6);
    cellGeneralOrderInfo.setContent(tvGeneralOrderInfo);
    //General order details>
    TextView tvDetailsOrderInfo = new TextView("Order details");
    cellDetailsOrderInfo.setColSpan(6);
    cellDetailsOrderInfo.setContent(tvDetailsOrderInfo);
    //label Your order number
    TextView labelYourOrderNo = new TextView("Your order number");
    cellLabelYourOrderNo.setWidth("150");
    cellLabelYourOrderNo.setContent(labelYourOrderNo);
    //Input Your order number
    InputField inputYourOrderNo = new InputField("InputYourOrderNo");
    cellInputYourOrderNo.setWidth("200");
    cellInputYourOrderNo.setContent(inputYourOrderNo);
    //label Customer
    TextView labelCustomer = new TextView("Customer");
    cellLabelCustomer.setWidth("150");
    cellLabelCustomer.setContent(labelCustomer);
    //Textview customer
    TextView tvCustomer = new TextView("tvCustomer");
    cellTvCustomer.setContent(tvCustomer);
    //label Order date
    TextView labelOrderDate = new TextView("Order Date");
    cellLabelOrderDate.setContent(labelOrderDate);
    //Text view order date
    TextView tvOrderDate = new TextView("tvOrderDate");
    cellTvOrderDate.setContent(tvOrderDate);
    //last check
    //Label address
    TextView labelAddres = new TextView("Address");
    cellLabelAddress.setContent(labelAddres);
    //text view address
    TextView tvAddress = new TextView("Tjaskerlaan");
    cellTvAddress.setContent(tvAddress);
    //Label Requested delivery date
    TextView labelRequestedDelDate = new TextView("Requested Delivery Date");
    cellLabelRequestedDelDate.setContent(labelRequestedDelDate);
    //Label Complete delivery
    TextView labelCompleteDelivery = new TextView("Completed Date");
    cellLabelCompletedelivery.setContent(labelCompleteDelivery);
    //Checkbox Complete delivery
    Checkbox cbCompleteDelivery = new Checkbox("cbCompleteDelivery");
    cellCBCompleteDelivery.setContent(cbCompleteDelivery);
    //Label Complete GIM
    TextView labelGIM = new TextView("GIM");
    cellLabelGIM.setContent(labelGIM);
    //Checkbox GIM
    Checkbox cbGIM = new Checkbox("cbGIM");
    cellCBGIM.setContent(cbGIM);
    //Label delivery address
    TextView labelDeliveryAddres = new TextView("Delivery Address");
    cellLabelDeliveryAddress.setContent(labelDeliveryAddres);
    //text view address
    TextView tvDeliveryAddress = new TextView("Tjaskerlaan");
    cellTvDeliveryAddress.setContent(tvDeliveryAddress);
    // listbox delivery addresses
    ListBox lbDeliveryAddress = new ListBox("lbDeliveryAddress");
    cellTvDeliveryAddress.setContent(lbDeliveryAddress);
    Button AddLine = new Button("AddLine","Add New Line");
    cellButtonAddLine.setContent(AddLine);
    //AddLine.disabled=true;
    AddLine.setOnClientClick("javascript:AddLines()");
    //****** add cells to grid **********//
    gridNewOrder.addCell(1, 1, cellGeneralOrderInfo);
    gridNewOrder.addCell(2, 1, cellLabelYourOrderNo);
    gridNewOrder.addCell(2, 2, cellInputYourOrderNo);
    //gridNewOrder.addCell(2, 3, cellEmpty);
    gridNewOrder.addCell(2, 4, cellLabelCustomer);
    gridNewOrder.addCell(2, 5, cellInputYourOrderNo);
    gridNewOrder.addCell(2, 6, cellEmpty);
    gridNewOrder.addCell(3, 1, cellLabelOrderDate);
    gridNewOrder.addCell(3, 2, cellTvOrderDate);
    //gridNewOrder.addCell(3, 3, cellEmpty);
    gridNewOrder.addCell(3, 4, cellLabelAddress);
    gridNewOrder.addCell(3, 5, cellInputYourOrderNo);
    gridNewOrder.addCell(4, 1, cellLabelRequestedDelDate);
    gridNewOrder.addCell(4, 2, cellInputYourOrderNo);
    //gridNewOrder.addCell(4, 3, cellEmpty);
    gridNewOrder.addCell(4, 4, cellLabelEmpty);
    gridNewOrder.addCell(4, 5, cellInputYourOrderNo);
    gridNewOrder.addCell(5, 1, cellLabelCompletedelivery);
    gridNewOrder.addCell(5, 2, cellCBGIM);
    //gridNewOrder.addCell(5, 3, cellEmpty);
    gridNewOrder.addCell(5, 4, cellLabelDeliveryAddress);
    gridNewOrder.addCell(5, 5, cellTvDeliveryAddress);
    gridNewOrder.addCell(6, 1, cellLabelGIM);
    gridNewOrder.addCell(6, 2, cellCBGIM);
    gridNewOrder.addCell(6, 3, cellEmpty);
    gridNewOrder.addCell(6, 4, cellLabelEmpty);
    gridNewOrder.addCell(7, 4, cellLabelEmpty);
    gridNewOrder.addCell(6, 6, cellEmpty);
    gridNewOrder.addCell(8, 1, cellEmpty);
    gridNewOrder.addCell(9, 1,cellDetailsOrderInfo);
    gridNewOrder.addCell(10, 1,cellTVOrderLines);
    gridNewOrder.addCell(11,1,cellButtonAddLine);
    %>
    Awaiting Reply.
    Please help.
    Thanks and Warm Regards,
    Ritu

    >>AddLine.setOnClientClick("javascript:AddLines()");
    I guess AddLine.setOnClientClick("AddLines()"); this wud work!
    Regards,
    P.

Maybe you are looking for

  • My Time Machine won't back up and files won't open when double clicked.

    I'm not sure if these are related, but recently my MacBook Pro has been acting much more sluggish than usual. To start, I have a 13in MacBook Pro Mid 2012 model with a 2.5 GHz Intel Core i5 processor and 4 GB 1600 MHz DDR3 memory. I've got it new in

  • Error sending DAV request. HTTP code 500, status 'Internal Server Error'

    Hi All, I am getting the error On SCCM R2 Environment .. on the client machine we are getting the below issue and software center  is not showing any information.. While checking on the client's DatatransferService.log.. i am getting the below issues

  • Importing a model from a configurator to a custom table

    Hi, I'm new to Configurator. Can someone please advice in detail how to import all possible combinations from a model in the configurator to a custom table? I have created a custom table based on the items in the model. I have also written a CIO whic

  • Inverse / reverse pen pressure settings?

    There have been a topic about this basic setting back in 2009. Is it still imposibble to achive a setting with wacom pen tablet to draw at full brush size with minimum pressure, and to make precise, small size brush strokes with harder pressure?! If

  • Replicating Product groups after client copy WRONG

    Hi Folks, I've taken a client copy from client 100 to 050 in both SRM SD1CLNT100 and ECC ED1CLNT100. I've done BDLS to replace log. sys. in both systems for both SRM and ECC log sys. eg. ED1CLNT100 to 050 and SD1CLNT100 to 050. After replication of c