Hi,

The problem seems to be a class in your code that already exists in the 
AjaxFramework and this confuse WO.

A WOComponent (or EOEntity) name need to match a single class name if the 
entire class path or you will have troubles.

Check for classes with generic names like AjaxAction, AjaxResponse that may 
already exists.

Thierry is few error or strange things in the ajaxResponse() method:

1- AjaxResponse is defined in the AjaxFramework is is not a WOComponent, it's 
parent is ERXResponse. This method is not supposed to compile...

2- ERXDirectAction contain a methodPageWithName(Class<T> componentClass), I 
suggest you use it, it is way more clean.

3- You can use the returned component class as return type, it is constant.


Samuel

> Le 25 avr. 2016 à 10:43, Raymond NANEON <[email protected]> a écrit :
> 
> Hi JF,
> 
> I have a spefic AjaxAction which extends ERXDirectAction uses speficly to 
> call some directAction from javascript.
> i.e :
> in my JsFile  ==>
> function modifierModele(idModele){
>     //Preparation de la requete
> ...
> var url_requete = 
> url_serveur+"/wa/AjaxAction/modifierModeleMail?idModeleMail="+idModele+"&objet="+objet+"&message=\""+message+"\"";
> ajaxRequest({
>         type:'GET',
>         url: url_requete, 
>         async: false,
>         cache: false,
>         mimeType:"text/plain",
>         contentType: false,
>         processData: false,
>         success:function(xml){
>             //Si la requete s'est bien produite on raffraichit le modele 
> actuellement affiche
>             if( $(xml).find('error').length!=0 && 
> $(xml).find('error').text()=='false')afficherModele(idModele);
>             else ajaxTooltip({html:'ERREUR:'+$(xml).find('msg').text()});
>         }
>     });
> }
> 
> 
> In my AjaxAction Class :
> public WOActionResults modifierModeleMailAction() {
> ...
> try {
> ...
> if (sess.saveChanges())
>                 return ajaxResponse(false, "succes");
>             return ajaxResponse(true,
>                     "Erreur lors de l'enregistrement des donnees");
>         } catch (Exception e) {
>             return ajaxResponse(true, "Arguments de la requete invalides");
>         }
> }
> 
> 
>     private WOComponent ajaxResponse(boolean error, String message) {
>         AjaxResponse response = (AjaxResponse) pageWithName(AjaxResponse.class
>                 .getName());
>         response.setError(error);
>         response.setMessage(message);
>         return response;
>     }
> 
> I want say that my AjaxResponse is already a WOComponent ? May be I must Cast 
> it as WOComponent ?
> 
> Thanks
> 
> ...
> Envoyé depuis iCloud
> 
> Le 25 avril 2016 à 15:17, Jean-François Veillette 
> <[email protected]> a écrit :
> 
>> Sorry all …
>> In English …
>> 
>> Hi Raymond,
>> The stack is missing too many elements.
>> From what we can see, it seems that your action is executing properly but 
>> returning result as an AjaxResponse, but the handler is expecting a 
>> WOComponent.
>> 
>> Could it be that  
>> fr.univlr.colloque.components.admin.ajax.ListeUtilisateursGroupe  is 
>> returning an AjaxResponse but the handler expect a WOComponent?
>> We need more stack frame to be able to identify where you are in the RRL and 
>> what could be the cause of this.
>> 
>> jfv
>> 
>> 
>>> On Apr 25, 2016, at 9:13 AM, Jean-François Veillette 
>>> <[email protected] 
>>> <mailto:[email protected]>> wrote:
>>> 
>>> Bonjour Raymond,
>>> 
>>> La stack manque plusieurs niveaux.
>>> Selon le peu que l’on a comme information, on en comprend que la requête a 
>>> bien été exécuté, a retourné une AjaxResponse, mais que le « handler » 
>>> s’attendais à recevoir un WOComponent.
>>> 
>>> fr.univlr.colloque.components.admin.ajax.ListeUtilisateursGroupe retourne 
>>> une AjaxResponse, mais le « handler » s’attend à un « WOComponent » ?
>>> On a besoin de plus d’élément dans la stack pour voir ou ce passe 
>>> l’exception dans la RRL.
>>> 
>>> jfv
>>> 
>>>> On Apr 25, 2016, at 2:15 AM, Raymond NANEON <[email protected] 
>>>> <mailto:[email protected]>> wrote:
>>>> 
>>>> Hi List,
>>>> 
>>>> Nobody has had this kind of exception? I would like to fix it but I don't 
>>>> know where I can touch.
>>>> 
>>>> Thanks to take a moment to look at it.
>>>> 
>>>> Ray
>>>> Envoyé depuis iCloud
>>>> 
>>>> Le 21 mars 2016 à 11:30, Raymond NANEON <[email protected] 
>>>> <mailto:[email protected]>> a écrit :
>>>> 
>>>>> Hi List,
>>>>> 
>>>>> I am trying to call some specifics components using AjaxAction in 
>>>>> javascript.
>>>>> It works sometimes and sometimes not and I don't understand why?
>>>>> 
>>>>> Yes I know the exception tells me ajaxResponse ... but why it works 
>>>>> sometimes?
>>>>> 
>>>>> here is stacktrace : 
>>>>> "CurrentComponent" = 
>>>>> "fr.univlr.colloque.components.admin.ajax.ListeUtilisateursGroupe";
>>>>>     "PreviousPageList" = (
>>>>>         "com.webobjects.appserver.WORedirect"
>>>>>     );
>>>>>     };
>>>>>     "URL" = 
>>>>> "/cgi-bin/WebObjects/Colloque.woa/1/wa/AjaxAction/listeUtilisateursGroupe?idGroupe=11";
>>>>> }
>>>>> 
>>>>> IllegalArgumentException: 
>>>>> <com.webobjects.appserver._private.WOComponentDefinition> Class 
>>>>> 'er.ajax.AjaxResponse' exists but is not a subclass of WOComponent.
>>>>>   at 
>>>>> com.webobjects.appserver._private.WOComponentDefinition._componentClass(WOComponentDefinition.java:496)
>>>>>      ... skipped 17 stack elements
>>>>>   at fr.univlr.colloque.Application.dispatchRequest(Application.java:116)
>>>>>   ... skipped 3 stack elements
>>>>> _ignoredPackages:: ()
>>>>> 
>>>>> How can I avoid this problem in the future?
>>>>> 
>>>>> Thanks for help
>>>>> Envoyé depuis iCloud
>>>>> _______________________________________________
>>>>> Do not post admin requests to the list. They will be ignored.
>>>>> Webobjects-dev mailing list ([email protected] 
>>>>> <mailto:[email protected]>)
>>>>> Help/Unsubscribe/Update your Subscription:
>>>>> https://lists.apple.com/mailman/options/webobjects-dev/rnaneon%40me.com 
>>>>> <https://lists.apple.com/mailman/options/webobjects-dev/rnaneon%40me.com>
>>>>> 
>>>>> This email sent to [email protected] <mailto:[email protected]>
>>>> _______________________________________________
>>>> Do not post admin requests to the list. They will be ignored.
>>>> Webobjects-dev mailing list      ([email protected] 
>>>> <mailto:[email protected]>)
>>>> Help/Unsubscribe/Update your Subscription:
>>>> https://lists.apple.com/mailman/options/webobjects-dev/jean_francois_veillette%40yahoo.ca
>>>>  
>>>> <https://lists.apple.com/mailman/options/webobjects-dev/jean_francois_veillette%40yahoo.ca>
>>>> 
>>>> This email sent to [email protected] 
>>>> <mailto:[email protected]>
>>> 
>> 
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com
> 
> This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to