f:param呈现时返回null

时间:2019-07-08 21:59:11

标签: jsf primefaces

我在dataGrid中有此代码。呈现时,f:param返回null。如果单击private void LoadCSV() { string delimiter = ","; string tablename = "ImportInfo"; string filename = FilePass; DataSet DataSet1 = new DataSet(); StreamReader sr = new StreamReader(filename); DataSet1.Tables.Add(tablename); DataSet1.Tables[tablename].Columns.Add("A_U_D", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Item_ID", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Menu_Item_Name", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Button_Line_1", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Button_Line_2", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Kitchen_Text", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Price_Levels", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Product_Class_ID", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Revenue_Cat_ID", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Tax_Group_ID", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Security_Level_ID", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Report_Cat_ID", typeof(string)); DataSet1.Tables[tablename].Columns.Add("By_Weight", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Tare_Weight", typeof(string)); DataSet1.Tables[tablename].Columns.Add("SKUs", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Bargun_Code", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Cost", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Blank1", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Prompt_For_Price", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Print_On_Check", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Discountable", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Void_Flag", typeof(string)); DataSet1.Tables[tablename].Columns.Add("The_86ed_Flag", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Tax_Included", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Menu_Item_Group_ID", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Receipt_Text", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Allow_Price_Override", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Blank2", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Choice_Group", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Kitchen_Printer_Logic", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Covers", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Store_ID", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Kitchen_Video_Text", typeof(string)); DataSet1.Tables[tablename].Columns.Add("KDS_Dept_ID", typeof(string)); DataSet1.Tables[tablename].Columns.Add("KDS_Cat_ID", typeof(string)); DataSet1.Tables[tablename].Columns.Add("KDS_Cook_Time", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Store_Price_Level", typeof(string)); DataSet1.Tables[tablename].Columns.Add("Default_Image_ID", typeof(string)); string allData0 = sr.ReadToEnd(); Regex yourRegex = new Regex(@"(?<=\{[^}]*),(?=[^}]*\})", RegexOptions.Compiled); string allData1 = yourRegex.Replace(allData0, "»"); Regex yourRegex2 = new Regex(("\\\"(.*?)\\\""), RegexOptions.Compiled); string allData = yourRegex2.Replace(allData1, m => m.Value.Replace(",", " ")); allData.Replace("\"A\"", "A"); string[] rows = allData.Split("\r".ToCharArray()); foreach (string r in rows) { string[] items = r.Split(delimiter.ToCharArray()); DataSet1.Tables[tablename].Rows.Add(items); this.editgrid.ItemsSource = DataSet1.Tables[0].DefaultView; dc.SubmitChanges(); } } f:param,则返回网格中特定项目的正确ID。渲染时如何强制f:param返回正确的ID。我需要实现这一点:我在dataGrid中向用户显示多个项目。我也使用pagging。我希望用户能够为比较表选择多个项目。所有这一切。问题是当用户在数据网格中来回移动时。即使用户之前选择了p:selectBooleanCheckbox,也始终未选中

p:selectBooleanCheckbox

0 个答案:

没有答案