-
1. Re: a4j:commandButton not working in facelet
nbelaevski Dec 23, 2009 4:33 PM (in response to waq) -
2. Re: a4j:commandButton not working in facelet
waq Dec 24, 2009 5:00 AM (in response to nbelaevski)i tried it but can't find the solution. -
3. Re: a4j:commandButton not working in facelet
nbelaevski Dec 24, 2009 6:41 AM (in response to waq)Please describe what you've tried, and what were the results? -
4. Re: a4j:commandButton not working in facelet
waq Dec 24, 2009 6:55 AM (in response to nbelaevski)ok actually its an online dictionary. User enters the word and press the search button (ajax button). Ajax request populate the datatable with the meaning of the searched word. Everything works fine till here.
now there is a button (ajax button) after every meaning in the datatable to show the detail of the word. When the button is pressed, detail should be shown in the modelPanel. Model panel is opening but nothing is displaying on it.
-
5. Re: a4j:commandButton not working in facelet
yyq2009 Dec 25, 2009 2:22 AM (in response to waq)You should paste some brief code here. It may be more clearly for your description of the problem. -
6. Re: a4j:commandButton not working in facelet
waq Dec 28, 2009 4:28 AM (in response to yyq2009)<
html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
xmlns:t="http://myfaces.apache.org/tomahawk" xml:lang="en" lang="en">
<ui:define name="body_edit">
<body
onload="javascript:document.getElementById('search_form:search_fld').focus()">
<f:view>
<h:form id="search_form">
<a4j:region selfRendered="true" id="word_region">
<h:inputText id="search_fld" value="#{dictionary.word}" size="50" />
<a4j:commandButton value="Search"
action="#{dictionary.searchWord}"
reRender="detail_table, table_div" id="searchBtn" />
<h:selectOneRadio id="myRadio" value="#{dictionary.search_filter}"
styleClass="text" style="font-style: oblique;">
<f:selectItem itemValue="exact" itemLabel="Exactly" />
<f:selectItem itemValue="start_with" itemLabel="Start with" />
<f:selectItem itemValue="contain" itemLabel="Contain" />
</h:selectOneRadio>
</a4j:region>
<a4j:outputPanel id="table_div" layout="none">
<h:dataTable id="detail_table" var="dic" border="0"
rowClasses="even_rows, odd_rows" cellpadding="2" cellspacing="1"
rows="5" value="#{dictionary.dictionayList}"
binding="#{dictionary.dataTable}">
......
<h:column headerClass="datatable_width_detail">
<f:facet name="header">
<h:outputText value="" />
</f:facet>
<a4j:commandLink action="#{dictionary.showDetails}"
value="Detail" oncomplete="Richfaces.showModalPanel('panel')"
reRender="panel" />
</h:column>
</h:dataTable>
<br />
<rich:datascroller align="center" for="detail_table" maxPages="20"
renderIfSinglePage="false">
</rich:datascroller>
</a4j:outputPanel>
<t:saveState value="#{dictionary.dictionayList}" />
<rich:modalPanel id="panel" width="600" height="300"
autosized="true">
.....
</rich:modalPanel>
-
7. Re: a4j:commandButton not working in facelet
nbelaevski Dec 28, 2009 10:03 AM (in response to waq)What's the scope of "dictionary" bean? -
8. Re: a4j:commandButton not working in facelet
waq Dec 28, 2009 11:00 AM (in response to nbelaevski)it's 'request' -
9. Re: a4j:commandButton not working in facelet
nbelaevski Dec 28, 2009 6:02 PM (in response to waq)Please try removing a4j:region. -
10. Re: a4j:commandButton not working in facelet
waq Dec 29, 2009 5:27 AM (in response to nbelaevski)nbelaevski wrote:
same result
-
11. Re: a4j:commandButton not working in facelet
nbelaevski Dec 29, 2009 10:22 AM (in response to waq)Hmm, I guess this is happening for the same reason as: https://jira.jboss.org/jira/browse/RF-3314
Can you try with session-scoped bean?
-
12. Re: a4j:commandButton not working in facelet
yyq2009 Dec 30, 2009 8:21 AM (in response to waq)Hi, Waqas Arshad, I think your search button shuld be a non-ajax button, then after clicked the search button, the whole page will be refreshed, and in server side the <t:saveState/> knows what to be saved. If do it ajax model, maybe becuase of the tag <t:saveState/> isn't a form element, so when the form submitted, it wasn't sent to server, then the server still didn't know you want to save a object.
You should send this to server, so another solution is set id(saveStateID) attribute to the <s:saveState/> and add "process='saveStateID'" to a4j:commandButton, let the server side to know you want to save something.
Just my opinion.
Good luck.
-
13. Re: a4j:commandButton not working in facelet
waq Dec 31, 2009 6:51 AM (in response to yyq2009)Nick solution works but i don't want to keep it in the session scope. I tried replacing t:saveState with a4j:keepAlive. After replacing, action calls but when i fetch the selected row from the HTMLDataTable it throws exception
is a4j:keepAlive = session scope?
I ll also try Daniel solution and then let you know
-
14. Re: a4j:commandButton not working in facelet
waq Jan 5, 2010 8:48 AM (in response to waq)Okay Daniel but process is used in conjunction with ajaxSingle. Am i right? Can you please ellobrate how to use this process attribute or refer me to some example?
Secondly my last question, is keepAlive = session? and why it throws exception when i use keepAlive?