Hi,
i have hidden variable which is update when the row is selected in GridView, and i need this value in java script, we are trying to modify in igf_grid.js
this.selectRow=function(domNode,select){
......}}this.customFLT()};
in the customFLT() method just i am tring to print value using alert(of javascript) method, which works fine and i am able to see the value i have seleted from GridView, and i have to use this variable to some other method, when i removed the alert method than i am not able to get the selected value. if i add alert method than its works fine. and i have set " immediate="true" " of hiddenvariable in JSF.
please let me know what is causing this problem.
thanks in advance.
dayananda b v
Hi Bozhidar,
thanks for your replay, i am sorry if the information was given is not clear,
1. have JSF page, contains a GridView and a hidden variable
<ui:hiddenField binding="#{gridviewtest.hiddenField1}" id="hiddenField1" immediate="true"/>
<ig:gridView binding="#{gridviewtest.unitsGrid}" dataSource="#{gridviewtest.units}" id="unitsGrid" pageSize="10" selectedRowsChangeListener="#{gridviewtest.onSelectMethod}" pageChangeListener="#{gridviewtest.onPageSelectUnits}"> <ig:columnSelectRow showSelectAll="true"/>
2. i have java file which is backing bean, where i worte method "onSelectMethod" for row selection listener, where i am assigning value to hidden variable.
public void onSelectRowUnits(SelectedRowsChangeEvent evt) {
getHiddenField1().setValue("50"); // here i am hard coding the value of 50,
getHiddenField1().setImmediate(true);
SmartRefreshManager srm = SmartRefreshManager.getCurrentInstance(); srm.removeSmartRefreshIds(getHiddenField1().getClientId(FacesContext.getCurrentInstance())); srm.addSmartRefreshId(getHiddenField1().getClientId(FacesContext.getCurrentInstance()));
}
3. and i have modified some code in igf_grid.js, where i am trying to get the value which is assigned to hidden variable
this.selectRow=function(domNode,select){var row=this.getTargetRow(domNode);if(!ig.isNull(row)){if(select){row.select();}else{row.unselect();}var grid=this.getGrid(domNode);if(!ig.isNull(grid)&&grid.isImmediateRowsChangeEvent()){ig.smartSubmit(grid.elm.id,null,null);}}this.customFLT()};
this.customFLT=function(){ // alert("Hidden Field = " + parent.frames.document.getElementById("form1:hiddenField1").value);
var arraystr= parent.frames.document.getElementById("form1:hiddenField1").value; // here i am calling applet method pasing the value of arraystr,
};
my problem is, when i comment alert method in customFLT(in igf_core.js) than arraystr as no value(the value should be 50, which hard coded in on row selection listner), if uncomment alert method than arraystr showing value.
i hope above explanation clear.
Dayananda B V
Hi, dayanandabv!
I'm affraid that the information send is not enough for me to reproduce the scenario. I'll try to think of some solution if you provide me with more detailed information, e.g. parts of your source code and also an explanation of what the idea of this hidden variable is.
Regards!
--Bozhidar
HI,
i guess the hidden variable is not updated, and if put alert message i hope it will take some time to display and click ok, so in the mean time the hidden variable getting update. if this is case what could be answer.