开发者

WARNING: Target component for id thumbnailSelector not found

开发者 https://www.devze.com 2023-01-08 13:46 出处:网络
I am getting this warning in my jsf application when I upload an image through rich:fileUpload. <rich:fileUpload id="file" required="true"

I am getting this warning in my jsf application when I upload an image through rich:fileUpload.

<rich:fileUpload id="file" required="true"
                 listHeight="50" immediateUpload="true" 
                 maxFilesQuanity="1"
                 uploadData="#{entryHandler.uploadItems}"
                 fileUploadListener="#{entryHandler.uploadListener}">
                 <a4j:support event="onuploadcomplete" 
                              action="#{entryHandler.store}"
                              immediate="true"
                              reRender="thumbnailSelector" />
</rich:fileUpload>

...

<my:inputThumbnailSelector
    id="thumbnailSelector"
    imageServlet="#{facesContext.externalContext.requestContextPath}/preview/get.servlet"
    selector="id" 
    selectorValue="#{entryHandler.entry.id}"
    backingBean="#{entryHandler.entry}" >
</my:inputThumbnailSelector>

inputThumbnailSelector.xhtml:

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xml开发者_Go百科ns:ui="http://java.sun.com/jsf/facelets"
                xmlns:a4j="http://richfaces.org/a4j">
    <f:verbatim id="#{id}">
        <div style="position: relative;">
            <img style="position: absolute; left: 0; top: 0;" src="#{imageServlet}?#{selector}=#{selectorValue}&amp;time=#{utility.timestamp}"/>
            <div class="thumbnail-selector"
                 style="z-index: 1; position: absolute; left: #{backingBean.thumbnailLeft}; top: #{backingBean.thumbnailTop}; border-width: 2px; width: #{utility.thumbnailDimension-4}px; height: #{utility.thumbnailDimension-4}px;"/>
        </div>
    </f:verbatim>
</ui:composition>

Many thanks in advance!

EDIT: Actually the exact error I am getting is:

Jul 26, 2010 6:30:13 PM org.ajax4jsf.context.AjaxContextImpl convertId

WARNING: Target component for id thumbnailSelector not found


You are probably rerendering a component that's not found in the view.


Try to add in the form tag:

<form prependId="false" >
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号