Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DynaForm validation of the first control doesn't work when V6.0 is used #388

Closed
sweetcard opened this issue Jun 20, 2016 · 22 comments
Closed
Assignees
Milestone

Comments

@sweetcard
Copy link

In the following demo, the validation of the first control doesn't work.
The back bean can't get value of the first control either.

The demo link is here:
http://www.primefaces.org/showcase-ext/sections/dynaform/basicUsage.jsf

@Rapster
Copy link
Member

Rapster commented Jun 20, 2016

The demo uses PE 3.2 and validation works just fine. By the way @ova2, is it possible to deploy the new showcase?

Anyway, I just tried with PE 6.0.0 and it works fine as well. Did you see that error on showcase or personal use?

@sweetcard
Copy link
Author

Thank you for your reply.
I found the error in my project not on showcase.
The same code in my project works with PE 5.3 but doesn't work with PE 6.0.0.
I haven't found any error log or output.
Just change the version from 6.0.0 to 4.0.0. It works.

<dependency> <groupId>org.primefaces.extensions</groupId> <artifactId>primefaces-extensions</artifactId> <version>4.0.0</version> </dependency>

@ova2
Copy link
Member

ova2 commented Jun 20, 2016

I can not deploy the new showcase. This does Cagatay Civice, the PrimeFaces lead. I sent him the new WAR a long time ago, but they want to port the Timeline examples from the "old" showcase first.

@ryan-bennett
Copy link

ryan-bennett commented Jul 6, 2016

I can confirm this issue as well in my project. The first input in the dynaform does not have it's value set nor is validated. The same input, when moved to another position is validated correctly.

Workaround, add a control that resolves to a hidden input prior to the first input.

PrimeFaces 6.0.1
PrimeFaces Extensions 6.0.0

@sweetcard
Copy link
Author

@ryan-bennett
The showcase checked out from git can't work either.
I spent hours to solve it but failed.
:(

@ryan-bennett
Copy link

HI Sweetcard

To work around this, add a dynaform section with a dummy type at the start of your model e.g.

Java

DynaFormModel dynaFormModel = new DynaFormModel();
DynaFormRow dummyRow = dynaFormModel.createRegularRow();
dummyRow.addControl(new Field().label(""), "dynaform_dummy", 2, 1);

JSF

<pe:dynaFormControl type="dynaform_dummy">
    <h:inputHidden />
</pe:dynaFormControl>

@sweetcard
Copy link
Author

@ryan-bennett
That's COOOOL!
It works for me.
You save me some days.
Thank you very much.
I hope the issue could be fixed soon.
Thank you again.

@ryan-bennett
Copy link

Glad it helped.

@Rapster
Copy link
Member

Rapster commented Jul 6, 2016

Am I wrong to say DynaForm works fine in the current online showcase? It's hard to believe the contrary... The only difference I'd see would be PF version you guys are using. Although, I raised an issue which might be related of what you're talking: http://forum.primefaces.org/viewtopic.php?f=14&t=46195&p=144038#p144038

Is your first input a composite or a basic input?

@sweetcard
Copy link
Author

sweetcard commented Jul 6, 2016

@Rapster
The showcase checked out from github does't work.
When submit is clicked, the validation message is not correct.
Check the attachment please.

pf-ext

@Rapster
Copy link
Member

Rapster commented Jul 6, 2016

I did reproduce the problem with the current branch. I'll check that as soon as I have some time to do so

@Rapster Rapster reopened this Jul 6, 2016
@Rapster Rapster self-assigned this Jul 6, 2016
@sweetcard
Copy link
Author

@Rapster
Excellent 💯 👍

@ova2 ova2 added this to the 6.1.0 milestone Jul 6, 2016
@ova2
Copy link
Member

ova2 commented Jul 6, 2016

@Rapster When you fixed this issue (regression), I will release the current state. One of my clients uses this component and will find this issue too. That's for sure :-).

Thanks for your effort!

@Rapster
Copy link
Member

Rapster commented Jul 7, 2016

I might need your help Oleg on this one... There is a lot of things in this component that I don't simply understand as the mechanic is quite complex :/

@ova2
Copy link
Member

ova2 commented Jul 7, 2016

Saidly, but I don't have any time currently and I don't do much JSF development. More JavaScript. Please try to follow your last changes. The component worked fine bevor 6.0 release. Thanks.

@Rapster
Copy link
Member

Rapster commented Jul 8, 2016

Yes I know, since I did modification #384 there is few bugs regarding validation... and probably few other. I'll do my best but I'm still curious how many components are present in the JSF component tree. For example, if I take this example http://www.primefaces.org/showcase-ext/sections/dynaform/basicUsage.jsf, the number of component added is equal to the number of dynaFormControl?

@Rapster
Copy link
Member

Rapster commented Jul 11, 2016

@sweetcard could you check again ? I just push a fix. It should work. Although There is still a problem only if you're using DynaForm inside a iterator component such as ui:repeat. In case validation fails, clientId is displayed instead of label value only the first time form is submitted...

@sweetcard
Copy link
Author

@Rapster It works now.
That's very cool.
Thanks for your excellent work. 👍

@Rapster
Copy link
Member

Rapster commented Jul 11, 2016

Cool. @ova2 you can make a new release now ;)

@ova2
Copy link
Member

ova2 commented Jul 11, 2016

@Rapster you are hero :-) Should we release 6.0.1? @tandraschko what do you mean? I could remove Spotlight and you can remove TriStateCheckbox and we're done.

@ova2 ova2 closed this as completed Jul 11, 2016
@ova2 ova2 added the fixed label Jul 11, 2016
@tandraschko
Copy link
Member

+1 for the release
but i would just do the bugfixes and lets remove the duplicate components for 6.1
if we do a 6.0.1, a user don't expect that we remove components

@ova2
Copy link
Member

ova2 commented Jul 11, 2016

Ok, we should remove the components for 6.1 and not now due to PF public release 6.1 (Spotlight can be removed anyway). For now I can do a release this week. Only Extensions core and CKEditor. Is it ok for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants