cancel
Showing results for 
Search instead for 
Did you mean: 

accessing InputField data in onClick event

Former Member
0 Kudos

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??

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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

Former Member
0 Kudos

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