myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luo. Haihua" <h....@seeburger.de>
Subject AW: AW: AW: AW: AW: AW: integration problem with <s:inputSuggestAjax> and portlet
Date Mon, 13 Feb 2006 16:47:36 GMT
Hi,

by chance I have found this comment in the DefaultAddResource.java (Line 591):

...
        if (HEADER_BEGIN.equals(position))
        {
            //todo: fix this to work in PortletRequest as well
            HttpServletRequest request = (HttpServletRequest) context.getExternalContext()
                    .getRequest();
...

So there should be one of the important places to support Portlet. I guess there should be
some corresponding place where the response is called, after invoking the suggested method.
The error should happen there.

Regards,

Haihua


-----Ursprüngliche Nachricht-----
Von: Volker Weber [mailto:users.myfaces@weber-oldenburg.de] 
Gesendet: Montag, 13. Februar 2006 12:07
An: MyFaces Discussion
Betreff: Re: AW: AW: AW: AW: AW: integration problem with <s:inputSuggestAjax> and portlet

Hi,

add

<category name="org.apache.myfaces.custom.ajax">
  <priority value="debug" />
</category>

i think the categorys "org.jboss.*" are not of interest here.

But if your suggest method is invoked the listener seems working, but
the encodeAjax of inputSuggestAjaxrenderer did not output "<html ...",
just the "<ul ...".

No idea what is going on there, maybe the portlet add those?



Regards,
  Volker

Luo. Haihua wrote:
> Hihi,
> 
> I have modified the log4j.xml in following lines:  
> ******
> ...
>   <category name="org.jboss.web.localhost.Engine">
>     <priority value="ALL"/> <<--modified here
>   </category>
> ...
> ******
> I think that is what you meant, isn't it?
> 
> Then followings are the outputs. It seems that all are related with Pluto (portlet container)
only. (The last two lines are the output of my suggest method. So does it mean that the Ajax
decode stuffs were not invoked?
> 
> Regards,
> 
> Haihua
> 
> ******
> 11:32:36,616 INFO  [JBossTrigger] [:handleNotification]Done
> 11:32:40,445 INFO  [Engine] StandardContext[/pluto]ServiceManager: Loading services...
> 11:32:40,460 INFO  [Engine] StandardContext[/pluto]ConfigService initializing...
> 11:32:40,460 INFO  [Engine] StandardContext[/pluto]ConfigService done.
> 11:32:40,476 INFO  [Engine] StandardContext[/pluto]LogService initializing...
> 11:32:40,476 INFO  [Engine] StandardContext[/pluto]LogService done.
> 11:32:40,476 INFO  [Engine] StandardContext[/pluto]FactoryManagerService initializing...
> 11:32:40,491 INFO  [Engine] StandardContext[/pluto]FactoryManager: Loading factories...
> 11:32:40,491 INFO  [Engine] StandardContext[/pluto]ObjectIDFactory initializing...
> 11:32:40,491 INFO  [Engine] StandardContext[/pluto]ObjectIDFactory done.
> 11:32:40,507 INFO  [Engine] StandardContext[/pluto]PortletConfig initializing...
> 11:32:40,507 INFO  [Engine] StandardContext[/pluto]PortletConfig done.
> 11:32:40,523 INFO  [Engine] StandardContext[/pluto]PortletURL initializing...
> 11:32:40,523 INFO  [Engine] StandardContext[/pluto]PortletURL done.
> 11:32:40,523 INFO  [Engine] StandardContext[/pluto]DynamicTitleServiceFactory initializing...
> 11:32:40,523 INFO  [Engine] StandardContext[/pluto]DynamicTitleServiceFactory done.
> 11:32:40,538 INFO  [Engine] StandardContext[/pluto]HttpServletResponse initializing...
> 11:32:40,538 INFO  [Engine] StandardContext[/pluto]HttpServletResponse done.
> 11:32:40,538 INFO  [Engine] StandardContext[/pluto]NamespaceMapper initializing...
> 11:32:40,538 INFO  [Engine] StandardContext[/pluto]NamespaceMapper done.
> 11:32:40,554 INFO  [Engine] StandardContext[/pluto]ActionResponse initializing...
> 11:32:40,554 INFO  [Engine] StandardContext[/pluto]ActionResponse done.
> 11:32:40,570 INFO  [Engine] StandardContext[/pluto]RenderResponse initializing...
> 11:32:40,570 INFO  [Engine] StandardContext[/pluto]RenderResponse done.
> 11:32:40,585 INFO  [Engine] StandardContext[/pluto]PortalContext initializing...
> 11:32:40,585 INFO  [Engine] StandardContext[/pluto]PortalContext done.
> 11:32:40,585 INFO  [Engine] StandardContext[/pluto]HttpServletRequest initializing...
> 11:32:40,585 INFO  [Engine] StandardContext[/pluto]HttpServletRequest done.
> 11:32:40,585 INFO  [Engine] StandardContext[/pluto]ControllerFactory initializing...
> 11:32:40,585 INFO  [Engine] StandardContext[/pluto]ControllerFactory done.
> 11:32:40,601 INFO  [Engine] StandardContext[/pluto]PortletPreferences initializing...
> 11:32:40,601 INFO  [Engine] StandardContext[/pluto]PortletPreferences done.
> 11:32:40,616 INFO  [Engine] StandardContext[/pluto]ActionRequest initializing...
> 11:32:40,632 INFO  [Engine] StandardContext[/pluto]ActionRequest done.
> 11:32:40,632 INFO  [Engine] StandardContext[/pluto]PortletContext initializing...
> 11:32:40,632 INFO  [Engine] StandardContext[/pluto]PortletContext done.
> 11:32:40,648 INFO  [Engine] StandardContext[/pluto]PortletInvoker initializing...
> 11:32:40,648 INFO  [Engine] StandardContext[/pluto]PortletInvoker done.
> 11:32:40,648 INFO  [Engine] StandardContext[/pluto]RenderRequest initializing...
> 11:32:40,663 INFO  [Engine] StandardContext[/pluto]RenderRequest done.
> 11:32:40,663 INFO  [Engine] StandardContext[/pluto]PortletSession initializing...
> 11:32:40,663 INFO  [Engine] StandardContext[/pluto]PortletSession done.
> 11:32:40,679 INFO  [Engine] StandardContext[/pluto]InformationProviderFactory initializing...
> 11:32:40,679 INFO  [Engine] StandardContext[/pluto]InformationProviderFactory done.
> 11:32:40,679 INFO  [Engine] StandardContext[/pluto]FactoryManager: Factories initialized
(18 success
> ful).
> 11:32:40,679 INFO  [Engine] StandardContext[/pluto]FactoryManagerService done.
> 11:32:40,695 INFO  [Engine] StandardContext[/pluto]PortletDefinitionRegistryService initializing...
> 11:32:42,179 INFO  [Engine] StandardContext[/pluto]PortletDefinitionRegistryService done.
> 11:32:42,179 INFO  [Engine] StandardContext[/pluto]PortletEntityRegistryService initializing...
> 11:32:42,257 INFO  [Engine] StandardContext[/pluto]PortletEntityRegistryService done.
> 11:32:42,273 INFO  [Engine] StandardContext[/pluto]PageRegistryService initializing...
> 11:32:42,320 INFO  [Engine] StandardContext[/pluto]PageRegistryService done.
> 11:32:42,320 INFO  [Engine] StandardContext[/pluto]ServiceManager: Services initialized
(6/6 success
> ful).
> 11:32:42,648 WARN  [LocaleUtils] Locale name in faces-config.xml null or empty, setting
locale to de
> fault locale : zh_CN
> 
> 11:34:20,101 INFO  [STDOUT] suggest processQname: AMHotfolderDecide
> 11:34:20,101 INFO  [STDOUT] suggest processQname: AMFtpDecide
> 
> ******
> 
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: Volker Weber [mailto:users.myfaces@weber-oldenburg.de] 
> Gesendet: Montag, 13. Februar 2006 10:49
> An: MyFaces Discussion
> Betreff: Re: AW: AW: AW: AW: integration problem with <s:inputSuggestAjax> and
portlet
> 
> Hiu,
> 
> Luo. Haihua wrote:
> 
>>Hihi,
>>
>>it seems sth. Interesting: the alert function returns the whole html page text instead
of the inner ul text!
> 
> 
> this is the case when the request is not handled by the
> AjaxDecodePhaseListener, or the listener did not find a requestParameter
> "affectedAjaxComponent". you can set log level to debug to see if the
> listener is invoked.
> 
> Regards,
>   Volker
> 
> 
>>So is that the problem when generating response text with MyFaces? Or portlet?
>>
>>Regards,
>>
>>Haihua
>>
>>-----Ursprüngliche Nachricht-----
>>Von: Volker Weber [mailto:users.myfaces@weber-oldenburg.de] 
>>Gesendet: Freitag, 10. Februar 2006 17:09
>>An: MyFaces Discussion
>>Betreff: Re: AW: AW: AW: integration problem with <s:inputSuggestAjax> and portlet
>>
>>Hi,
>>
>>you can add a "alert(request.responseText)" on top of onComplete
>>function in myFaces.js to see what the server respond. This breaks the
>>function, because of focus lost in input, but you see what you get from
>>server.
>>
>>if this is not "<UL><LI>..." there is somthing wrong, and will not
>>displayed, this is just what i observed when testing, i haven't looked
>>deeper to see why.
>>
>>Regards,
>>  Volker
>>
>>Luo. Haihua wrote:
>>
>>
>>>Hihi Volker,
>>>
>>>I have checked out all the sources from the myfaces-current in svn and finally
found out all the necessary js...
>>>
>>>With your files all javascript errors were gone! (Really a right way further!
:)) But then it does not list the suggestions at all without any error report both in front
end and back end, although the suggestion method defined in my bean has already been called.

>>>
>>>After somehow source code debug, I have found that the buffer defined in InputSuggestAjaxRenderer.class
(Line 263) has already got what I wish to list until here:
>>>------------
>>>buf.append("</ul>");
>>>
>>>context.getResponseWriter().write(buf.toString());
>>>------------
>>>
>>>Then where will it be sent? How can I access the generated buffer? Really stuck...:(
>>>
>>>Cheers,
>>>
>>>Haihua
>>>
>>>
>>>
>>>
>>>-----Ursprüngliche Nachricht-----
>>>Von: Volker Weber [mailto:users.myfaces@weber-oldenburg.de] 
>>>Gesendet: Freitag, 10. Februar 2006 12:27
>>>An: MyFaces Discussion
>>>Betreff: Re: AW: AW: integration problem with <s:inputSuggestAjax> and portlet
>>>
>>>Hi Haihua,
>>>
>>>no i haven't modified other files.
>>>
>>>in svn is version 1.5 of script.aculo.us files, from whre controls.js came.
>>>
>>>in version 1.4 (which was in myfaces until 22-dec-2005) the function was
>>>called "base_initialize", since 1.5 it is renamed to "baseInitialize".
>>>
>>>seems your sources are outdated, please update to svn head for testing
>>>this patch.
>>>
>>>I you haven't updated since maven-reorg you may need to do a clean
>>>checkout, see:
>>>http://wiki.apache.org/myfaces/Building_With_Maven
>>>
>>>Regards,
>>> Volker
>>>
>>>Luo. Haihua wrote:
>>>
>>>
>>>
>>>>Hi Volker,
>>>>
>>>>have you also modified the other js files? It says here that the js function
"baseInitialize" cannot be found. 
>>>>
>>>>I have checked your js file: In your file there is a function called  "baseInitialize",
while in my control.js it is called "base_initialize". 
>>>>
>>>>So maybe there is a new update of control.js? However, I could not find it
in svn...:(
>>>>
>>>>Kindest regards,
>>>>
>>>>Haihua
>>>>
>>>>-----Ursprüngliche Nachricht-----
>>>>Von: Volker Weber [mailto:users.myfaces@weber-oldenburg.de] 
>>>>Gesendet: Donnerstag, 9. Februar 2006 19:54
>>>>An: MyFaces Discussion
>>>>Betreff: Re: AW: integration problem with <s:inputSuggestAjax> and portlet
>>>>
>>>>Hi,
>>>>
>>>>yes this and related changes in myFaces.js was my first idea, but this
>>>>did not work right.
>>>>I added a additional field to the options.
>>>>
>>>>Seems you have the sources? please try the attached files, it works on
>>>>my tomcat, but i can't test on a portlet.
>>>>
>>>>If this works i can commit this into svn.
>>>>
>>>>Regards,
>>>>Volker
>>>>
>>>>PS: please rename myFaces.js-xxx as myFaces.js, js files are blocked
>>>
>>>>from my firewall.
>>>
>>>
>>>>Luo. Haihua wrote:
>>>>
>>>>
>>>>
>>>>
>>>>>Hi Volker,
>>>>>
>>>>>thanks for ur always warm-hearted reply!:)
>>>>>
>>>>>Do you mean sth. like this in InputSuggestAjaxRenderer.java?
>>>>>
>>>>>     out.writeText("', {\n" +
>>>>>             "      method:       'post',\n" +
>>>>>...
>>>>>             "      parameters: 'affectedAjaxComponent=" + clientId +
"',\n" +
>>>>>...
>>>>>
>>>>>It seems that it still not work...
>>>>>
>>>>>Cheers,
>>>>>
>>>>>Haihua
>>>>>
>>>>>
>>>>>
>>>>>-----Ursprüngliche Nachricht-----
>>>>>Von: Volker Weber [mailto:users.myfaces@weber-oldenburg.de] 
>>>>>Gesendet: Donnerstag, 9. Februar 2006 11:50
>>>>>An: MyFaces Discussion
>>>>>Betreff: Re: integration problem with <s:inputSuggestAjax> and portlet
>>>>>
>>>>>Hi,
>>>>>
>>>>>i think this can be solved by adding the parameters as post parameter
to
>>>>>the options, instead of empty.
>>>>>
>>>>>I will give it a try this afternoon (german time).
>>>>>
>>>>>Regards,
>>>>>Volker
>>>>>
>>>>>Luo. Haihua wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>Hi dear all,
>>>>>>
>>>>>>
>>>>>>
>>>>>>I am using portlet and want to insert a tag <s:inputSuggestAjax>
into
>>>>>>one of my .jsp page. However, it doesn't work due to a javascript
error
>>>>>>"element.getClassName has no properties" in firefox.
>>>>>>
>>>>>>
>>>>>>
>>>>>>I have read the generated html file, even jumped deeply into the source
>>>>>>codes of myfaces and found following problem:
>>>>>>
>>>>>>
>>>>>>
>>>>>>Within the generated html page, myfaces generates following javascript
>>>>>>codes for inputSuggestAjax:
>>>>>>
>>>>>>
>>>>>>
>>>>>>              <SCRIPT type=text/javascript><!--
>>>>>>
>>>>>>new
>>>>>>Ajax.MyFacesAutocompleter('Pluto_ProcessOverviewPortlet_r1_c1_p1__id0:Pluto_ProcessOverviewPortlet_r1_c1_p1__id2','Pluto_ProcessOverviewPortlet_r1_c1_p1__id0:Pluto_ProcessOverviewPortlet_r1_c1_p1__id2_auto_complete','*/pluto/portal/ProcessOverviewPortlet/_ac_ProcessOverviewPortlet_r1_c1_p1/AC/_pid/ProcessOverviewPortlet_r1_c1_p1**?**org.apache.myfaces.portlet.MyFacesGenericPortlet.VIEW_ID=%2Fview.jsp**?**affectedAjaxComponent=Pluto_ProcessOverviewPortlet_r1_c1_p1__id0:Pluto_ProcessOverviewPortlet_r1_c1_p1__id2*',
>>>>>>{
>>>>>>
>>>>>>  method:       'post',
>>>>>>
>>>>>>  asynchronous: true,
>>>>>>
>>>>>>  parameters: '',
>>>>>>
>>>>>>  callback: function(element,entry) {return
>>>>>>entry+'&jsf_tree_64='+encodeURIComponent(document.getElementById('jsf_tree_64').value)+'&jsf_state_64='+encodeURIComponent(document.getElementById('jsf_state_64').value)+'&jsf_viewid='+encodeURIComponent(document.getElementById('jsf_viewid').value)}
  
>>>
>>>
>>>>>>})
>>>>>>
>>>>>>//--></SCRIPT>
>>>>>>
>>>>>>
>>>>>>
>>>>>>Note that the third parameter of the js function, which should be
an
>>>>>>encodeURL, contains TWO "?", the first is generated by the portlet,
the
>>>>>>second by the myfaces! Therefore it is no more a valid encodeURL to
>>>>>>parse by myfaces!
>>>>>>
>>>>>>
>>>>>>
>>>>>>So it seems that inputSuggestAjax does not support any call by a page
>>>>>>whose URL already contains parameters. Any tips or suggestions how
to
>>>>>>resolve this problem?
>>>>>>
>>>>>>
>>>>>>
>>>>>>Mit freundlichen Grüßen / Kindest regards
>>>>>>
>>>>>>
>>>>>>
>>>>>>Haihua Luo
>>>>>>
>>>>>>
>>>>>
>>>>>
> 

-- 
Don't answer to From: address!
Mail to this account are droped if not recieved via mailinglist.
To contact me direct create the mail address by
concatenating my forename to my senders domain.

Mime
View raw message