简体   繁体   中英

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. 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. Form is submitting values only if row expansion is in expanded 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. This is causing non expanded rows to send values as NULL instead of default values.

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...

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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