Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
JSP - A mailing list about Java Server Pages specification and reference
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Subject: Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Subject: Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
- need help passing UI params to SFSB

- need help passing UI params to SFSB

2007-11-01       - By asookazian

 Back
so I tried @(protected) with pages.xml config and failed (value was not
coming thru, so it was null).

now I'm trying the "regular" JSF way per pg. 292 of the Geary/horstmann 2nd
edition.

Anything wrong with the following code?  this doesn't work either (I'm viewing
the params object values in the eclipse debugger and it's null):

<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 != null and myAuditList.rowCount > 0}"
 |               styleClass="dataTable" rowClasses="oddRow, evenRow" 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="employeeName" value="#{myRow[0].id.employeeName}
"/>    
 |               <h:inputHidden id="employeeNameHidden" 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 id="accountApprovedRB" value="#{myRow[1]
.icomsAccountApproved}" onclick="processNote(this, #{myAuditList.getRowIndex()},
'accountApproved');checkForSubmit(#{myAuditList.getRowIndex()})">  
 |               <f:selectItems value="#{securityAuditAction
.securityAuditRadioButtons}" />
 |             </h:selectOneRadio>        
 |             <h:graphicImage id="acctGraphic" value="/img/icon_edit.gif" onclick=
"editNote(#{myAuditList.getRowIndex()}, 'accountApproved');" style="visibility
:hidden"/>    
 |             </h:column>
 |                      
 |             <h:column>
 |               <f:facet name="header">Security Level Approved?</f:facet>
 |               <h:selectOneRadio id="securityLevelApprovedRB" value="#{myRow[1]
.securityLevelApproved}" onclick="processNote(this, #{myAuditList.getRowIndex()}
, 'secLevelApproved');checkForSubmit(#{myAuditList.getRowIndex()})">  
 |               <f:selectItems value="#{securityAuditAction
.securityAuditRadioButtons}" />
 |             </h:selectOneRadio>  
 |             <h:graphicImage id="securityLevelGraphic" value="/img/icon_edit.gif"
onclick="editNote(#{myAuditList.getRowIndex()}, 'secLevelApproved');" style=
"visibility:hidden"/>            
 |             </h:column>
 |            
 |             <h:column>
 |               <f:facet name="header">Adjustment Limit Approved?</f:facet>
 |               <h:selectOneRadio id="adjustmentLimitApprovedRB" value="#{myRow[1]
.adjustmentLimitApproved}" onclick="processNote(this, #{myAuditList.getRowIndex(
)}, 'adjLimitApproved');checkForSubmit(#{myAuditList.getRowIndex()})">  
 |               <f:selectItems value="#{securityAuditAction
.securityAuditRadioButtons}" />
 |             </h:selectOneRadio>    
 |             <h:graphicImage id="adjLimitGraphic" value="/img/icon_edit.gif"
onclick="editNote(#{myAuditList.getRowIndex()}, 'adjLimitApproved');" style=
"visibility:hidden"/>          
 |             </h:column>          
 |            
 |             <h:column>
 |               <h:commandButton id="submitEmployee" value="Submit" action="#
{securityAuditAction.submit}" style="visibility:hidden">
 |                 <f:param name="securityAuditRowNum" value="#{myAuditList
.getRowIndex()}"/>
 |               </h:commandButton>              
 |             </h:column>
 |           </h:dataTable>
 |                  
 |     </h:form>

SFSB:

public void submit() {
 |      
 |       //check to see if there are any notes for each radio button for this
emploee/row
 |       //then upddate/insert accordingly
 |      
 |       //TO DO: use @(protected) injection instead of facescontext...
 |       FacesContext context = FacesContext.getCurrentInstance();
 |       Map<String, String> params = context.getExternalContext()
.getRequestParameterMap();
 |       int rowNum = Integer.parseInt(params.get("securityAuditRowNum")==null?
"":params.get("securityAuditRowNum"));
 |      
 |       for (int i = 0; i < 3; i++) {
 |         TblSecurityAuditNote note = myNotes[rowNum];
 |         if (note != null) {
 |           log.info("myNotes["+rowNum+"]["+i+"]: noteText = " + note
.getNoteText());
 |           //em.persist(myNotes[rowNum]);
 |         }
 |       }
 | }

seems to me this should be very straightforward...  I even hard-coded the value
like:

<f:param name="securityAuditRowNum" value="bigmomma"/>

value for params map was null in debugger variables...

do you HAVE to set some config code in the pages.xml?  if so, the book didn't
mention anything about that as far as managed bean JSF configurations for
request params passing...

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

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode
=reply&p=4101010
__ ____ ____ ____ ____ ____ ____ ____ ____ ____
jboss-user mailing list
jboss-user@(protected)
https://lists.jboss.org/mailman/listinfo/jboss-user

©2008 junlu.com - Jax Systems, LLC, U.S.A.