This content has been marked as final.
Show 17 replies
-
1. Re: a4j:jsFunction and var in datatable
tkalactomo Apr 16, 2008 2:43 AM (in response to tkalactomo)Can someone tell is this a bug?
-
2. Re: a4j:jsFunction and var in datatable
tkalactomo Apr 17, 2008 3:37 AM (in response to tkalactomo)Please,
help would be very appreciated! -
3. Re: a4j:jsFunction and var in datatable
tkalactomo Apr 21, 2008 9:13 AM (in response to tkalactomo)Please,
help would be very appreciated! -
4. Re: a4j:jsFunction and var in datatable
ilya_shaikovsky Apr 21, 2008 9:41 AM (in response to tkalactomo)provide full page code instead of jsut pieces.. Are your jsFunction defined inside the table?
-
5. Re: a4j:jsFunction and var in datatable
tkalactomo Apr 22, 2008 2:40 AM (in response to tkalactomo)"ilya_shaikovsky" wrote:
provide full page code instead of jsut pieces.. Are your jsFunction defined inside the table?
Page has a lot of code...But here is the most important fragments of datatable and some logic inside a column.
But yes,jsFunction is defined inside a datatable(inside a rich column),
and let say that method which calls that jsFunction accepts as an attribute
a current var in that datatable...a problem is that var isn't a current..it's last,even the row key var has a 'last' value.<r:dataTable id="tablicaStavkeZarada" width="100%" onRowMouseOver="this.style.backgroundColor='#F1F1F1'" onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'" cellpadding="0" cellspacing="0" var="v" rowKeyVar="rb" value="#{stavkaZaposlenik.stavkeZarada}" rendered="#{stavkaZaposlenik.id != 0}"> ...
<r:column styleClass="kolonaCentriranoGore"> <t:panelGrid columns="1" cellpadding="0" cellspacing="0"> <t:panelGrid columns="3" cellpadding="0" cellspacing="0"> <t:inputText tabindex="#{fokus.tabIndexDatatable()}" id="uvjetVrstaPrimanja" value="#{traziVrstaPrimanja.uvjet}" size="1" onkeypress="return callJsFunctionIfEnterIsPressed(event,'js_vrstaPrimanja');" /> <a:jsFunction eventsQueue="red" name="js_vrstaPrimanja" focus="forma:tablicaStavkeZarada:#{rb}:uvjetVrstaPrimanja" action="#{obradaStavkaZarade.dodajVrstaPrimanja(v,traziVrstaPrimanja,0)}" reRender="tablicaStavkeZarada"> </a:jsFunction> <t:commandButton image="/slike/ikone/otvoriSifarnik.png" title="#{messages['traziVrstaPrimanja']}" tabindex="-1" style="cursor:pointer" action="#{teleport.inConversationWithTransition(v,'traziVrstaPrimanja')}" /> </t:panelGrid> </t:panelGrid> </r:column>
-
6. Re: a4j:jsFunction and var in datatable
tkalactomo Apr 23, 2008 2:20 AM (in response to tkalactomo)and we are using richfaces 3.1.4.GA
-
7. Re: a4j:jsFunction and var in datatable
tkalactomo Apr 27, 2008 8:23 AM (in response to tkalactomo)opened the jira issue http://jira.jboss.org/jira/browse/AJSF-137
-
8. Re: a4j:jsFunction and var in datatable
ilya_shaikovsky Apr 28, 2008 9:46 AM (in response to tkalactomo)in future add the bugs only to RF jira.
-
9. Re: a4j:jsFunction and var in datatable
ilya_shaikovsky Apr 28, 2008 9:48 AM (in response to tkalactomo)also please check under 3.1.5 release please. (new url - http://jira.jboss.org/jira/browse/RF-3282 )
-
10. Re: a4j:jsFunction and var in datatable
tkalactomo Apr 28, 2008 5:14 PM (in response to tkalactomo)"ilya_shaikovsky" wrote:
in future add the bugs only to RF jira.
O.K., in the future, it will be like that.
also please check under 3.1.5 release please
Tried to run the example with richfaces 3.1.5 GA, but the problem still exists... -
11. Re: a4j:jsFunction and var in datatable
strannik Sep 10, 2009 6:52 PM (in response to tkalactomo)Was it fixed in 3.2.1?
I've read RF-3282 and Alexander Smirnov noteYes, of course - this code generated a lot of JavaScript functions with same name. Last of them will overwrite all other.
For a right functionality, attribute "name" should be unique for an all rows.
But it doesn't make sense to use different names for the function. Because we want that our JS function catches up all calls for the function with specific name. -
12. Re: a4j:jsFunction and var in datatable
nbelaevski Sep 10, 2009 7:24 PM (in response to tkalactomo)"Strannik" wrote:
Was it fixed in 3.2.1?
I've read RF-3282 and Alexander Smirnov noteYes, of course - this code generated a lot of JavaScript functions with same name. Last of them will overwrite all other.
For a right functionality, attribute "name" should be unique for an all rows.
But it doesn't make sense to use different names for the function. Because we want that our JS function catches up all calls for the function with specific name.
That's not a bug really; either put functions to array or declare a single one and move it outside the table. -
13. Re: a4j:jsFunction and var in datatable
strannik Oct 7, 2009 12:10 PM (in response to tkalactomo)I would love to ... but have no clue how to do that. My code
<rich:dataTable value="#{types}" id="types" var="type" > <rich:column sortBy="#{type.name}"> <f:facet name="header"> <h:outputText value="#{msg['type.name']}" /> </f:facet> <h:outputText value="#{type.name}" /> </rich:column> <rich:column> <a4j:commandLink oncomplete="Richfaces.showModalPanel('confirmation');" reRender="confirmation"> <a4j:actionparam name="action" value="#{msg['action.delete']}" assignTo="#{confirmationBean.action}" /> <a4j:actionparam name="subject" value="#{type.name}" assignTo="#{confirmationBean.subject}" /> <h:graphicImage url="/resources/images/delete.jpg" alt="#{msg['buttons.delete']}" /> </a4j:commandLink> <a4j:jsFunction name="processAction" reRender="types" action="#{adminController.deleteType(type)}" /> </rich:column> <f:facet name="footer"> <rich:datascroller></rich:datascroller> </f:facet> </rich:dataTable>
So my jsFunction makes a call to controller and needs type parameter (current row variable). If I move jsFunction outside of the datatable type will not be initialized. -
14. Re: a4j:jsFunction and var in datatable
ilya_shaikovsky Oct 7, 2009 3:03 PM (in response to tkalactomo)but you could pass the parameter from actual call using f:param.