[jboss-user] [JBoss Seam] - Re: expression language empty parameter

EverlastX1 do-not-reply at jboss.com
Sun Jan 20 14:21:26 EST 2008


thx for this hint.

"You must ensure that the parameters are available not only when the page is rendered, but also when it is sub-
mittedIf the arguments can not be resolved when the page is submitted the action method will be called with
null arguments" --> Stateful bean, right? 

I did read the chapter and adapted my program according to it. I didn't had any luck.
I changed my Project so it looks same like the booking example.

I dont see any difference in my code the the booking example. I am quite frustrated because i don't get any feedback from the system and I am trying all kind of combinations since 3 days now with no luck.

I have a list of results If the user clicks on an author from the list the page is redisplay according to the parameter passed in the function call searchByCreator();


  | 
  | <h:form id="searchForm">
  |    <h:inputText id="value" required="false" value="#{searcher.searchString}"  style=" width : 300px; "/> 
  |    <h:commandButton id="search" value="search"
  | action="#{searcher.search}" style="width : 50px; "/>	 				
  | </h:form>	
  | 
  | 
  | <h:dataTable var="resultElem" value="#{searchResult}">		
  |  <h:column>
  |  <!-- Creator -->	
  |   <h:form styleClass="subText" style="margin:auto;padding:auto; /*just for the IE*/">				
  |     <ui:repeat var="a" value="#{resultElem.doc.creator}" > 				
  |       <h:commandLink value="[#{a}]," action="#{searcher.searchByCreator(a)}" />			
  |     </ui:repeat>	
  |    </h:form>
  | </h:column>
  | </h:dataTable>
  | 


  | @Stateful
  | @Name("searcher")
  | public class SearchBean implements Search, Serializable {
  | 
  | 	@DataModel
  | 	private List<SearchResult> searchResult;
  | 	
  | 	public void searchByCreator(String creator){
  |           ....
  | 	}
  | 	...
  | 
  | 	@Destroy 
  | 	@Remove
  | 	public void destroy() {}
  | 
  | 

if I use h:commandLink my function is never called the page is just rerendered

If I user s:link the function gets called but the parameter is empty!

If i put the h:command link outside the ui:repeat this makes no difference the result is the same like above. 

If I use the in second loop a h:dataTable i have the same result as above 

simplified system:

If i make a function call outside the DataTable id doesn't work always


  | inside the search form 
  | <h:form id="searchForm">
  |    <h:inputText id="value" required="false" value="#{searcher.searchString}"  style=" width : 300px; "/> 
  |    <h:commandButton id="search" value="search"
  | action="#{searcher.search}" style="width : 50px; "/>	 	
  | <h:commandLink  styleClass="subText" value="#{searcher.searchString}," action="#{searcher.searchByKeyword(searcher.searchString)}" />			
  | Does work
  | </h:form>	
  | 


Two Forms

  | <h:form id="searchForm">
  |    <h:inputText id="value" required="false" value="#{searcher.searchString}"  style=" width : 300px; "/> 
  |    <h:commandButton id="search" value="search"
  | action="#{searcher.search}" style="width : 50px; "/>	 	
  | <h:commandLink  styleClass="subText" value="#{searcher.searchString}," 
  | </h:form>
  | 
  | <h:form>
  | action="#{searcher.searchByKeyword(searcher.searchString)}" />		
  | don't work	
  | </h:form>	
  | 
  | 

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

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



More information about the jboss-user mailing list