简体   繁体   English

Prime faces 表格行扩展默认值

[英]Prime faces table row expansion default value

I have table with multiple rows inside form.我的表格中有多行表格。 The table has rowexpansion tag which is in non expanded mode by default.该表具有行扩展标签,默认情况下处于非扩展模式。 The rowexpansion has panel containing multiple input elements like redio button,text field. rowexpansion 的面板包含多个输入元素,如重做按钮、文本字段。 Input fileds has default values.输入字段具有默认值。 By default first redio button is selected.默认情况下,第一个重播按钮被选中。

Now if I submit form containing table with rowexpansion as non expanded mode, form is submitting values as NULL for those input elements (Redio button value is NULL instead of default selection) since row expansion was default non expanded.现在,如果我提交包含行扩展为非扩展模式的表格的表单,表单将提交值作为 NULL 用于这些输入元素(重复按钮值是 NULL 而不是默认选择) ,因为行扩展是默认的非扩展。 Form is submitting values only if row expansion is in expanded state.仅当行扩展位于扩展 state 中时,表单才提交值。 (First redio button as default selection) (第一个重播按钮作为默认选择)

I could have set all rows in expanded state all time by setting property but rows should not be in expanded state default only if user has explicitly expanded it.我可以通过设置属性在扩展的 state 中设置所有行,但只有当用户明确扩展它时,行才应该在扩展的 state 默认值中。 This is causing non expanded rows to send values as NULL instead of default values.这导致非扩展行将值作为 NULL 而不是默认值发送。

How can I set all rows in expanded state through JavaScript before submitting form so that all rows will be in expanded state while form gets submitted and default values for non expanded rows will get submitted instead of NULL. How can I set all rows in expanded state through JavaScript before submitting form so that all rows will be in expanded state while form gets submitted and default values for non expanded rows will get submitted instead of NULL.

在此处输入图像描述

Personally I don't like this use of Row Expansion for Data Entry as its really not what it was meant for.就我个人而言,我不喜欢将行扩展用于数据输入,因为它确实不是它的本意。

But if you want to expand all rows you can do the following JavaScript but use at your own risk...但是,如果您想扩展所有行,您可以执行以下 JavaScript 但使用风险自负...

$('.ui-row-toggler').trigger('click');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM