[jboss-user] [JBoss Seam] - Re: accessing hidden field values in a SFSB

asookazian do-not-reply at jboss.com
Mon Oct 22 16:40:53 EDT 2007


thx for reply.  I tried the <input type="hidden" .../> as below, but the setter methods are still not being called for these hidden fields.  The way I have to reference the hidden fields is different now (no a4jForm prepended to it).  

setNoteText() is being called ok.

<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
  |                       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  | <ui:composition xmlns="http://www.w3.org/1999/xhtml"
  |                 xmlns:s="http://jboss.com/products/seam/taglib"
  |                 xmlns:ui="http://java.sun.com/jsf/facelets"
  |                 xmlns:f="http://java.sun.com/jsf/core"
  |                 xmlns:h="http://java.sun.com/jsf/html"
  |                 xmlns:rich="http://richfaces.ajax4jsf.org/rich"
  |                 xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"           
  |                 template="layout/template.xhtml">
  |                 
  | 
  | 
  | <ui:define name="body">
  | 
  | 	<script type="text/javascript">
  | 	
  | 	function processNote(rButton, rowIndex, colName) {
  | 				
  | 		//if they clicked no, popup modal response window for note
  | 		if (rButton.value == 'false') {		
  | 			//if condition below is optional; there are no other rButtons on the form at this time...
  | 			if	(colName == 'accountApproved' || colName == 'secLevelApproved' || colName == 'adjLimitApproved') {
  | 				
  | 				siteId = document.getElementById("mainForm:dataTable1:"+rowIndex+":siteId").value;							
  | 				employeeNumber = document.getElementById("mainForm:dataTable1:"+rowIndex+":employeeNumber").value;
  | 				
  | 				/*
  | 				alert('rowIndex = ' + rowIndex);
  | 				alert('siteId = ' + siteId);				
  | 				alert('employeeNumber = ' + employeeNumber);				
  | 				alert('colName = ' + colName);
  | 				*/
  | 				
  | 				Richfaces.showModalPanel('mp',{width:450, top:200, param1: rowIndex, param2: colName, param3: siteId, param4: employeeNumber});
  | 				
  | 				//set hidden variables in modalPanel form
  | 				document.getElementById("rowIndex").value = rowIndex;
  | 				document.getElementById("colName").value = colName;
  | 				document.getElementById("siteId").value = siteId;
  | 				document.getElementById("employeeNumber").value = employeeNumber;
  | 				
  | 			}
  | 			
  | 		}
  | 	}
  | 	
  | 	function editNote(obj) {
  | 			
  | 		value1 = 'Please edit your note';
  | 		Richfaces.showModalPanel('mp',{width:450, top:200, param1: value1});
  | 		
  | 	}
  | 		
  | 	</script>
  | 			
  |     <h:messages globalOnly="true" styleClass="message"/>
  |     
  |     <rich:modalPanel  id="mp" minHeight="200" minWidth="450" 
  |             height="200" width="500" zindex="2000" onshow="alert(event.parameters.param1); alert(event.parameters.param2); alert(event.parameters.param3); alert(event.parameters.param4)">
  |             <f:facet name="header">
  |                 <h:outputText value="#{noteAction.header}" />
  |             </f:facet>
  |            <f:facet name="controls">
  |                 <h:graphicImage value="/img/icon_edit.gif" style="cursor:pointer" onclick="Richfaces.hideModalPanel('mp')" />
  |             </f:facet>
  |             <a4j:form id="a4jForm"> 		
  | 				<h:inputText value="#{noteAction.noteText}"/>					
  | 				<input type="hidden" id="rowIndex" 			value="noteAction.rowIndex"/>			
  | 				<input type="hidden" id="colName" 			value="noteAction.colName"/>
  | 				<input type="hidden" id="siteId" 			value="noteAction.siteId"/>			
  | 				<input type="hidden" id="employeeNumber" 	value="noteAction.employeeNumber"/>
  | 				<a4j:commandButton value="submit" action="#{noteAction.submit}" onclick="Richfaces.hideModalPanel('mp')"/>					
  | 			</a4j:form>
  |     </rich:modalPanel>
  |     
  |     <h:form>
  |     	<h:inputText value="#{securityAuditAction.networkId}"/>
  |     	<h:commandButton value="Submit"/>    
  |     </h:form>
  |     
  |     <h:form id="mainForm">     	    		 
  |     		<h:outputText value="No Direct Reports" rendered="#{myAuditList != null and myAuditList.rowCount==0}"/>
  | 	    	<h:dataTable id="dataTable1" value="#{myAuditList}" var="myRow" rendered="#{myAuditList.rowCount>0}"
  | 	    				 bgcolor="#F1F1F1" border="10" width="100%" cellpadding="0" cellspacing="0" 
  | 	    				 dir="LTR" frame="hsides"> 	    	  
  | 	    		<h:column>
  | 		    		<f:facet name="header">Employee Name</f:facet>	    		
  | 		    		
  | 		    		<!-- siteId and employeeNumber hidden fields are used for all radio buttons -->
  | 		    		<h:outputText id="empName" value="#{myRow[0].id.employeeName}"/>		   		    		
  | 		    		<h:inputHidden id="siteId" value="#{myRow[0].id.siteId}"/> 		
  | 		    		<h:inputHidden id="employeeNumber" value="#{myRow[0].id.employeeNumber}"/>
  | 	    		</h:column>
  | 	    		
  | 	    		<h:column>
  | 		    		<f:facet name="header">SiteId</f:facet>	    		
  | 		    		
  | 		    		<h:outputText value="#{myRow[0].id.siteId}"/>		   		    		
  | 	    		</h:column>
  | 	    		
  | 	    		<h:column>
  | 		    		<f:facet name="header">EmployeeNumber</f:facet>	    		
  | 		    		
  | 		    		<h:outputText value="#{myRow[0].id.employeeNumber}"/>		   		    		
  | 	    		</h:column>
  | 	    		
  | 		    	<h:column>
  | 	    			<f:facet name="header">Account Approved?</f:facet>
  | 	    			
  | 	    			<h:selectOneRadio value="#{myRow[1].icomsAccountApproved}" onclick="processNote(this, #{myAuditList.getRowIndex()}, 'accountApproved')">  
  | 						<f:selectItems value="#{securityAuditAction.securityAuditRadioButtons}" />
  | 					</h:selectOneRadio>	    	
  | 					<h:graphicImage value="/img/icon_edit.gif" onclick="editNote(this);"/>		
  | 	    		</h:column>
  | 	    			    		
  | 	    		<h:column>
  | 	    			<f:facet name="header">Security Level Approved?</f:facet>
  | 	    			<h:selectOneRadio value="#{myRow[1].securityLevelApproved}" onclick="processNote(this, #{myAuditList.getRowIndex()}, 'secLevelApproved');">  
  | 						<f:selectItems value="#{securityAuditAction.securityAuditRadioButtons}" />
  | 					</h:selectOneRadio>	
  | 					<h:graphicImage value="/img/icon_edit.gif" onclick="editNote(this);"/>   			
  | 	    		</h:column>
  | 	    		
  | 	    		<h:column>
  | 	    			<f:facet name="header">Adjustment Limit Approved?</f:facet>
  | 	    			<h:selectOneRadio value="#{myRow[1].adjustmentLimitApproved}" onclick="processNote(this, #{myAuditList.getRowIndex()}, 'adjLimitApproved');">  
  | 						<f:selectItems value="#{securityAuditAction.securityAuditRadioButtons}" />
  | 					</h:selectOneRadio>	  
  | 					<h:graphicImage value="/img/icon_edit.gif" onclick="editNote(this);"/> 			
  | 	    		</h:column>	    		
  | 	    	</h:dataTable>
  | 	    	
  | 	    	<h:commandButton value="submit" action="#{securityAuditAction.submit}" rendered="#{myAuditList.rowCount>0}"/> 
  | 	    		    	
  | 	</h:form>
  |         
  | </ui:define> 
  | </ui:composition>

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4097618#4097618

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4097618



More information about the jboss-user mailing list