Skip to Content
avatar image
Former Member

accessing InputField data in onClick event

I have a InputField controls and a button on the DynPage. And I try to access the text entered in these InputField control in the onClick event of the button:

private void onMyClick(Event event)throws PageException{
         InputField intFild = (InputField)this.getComponentByName("fieldName");
}

and I recive error: The method getComponentByName(String) is undefined for the type MyClass

Whats wrong??

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Oct 17, 2008 at 07:38 AM

    Hi,

    does your MyClass extend the com.sapportals.htmlb.page.DynPage?

    public class Report extends PageProcessorComponent {
    
      public DynPage getPage() {
        return new MyClass();
      }
    ...
    public static class MyClass extends DynPage  {
    ...
    

    Romano

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 17, 2008 at 08:41 AM

    Hi,

    Organize imports and check if the required jar files are added. Else add these 2 jars to project build path and check.

    Right click project -> Properties -> Java Build Path -> 'Libraries' tab -> Click on 'Add External Jars' and add these two jars.

    1) com.sap.portal.htmlb_api.jar - C:\Program Files\SAP\IDE\IDE70\eclipse\plugins\com.sap.ep.applicationDevelopment_7.00

    2) htmlb.jar - C:\Program Files\SAP\IDE\IDE70\eclipse\plugins\com.sap.tc.ap_2.0.0\comp\SAP_JTECHS\DCs\sap.com\com.sapportals.htmlb_comp\gen\default\public\default\lib\java

    Click Ok and rebuild the project.

    Regards,

    Harini S

    Add comment
    10|10000 characters needed characters exceeded