eclipse-ee4j / mojarra

Mojarra, a Jakarta Faces implementation
Other
158 stars 108 forks source link

Fixed: Form id always included in ajax payload #5274

Closed pizzi80 closed 12 months ago

pizzi80 commented 1 year ago

Talking with @BalusC I've found that the new faces.js was not including the form.id in the xhr payload.

https://github.com/omnifaces/omnifaces/issues/767

I've made some minor optimizations and other clarifications which I need for a future big refactoring of the "render" phase algorithms I'm working on

BalusC commented 1 year ago

Can you PR the form ID fix against 4.0 please?

pizzi80 commented 1 year ago

Can you PR the form ID fix against 4.0 please?

I think that 4.0 doesn't need to be fixed because the "partial submit" part is totally new

You should fix it on OmniFaces side in Form.ts simply by adding the form.id in the query string if form.id it's not included in the array of id that need to be processed...

pizzi80 commented 1 year ago
// if the partialExecuteIds does not include the form.id,
// then add it because it's required by the spec to be always included!
if ( partialExecuteIds && !partialExecuteIds.includes(form.id) ) {
       qString = appendToQueryString(qString, form.id, form.id);
}
BalusC commented 12 months ago

I think that 4.0 doesn't need to be fixed because the "partial submit" part is totally new

Right.

BalusC commented 12 months ago

You should fix it on OmniFaces side in Form.ts

Not needed. It already does that and it's also covered by FormIT since the beginning. If the Mojarra fix didn't work at all while using <o:form> then it would indeed have been a bug in OmniFaces as well.