Hi André,

The only way (I know) to access a method in a component is to be in an action 
in the parent :

public WOComponent  generateCapcha(){
{
        ERCaptcha captcha = pageWithName(ERCaptcha.class);
        captcha. setResponse("");
        return captcha;
}

But probably action can be used in your case.
 

You can try  the subclass way. You  could override appendToResponse in your 
PSDCaptcha to do what you want...


HTH
Pierre   


-----Message d'origine-----
De : Webobjects-dev 
[mailto:webobjects-dev-bounces+pierre.gilquin=hcuge...@lists.apple.com] De la 
part de André Rothe via Webobjects-dev
Envoyé : mercredi 24 juillet 2019 11:53
À : WebObjects-Dev
Objet : Access to WOComponents of a page

Hi,

How I can access the WOComponent objects of a page? I use different 
WOComponents in a "Main WO" and I try to access the classes behind the 
components from Main.java to call some public methods on them. In example I 
would like to call ERCaptcha.setResponse("") on the component which is named as 
"captcha" within my page.

captcha : er.captcha.ERCaptcha {
   validated = ...
   resetText = ...
}

I have tried to subclass the components and override some methods there, but it 
won't work as expected.

capcha : PSDCaptcha {
   validated = ...
   resetText = ...
}

public class PSDCaptcha extends ERCaptcha { ....
}

Is there a map of all defined components in "Main WO" which I can access from 
i.e. context()?

Thank you
André
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/pierre.gilquin%40hcuge.ch

This email sent to pierre.gilq...@hcuge.ch
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to