Accessing input field from the JSP in dynpage

HI all,
      I am trying to access the input field of the jsp page in my JSPDynpage but it is always return null.My Input is a normal HTML element not a HTMLB element
JSP File :
     <hbj:content id="myContext" >
  <hbj:page title="PageTitle">
  <hbj:form id="myFormId" >
     <div class="content">
        <table cellpadding="2" cellspacing="2">
                    <tr>
                           <td>
                              <label for="name"><strong>UserName:</strong></label><span id="info_name">(This field is required)</span><br />                           
                                 <input name="name" id="name" size="10" maxlength="10" type="text" />
                           </td>
                    </tr>
                    <tr>
                         <td>
                              <label for="email"><strong>EmailID:</strong></label><span id="info_email">(This field is required)</span><br />                           
                                 <input name="email" id="email" size="20" maxlength="20" type="text" /></td>
                    </tr>\
</Table>
JSPDynpage:
       InputField myInputField = (InputField) getComponentByName("name");
     if (myInputField != null) {
      name = myInputField.getValueAsDataType().toString();
               InputField myInputField1 = (InputField) getComponentByName("email");
     if (myInputField1 != null) {
      name = myInputField1.getValueAsDataType().toString();
In both the cases myInputField and myInputField1 are null . My Question is what should be the parameter that i need to pass for getComponentByName method.
Regards,
Raj.

hi,
The way you are trying to get the input field value works good with hbj type elements.
either you change your input field to an hbj one or use java script inside your jsp page to catch the value
like
for HTML:
[HTML Input Field|http://www.w3schools.com/HTMLDOM/met_doc_getelementbyid.asp]
and for HTMLB
refer this link:
[SAP HTMLB GuideLines|http://www.sapdesignguild.org/resources/htmlb_guidance/index.html]
Regards,
Srinu

Similar Messages

  • How to keep the input field from PDF Form to RTF

    Hi,
    I'm looking to keep the input fields from my pdf form document to Rtf so I can use them in my Rtf document.
    Regards,
    Alan

    Good day Alan,
    I'm afraid that's not possible as form fields in a PDF file have no equivalent either in a Word format (.docx/.doc) or within the Rich Text Format (.rtf).  That data is simply stripped during the conversion as there's no equivalent available.
    Kind regards,
    David
    Acrobat Community Manager
    Adobe Systems

  • Accessing my own class members from the JSP file

    Hi,
    I have created a class by name simple.java.and the package structure is like sridhar.source.useful.In this package i placed my file simple.java.
    Now i import this file with the import statement in JSP like
    <%@ import = "sridhar.source.useful.*" %>
    Now from the JSP file i want to execute some of the methods in simple.java.
    I tried this one by importing the simple.java in my JSP file,but i am getting some errors:
    variables that i have declared in Java files are not defined.
    The JSP is not importing the class simple.java
    I am executing my JSP in weblogic6.1(webserver is IPlanet)
    shall i need to set any classpath for this in the weblogic shell script??
    pls clarify me if any configuration is to be made or not??
    regards
    Naidu

    For JSP with IPlanet/weblogic and imported custom classes:
    Put your class / package in the correct folder. $path is any path you want....
    Ex: package foo, class foorbar must be
    $path/foo/foobar.class
    All classes must be .class, not .jar.
    Weblogic/IPlanet must be configured to have the CLASSPATH
    $path/
    (do not include foo/foobar!)
    The JSP has
    <%@ import "foo.*" %>
    Your class may now be used just like the other imported classes. Say you have an object Foobar with a constructor, you can just say
    Foobar myFoo = new Foobar();
    I do this with my classes, so if you have any questions, just ask.

  • Pass the data back from the jsp page to the java code

    Hi,
    I have written an iView that receives an event using EPCF and extracts data from the client data bag.
    I need this iView to pass the data back from the jsp page to the java code.
    I am trying to do this using a hidden input field, but I cannot get the code to work.
    Here is the code on the jsp page.
    <%@ taglib uri="tagLib" prefix="hbj" %>
    <hbj:content id="myContext" >
      <hbj:page title="PageTitle">
       <hbj:form id="myFormId">
    <hbj:inputField id="myInputField" type="string" maxlength="100" value="" jsObjectNeeded="true">
    <% myInputField.setVisible(false);%>
    </hbj:inputField>      
       </hbj:form>
      </hbj:page>
    </hbj:content>
    <script language=JavaScript>
    EPCM.subscribeEvent("urn:com.peter", "namedata", window, "eventReceiver");
    function eventReceiver(eventObj) {
         var url = eventObj.dataObject;
         var funcName = htmlb_formid+"_getHtmlbElementId";
         func = window[funcName];
         var ipField = eval(func("myInputField"));
         ipField.setValue(url);
         var form = document.all(htmlb_formid);
         form.submit();
    </script> 
    Here is my java code
    package com.sap.training.portal;
    import com.sapportals.htmlb.InputField;
    import com.sapportals.htmlb.page.DynPage;
    import com.sapportals.htmlb.page.PageException;
    import com.sapportals.portal.htmlb.page.JSPDynPage;
    import com.sapportals.portal.htmlb.page.PageProcessorComponent;
    public class ListSalesOrder extends PageProcessorComponent {
      public DynPage getPage(){
        return new ListSalesOrderDynPage();
      public static class ListSalesOrderDynPage extends JSPDynPage{
         private String merong;
        public void doInitialization(){
        public void doProcessAfterInput() throws PageException {
              InputField reportfld = (InputField) getComponentByName("myInputField");
              if (reportfld != null)      merong = reportfld.getValueAsDataType().toString();
        public void doProcessBeforeOutput() throws PageException {
              if ( merong != null ) setJspName("merong.jsp");
              else setJspName("ListSalesOrder.jsp");
    Here is DD
    <?xml version="1.0" encoding="utf-8"?>
    <application>
      <application-config>
        <property name="SharingReference" value="com.sap.portal.htmlb"/>
        <property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>
      </application-config>
      <components>
        <component name="SearchSalesOrder">
          <component-config>
            <property name="ComponentType" value="jspnative"/>
            <property name="JSP" value="/pagelet/SearchSalesOrder.jsp"/>
          </component-config>
          <component-profile>
            <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
          </component-profile>
        </component>
        <component name="ListSalesOrder">
          <component-config>
            <property name="ClassName" value="com.sap.training.portal.ListSalesOrder"/>
          </component-config>
          <component-profile>
            <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
          </component-profile>
        </component>
      </components>
      <services/>
    </application>
    After receive event, then call java script function "eventReceiver" and call "form.submit()".
    But .. PAI Logic in Java code doesn't called ...
    Where is my problme ?
    Help me ...
    Regards, Arnold.

    Hi Arnold,
    you should not do a form.submit yourself. Instead you can put a component called ExternalSubmit to your page:
    ExternalSubmit exSubmit = new ExternalSubmit("EX_SUBMIT"));
    exSubmit.setServerEventName("MyEvent");
    This results in a java script funtion on the page which is called "_htmlb_external_submit_". If you call this function the the form gets submitted and your event handler is called.
    regards,
    Martin

  • Invoking the scheduler's doScheduledTask method from the jsp

    Hi Folks,
    Could you please throw some ideas on my issue,
    I would like to invoke the scheduler's doScheduledTask method from the jsp.
    approach is like...
    I have JSP and a form. Form has a one text field and i will give some value and clicks on the submit button, it should invoke the scheduler method.
    or
    if you know any other approach to invoke the scheduler's doScheduledTask method from the jsp is invitable.
    Thanks much in advance

    Hi,
    1. Create the form in the jsp and a form handler to process this form, say InvokeSchedulerFormHandler.
    2. Create a variable to refer to the scheduler.
    MyScheduler myScheduler;
    // create getter and setter for this.
    3.. Create a handle method, handleInvokeScheduler(). Do any validations if required.
    4. After the validations, call getMyScheduler().doScheduledTask();
    5. In the jsp, map the submit button to this handle method.
    <dsp:input type="submit" bean="InvokeSchedulerFormHandler.invokeScheduler" value="Submit"/>
    6. Create the .properties file to the form handler and to your scheduler.
    MyScheduler.properties
    $class=com.package.MyScheduler
    $scope=global
    InvokeSchedulerFormHandler.properties
    $class=com.package.InvokeSchedulerFormHandler
    $scope=request
    myScheduler=/com/package/MyScheduler
    (Am wondering about this requirement :) . If you can specify the reason, it will be helpful).
    Hope this helps.
    Keep posting the questions / updates.
    Thanks,
    Gopinath Ramasamy

  • How i can show the selection screen input field in the top of page in alv

    hi ,
              how i can show the selection screen input field in the top of page in alv  grid output.
    tell me the process

    Hi,
    excample from my program:
    FORM topof_page.
      DATA: l_it_header   TYPE TABLE OF slis_listheader WITH HEADER LINE,
            l_info        LIKE l_it_header-info.
      DATA: l_it_textpool TYPE TABLE OF textpool WITH HEADER LINE.
      DATA: l_key LIKE l_it_textpool-key.
      READ TEXTPOOL c_repid INTO l_it_textpool LANGUAGE sy-langu.
      DEFINE m_selinfo.
        if not &1 is initial.
          clear l_it_header.
          l_it_header-typ   = 'S'.
          l_key = '&1'.
          translate l_key to upper case.
          read table l_it_textpool with key key = l_key.
          if sy-subrc = 0.
            shift l_it_textpool-entry left deleting leading space.
            l_it_header-key = l_it_textpool-entry  .
          endif.
          loop at &1.
            case &1-option.
              when 'EQ'
                or 'BT'
                or 'CP'.
                write &1-low to l_it_header-info.
              when others.
                write &1-low to l_it_header-info.
                concatenate &1-option
                            l_it_header-info
                       into l_it_header-info
                       separated by space.
            endcase.
            if not &1-high is initial.
              write &1-high to l_info left-justified.
              concatenate l_it_header-info
                          l_info
                     into l_it_header-info
                     separated by space.
            endif.
            if &1-sign = 'E'.
              concatenate ']'
                          l_it_header-info
                     into l_it_header-info.
            endif.
            append l_it_header.
            clear: l_it_header-key,
                   l_it_header-info.
          endloop.
        endif.
      END-OF-DEFINITION.
      m_selinfo: s_trmdat,
                 s_trmext,
                 s_trmint,
                 s_fkdat,
                 s_delno,
                 s_vbeln,
                 s_deact,
                 s_kdmat.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
                it_list_commentary = l_it_header[].
    ENDFORM.
    I hope, this will help you.
    Regards
    Nicole

  • How to hide the field from the view in the webdynpro application?

    Hi Gurus,
    I got a requirement where in which ,default layout has the field name Time.......To......... which is (2 input box ) and one lable assigned to the container.........
    Now my requirement is to hide this field from the layout for all cases of leave......(all types of leave)....
    I got a few inputs from forum that we can achieve this by implementing the following steps..........
    Create In context => Value attribute => Say Visibility
    Go to its properties
    Select com.sap.ide.webdynpro.uielementdefinitions.Visibility
    In View Layout
    Select UI Element Set Visible property to this context variable Visibility.
    In wdDoModifyView() You can set this property to false
    wdContext.currentContextElement().setVisibility(false);
    Can you people tell me where to create the value attribute........
    In the view context or in the component context...........
    and field that am talking about is assign to the container you want me to assign this context variable property to all ......Like to input box ,label and the container..........
    Please calrify this ASAP...........
    Thanks in Advance,
    Dharani

    Hi Manoj......
    Hi Murutuza,
    As per your guidelines I have created the value attribute in View context (which has the field..... which needs to be hide)inside the value node say FieldVisibility.......and attribute name OldTimeDuration......and I set this value with uidefeneitions Visibility .......
    and I bind this vaule with the field property visible(Time.......To..........)which I need to hide...........
    Now in the view implementation tab ..........I have coded in the doinit method(since my requirement to hide the field from the layout in all cases).........
    wdContext.currentFieldVisibilityElement().setOldTimeDuration(WDVisibility.NONE);
    But if I deploy the application and see still am getting the same field dispalying in the screen.........
    I even tried putting this code in wdmodifyview method.........same results........
    Kindly tell me how to hide the field permenantly from the screen............(without any conditions.)
    Thanks in Advance,
    Dharani

  • Not able to display the values in the input fields of the view

    Hi All.
    I am facing an unique issue.
    My custom element created in my custom node getting a null value
    from a Get Vendor Details RFC written in RFC.
    The values are getting populated in the custom element but not coming in the
    input field of the corresponding view.
    Then, I wrote this code
    wdContext.nodeCustom.setLeadSelection(1);
    and all the output came in the input field.
    Now, after a build it is not coming in the input fields of the view.
    All my custom nodes are Singleton and values are coming in the custom elements
    as I can print them by wdComponentApi.getMessageManager.reportSuccess(""+customnode.getField());
    All my nodes are Singleton.
    Please give your valuable inputs.
    Regards
    Kaushik Banerjee

    Hi
    Check the node property
    initializeLeadSelection     true
    if not make it true , I would suggest to make a value node of the same structure as in RFC after execuation of the RFC populate the value manually.Dont bind it directly to the UI element.
    BR
    Satish Kumar

  • I am trying to pass the value of a field from the seeded page /oracle/apps/

    I am trying to pass the value of a field from the seeded page /oracle/apps/asn/opportunity/webui/OpptyDetPG. The value I want is in the VO oracle.apps.asn.opportunity.server.OpportunityDetailsVO and the field PartyName.
    I have created a button on the page whose destination URL is
    OA.jsp?OAFunc=XX_CS_SR_QUERY&CustName={#PartyName}
    It opens the correct page, but in the URL it shows this
    http://aa.com:8005/OA_HTML/OA.jsp?OAFunc=XX_CS_SR_QUERY&CustName=&_ti=1897289736&oapc=177&oas=x5E2TIfP1Y0FykBt1ek4ug..
    You can see that &CustName is not getting the proper value. Do I need to do something different?

    You cannot call the form with OA.jsp . This is applicable only for OAF based pages registered as a function.
    For calling a Form, use the below example:
    You have to change the application responsibility key and form function name .
    "form:PN:PN:STANDARD:XXPNTLEASE:QUERY_LEASE_ID={@QueryLeaseNumber}"
    Regards,
    Sudhakar Mani
    http://www.oraclearea51.com

  • How do we validate input fields on the selection screen

    How do we validate input fields on the selection screen

    hi balram,
    u can validate input fields using <b>AT SELECTION-SCREEN</b>  Event.
    PARAMETERS : p_werks TYPE marc-werks.
    AT SELECTION-SCREEN ON p_werks.
    SELECT SINGLE *
    FROM t001w
    WHERE werks = p_werks.
    IF sy-subrc <> 0.
    MESSAGE 'Invalid Plant' TYPE 'I'.
    ENDIF.
    Like this, we can validate user input for plant.
    check this link:
    http://help.sap.com/saphelp_nw04s/helpdata/en/9f/db9a2e35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/56/1eb6c705ad11d2952f0000e8353423/content.htm
    Reware me if useful......
    Harimanjesh AN

  • How do i retrieve information from the JSP into my SELECT statements?

    I need to retrieve the information that is being entered into JSP page.. So that i can use them to do an SQL statement.. but im not very sure if my codes are correct.. Following are my codes.. Pls help.. thx
    MyJSPPage.jsp
    <jsp:useBean id="user" class="user.User" scope="session"/>
    <form name="loanItem" method ="POST" action="user">
    <input type="hidden" name="userID" value="<jsp:getProperty name="user" property="userID"/>">
         <tr><td align=left height="34"> <b> <font size="4">Member ID:</font>
    </b> </td>
              <td height="34">
              <jsp:getProperty name="user" property="userID"/></td>
         </tr>     
    ==================================================================================
    MyManager.java --> this file is where all my SQL statements are ..
    [l]String itemType = session.getParameter("itemType");[l] (--->> is how i retrieve info from the JSP page?)
              if (itemType.equals("Book"))
                   String sqlQuery1 = "select loanDuration from ItemPolicy where itemType ='" + itemType+ "'";
                   System.out.println(sqlQuery1);
                   ItemPolicy itempolicy = null;
                   try {
                        db = new Database();
                        rs = db.readRequest(sqlQuery1);
                        if (rs != null && rs.next()) {
                             itempolicy = new ItemPolicy();
                             itempolicy.setLoanDuration(Integer.parseInt(rs.getString("loanDuration")));
                        db.close();
                   } catch (SQLException se) {
                                  se.printStackTrace();
                                  throw (new UserException("Unable to retrieve from Database!"));
                             } catch (Exception e) {
                                  e.printStackTrace();
                                  throw (new UserException("Unknow error encountered!"));
                   String dueDate = util.getDueDate(itempolicy.getLoanDuration());
              else if (itemType.equals("Magazine"))
    ==================================================================================
    Thanks in advance...

    you should change to request.getParameter("itemType").
    or just System.out.print the itemType to see it got the value.
    Hope it helps.

  • Best way to access Time Capsule from the Internet?

    I wanted to see if anyone knew of a program or setting I can use in order to access Time Capsule from the internet? I know that probably I will not be able to at this point access it directly, even though it is connected to the internet through my modem, but I do have a Mac at home that is connected to Time Capsule. Isn't their a way that I could connect to the Mac, but not through Back to My Mac, that would show Time Capsule as connected to it, so that way I could access the files? Any ideas would be appreciated.

    It is possible to mount the TC as a network hard drive when outside your regular network.
    1) You will need to reconfigure your router to forward the ports used for AFP (by default 548) to the Time Capsule.
    2) Then when outside the network make sure Finder is active, press Apple+K to bring up the 'Connect To Server' dialog.
    3) Input the WAN IP address of the network to which the TC resides on.
    4) You will be asked for the password used to access TC.
    5) The TC should appear as a mounted drive.
    It is then possible to access files on the TC as well as do a TM backup. To make life easier you can drag the mounted TC into your dock for easier access in the future.
    However, it is obviously recommended to use a strong password to protect the TC (configurable using Airport Utility in the 'Disks/File Sharing' tab). You may also need to use a service like DynDNS if your network does not use a static IP address.
    But I am using my home networks' Time Capsule successfully from the office.

  • How to access getter/setters from the entity classes

    Let me brake my question to two:
    1. in My JSP page, I need to get an exception from either the entity or the view class if I insert a duplicate value into the associated table. How can I do that?
    2. How can I access the entity's getter/setter functions in the JSP page?
    Thank you

    Let me brake my question to two:
    1. in My JSP page, I need to get an exception from either the entity or the view class if I insert a duplicate value into the associated table. How can I do that?You can mark the attribute as unique key attribute and choose to implement the unique-key validation in the Bc4J side. See help on UniqueKey and how to establish such validation
    2. How can I access the entity's getter/setter functions in the JSP page?You cannot access entities directly. You have to expose the accessors via ViewObject Rows and use those Rows from the JSP/or any client side.
    Thank you

  • HT204406 I am having a very difficult time with accessing my music from the cloud.  I need to have itunes open on my laptop in order for it to work.  And as soon as I close out itunes on my laptop, it gives me a warning that all users will be logged out. 

    I am having a very difficult time with accessing my music from the cloud.  I need to have itunes open on my laptop in order for it to work.  And as soon as I close out itunes on my laptop, it gives me a warning that all users will be logged out.  Help!!!

    Where are iTunes files located?
    No, I do not mean just the music.  Copying just the media/music files or the media folder creates problems.

  • Getting Error while deleting a field from the 'Z' Structure

    Hi All,
    I have created a 'z' structure in which i have 5 fields, now i want to delete one field from the structure, but it is giving me error like Invalid Change.
    Its a structure so i cant activate and adjust as we do for Tables.(se14)
    So pls help me out asap.
    thanks & Regards,
    Dhruv Shah

    Thanks for Quick Reply.
    I have not used this field in any FM/ Report.
    I have tried log off and then log on. but it make no difference.
    Now the Other scenario is that i want to change the datatype of this field to TEXT25.
    But it is also not allowing me to change because currently datatype is TEXT20.
    So now how can i change the length from 20 to 25.
    Regards,
    Dhruv Shah

Maybe you are looking for