Boa tarde a todos,
Estou tentando fazer um drag drop e já verifiquei os exemplos disponíveis no site do richfaces, mas quando arrasto o objeto os dataTable não renderizam…
segue o código do metodo do meu manageBean
public void processDrop(DropEvent dropEvent) {
Dropzone dropzone = (Dropzone) dropEvent.getComponent();
Object produtoArrastado = dropEvent.getDragValue();
Object dropValue = dropzone.getDropValue();
if ("SELECIONADO".equals(dropValue)) {
if (produtosDisponiveis.contains(produtoArrastado)){
int indiceProdutoSelecionado = produtosDisponiveis.indexOf(produtoArrastado);
produtosSelecionados.add(produtosDisponiveis.get(indiceProdutoSelecionado));
produtosDisponiveis.remove(indiceProdutoSelecionado);
}
}
}
E agora o codigo no meu xhtml
<rich:dragIndicator id="indicator" />
<h:panelGrid columnClasses="panelc" columns="4" width="100%">
<rich:panel style="width:133px">
<f:facet name="header">
<h:outputText value="disponivel" />
</f:facet>
<h:dataTable id="src" columns="1" value="#{produtoOferecidoBean.produtosDisponiveis}"
var="fm" footerClass="footerClass">
<h:column>
<a4j:outputPanel
style="width:100px;border:1px solid gray;padding:2px"
layout="block">
<rich:dragSupport dragIndicator=":indicator"
dragType="PRODUTO" dragValue="#{fm}">
<rich:dndParam name="label" value="#{fm.nome}" />
</rich:dragSupport>
<h:outputText value="#{fm.nome}"></h:outputText>
</a4j:outputPanel>
</h:column>
<f:facet name="footer">
<a4j:commandButton action="#{produtoOferecidoBean.reset}" value="Start Over"
reRender="src,phptable" />
</f:facet>
</h:dataTable>
</rich:panel>
<rich:panel styleClass="dropTargetPanel">
<f:facet name="header">
<h:outputText value="Produtos Selecionados" />
</f:facet>
<rich:dropSupport id="php" acceptedTypes="PRODUTO"
dropValue="SELECIONADO"
dropListener="#{produtoOferecidoBean.processDrop}"
reRender="phptable, src">
</rich:dropSupport>
<h:dataTable id="phptable" columns="1"
value="#{produtoOferecidoBean.produtosSelecionados}" var="fm">
<h:column>
<h:outputText value="#{fm.nome}"></h:outputText>
</h:column>
</h:dataTable>
</rich:panel>
</h:panelGrid>
<a4j:outputPanel ajaxRendered="true">
<h:messages></h:messages>
</a4j:outputPanel>
</rich:panel>
Não percebo nenhum erro a não ser a mensagem : org.richfaces.renderkit.html.HtmlRichMessageRenderer doEncodeEnd
Será que alguém já passou por isso??
Qualquer ajuda será bem vinda…
