SuggestionBox não acessa o var

0 respostas
S

Olá amigos

não estou conseguindo acessar o var do suggestionbox para passar um parametro, informo que o meu suggestionbox herda do framework:

suggestion do framework

<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:t="http://myfaces.apache.org/tomahawk"
    xmlns:mppbfunc="http://www.xx.xx.xxx.br/facelets/func">
 
	<ui:composition>
	
	         <c:set var="idValue" value="#{xxxxfunc:defaultIfNull(id, 'id_suggestionbox')}"/>
	         <c:set var="renderedValue" value="#{xxxxfunc:defaultIfNull(rendered, 'true')}"/>
	         
	         
			 <a4j:region renderRegionOnly="true" rendered="#{renderedValue}"> 
	       
		         <script type="text/javascript">
		            function printObjectsSelected_#{idValue}(output, sgcomponent) {
		                output.value = sgcomponent.getSelectedItems().pluck('#{targetProperty}');
		            }
		        </script>
		            <rich:suggestionbox 
		                width="400"
			            usingSuggestObjects="true"
			            onobjectchange="printObjectsSelected_#{idValue}(#{rich:element(target)}, #{rich:component(idValue)});"
			            suggestionAction="#{bean[action]}" var="item"
			            for="#{idValue}_suggestion_input" fetchValue="#{fetchValue}"
			            id="#{idValue}"> 
			            <h:column>
			                <h:outputText value="#{xxxxfunc:objExpression(item, expression)}" 
			                              onblur="if(this.value == ''){#{rich:element(target)}.value= '';}"/>
			            </h:column>
			             <ui:insert/>
			        </rich:suggestionbox>
			        <div id="#{idValue}_text_div">
			            <h:panelGrid columns="3" border="0" cellpadding="0" cellspacing="0"  >
				                <h:inputText style="margin: 0px; " size="40" id="#{idValue}_suggestion_input" >
				                    
				                </h:inputText>
				                <h:graphicImage value="/images/botoes/consultar.png"
				                    onclick="#{rich:component(idValue)}.callSuggestion(true)"
				                    style="cursor:pointer;" 
				                    alt="Pesquisar" title="Pesquisar"/>
				                <h:graphicImage value="/images/botoes/limpar.png"
				                    style="cursor:pointer; width:20px; height: 20px;"
				                    onclick="document.getElementById('#{idValue}_text_div').getElementsByTagName('input')[0].value = ''; document.getElementById('#{target}').value = '';"
				                    alt="Limpar" title="Limpar"/>
			            </h:panelGrid>
		            </div>
		            <script type="text/javascript">
			            function setup_#{idValue}() {
			            	document.getElementById('#{idValue}_text_div').getElementsByTagName('input')[0].value = '#{defaultValue}';
			            }
			            setup_#{idValue}();
		            </script>
	    </a4j:region>
    
	</ui:composition>
</jsp:root>

mu suggestion do xhtml:

<h:inputHidden id="clienteid_suggestion"  value="#{ordemServicoMbean.ordemServico.cliente.id}" required="true"/>
           <h:panelGrid columns="8" id="inputs">

               <h:outputLabel value="Cliente"  />
               <xxxx:suggestionbox  id="cliente_suggestionbox"
                                    bean="#{clienteMBean}"
                                    action="autocomplete"
                                    target="SalvarForm:clienteid_suggestion"
                                    targetProperty="{id}"
                                    defaultValue="#{xxxxfunc:propertyIgnoreNull(ordemServicoMBean, 'ordemServico.cliente.nome')}"
                                    expression="{nome}{id}"> 
                              
                                    <a4j:support event="onselect"
                                    id="nomecliente"
                                    reRender="inputs"  action="#{ordemServicoMBean.mostraCliente}" ajaxSingle="false">                                    
                                    <f:param  name="clienteid" value="{var.id}"/>
                                    </a4j:support>                                     

                </xxxx:suggestionbox>

não estou conseguindo acessar esta id dentro do <a4j:support
value="{var.id}"

alguém pode ajudar?

Muito obrigado

Silvio Guedes

Criado 16 de abril de 2011
Respostas 0
Participantes 1