Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

SMP 3.0 Android OpenUI Custom Control- getExtensionString method-not been called by Agentry

Hi Everyone,

I am currently trying to develop a custom Android openUI control.

My control actually mimics the captcha generation and validation that is commonly used in many websites.

I created a class by extending EmbeddedImageDisplayAdapter and managed to generate random captcha images and also managed to store the actual answer of the captcha in a object(String).

To make this control complete, I created a string field (associated to string object property) in agentry which takes in user values and created a external value in the field where I used my custom OpenUI class which ideally should take values from OpenUI control to Agentry. The result of the validation depends on the comparison of these two values.

Also defined getExtensionString method in my custom control class.

But my control was only partially working. The image is been generated, the answer is been stored to the object, But this particular method-getExtensionString method responsible for value transfer from openui control to Agentry is not been called by Agentry.

I have confirmed it both by putting logs inside the method also by debugging.

Areas where I checked for errors

1. The external value name in Agentry and the one inside the getExtensionString method-Yes they are same.

2. Pointed the field(which has the custom control mapped to) in a rule.

Please let me know what am I missing?

my custom class for reference.

public class ZCustom_EmbedImage  extends EmbeddedImageDisplayAdapter {

EmbeddedImageDisplayModel _model;

ImageView _view;

Context _context;

captcha c;

TextView _label;



  public void initialize(EmbeddedImageDisplayModel model, Context context)


  // TODO Auto-generated method stub

  _model = model;

  _context = context;



  public View getView() {

  _view = new ImageView(_context);




   //Setting layout

  _view.setLayoutParams(new LinearLayout.LayoutParams(c.getWidth() *2, c.getHeight()*2));

  LinearLayout layout = new LinearLayout(_context);


  layout.setLayoutParams(new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,



  _label = new TextView(_context);






  return layout;


  private void setupImage()


  c=new MathCaptcha(300, 100, MathOptions.PLUS_MINUS_MULTIPLY);




  public void setHyperlinkEnabled(boolean enabled)


  if (enabled)



  _label.setOnClickListener(new View.OnClickListener()



  public void onClick(View v)


  c=new MathCaptcha(300, 100, MathOptions.PLUS_MINUS_MULTIPLY);


  }  });

  }  }


  * (non-Javadoc)

  * @see



  public String getExtensionString(String key)


  Log.v("inside the stringext method", c.answer);

  String value="";

  if (key.equals("CaptchaAnswer"))


  value= c.answer;


  return value;





Not what you were looking for? View more on this topic or Ask a question