faces icon indicating copy to clipboard operation
faces copied to clipboard

Form partial submit

Open pizzi80 opened this issue 2 years ago • 5 comments

talking with @BalusC we came to the same conclusion that inside faces.js the method faces.getViewState should include the partial submit logic and, to do that, the best solution is to change the firm of the method like this:

faces.getViewState = function(form,execute)

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

I'm working on it and, as suggested by @BalusC, inside Mojarra it should be an experimental feature

Where and how I should add and read a global variable to enable/disable partial submit?

pizzi80 avatar Jun 24 '22 11:06 pizzi80

web.xml context parameter

In Mojarra it can be read via BooleanWebContextInitParameter.

For Mojarra 4.0.x experimental feature, use something like com.sun.faces.enablePartialSubmit.

For inclusion in Faces 4.1 or 5.0 you need to propose and discuss and specify (write javadocs) an API change in jakarta.faces.* area (perhaps AjaxBehavior class) and use something like jakarta.faces.ENABLE_PARTIAL_SUBMIT.

Note that it would be nice if you can control this on a per-UIForm basis via e.g. <h:form partialSubmit="[true|false]">. In Mojarra, simply adjust FormRenderer for this. It should in any case override the web.xml context parameter if any.

BalusC avatar Jun 24 '22 13:06 BalusC

partial submit implemented in https://github.com/eclipse-ee4j/mojarra/pull/5141

at the moment is always active

We should evaluate to introduce a conf parameter as @BalusC said but I don't think that is a high priority task because the partial submit logic should be the default form submit... at the moment I can't think a negative consequence but I could be wrong

pizzi80 avatar Jun 28 '22 09:06 pizzi80

It should be mentioned in the spec (javadoc of AjaxBehavior and jsdoc of faces.ajax.request is OK) and it should be toggleable via a context param.

#5141 has been merged into master for 4.1 release. So you can work based off that.

Context param proposal: jakarta.faces.DISABLE_PARTIAL_SUBMIT, identified by public constant AjaxBehavior.DISABLE_PARTIAL_SUBMIT_PARAM_NAME. Implementation speaks for itself. Can you take care of this, @pizzi80?

BalusC avatar Jan 28 '23 18:01 BalusC

A long time had passed since my pull request, so I had lost hope that it would be accepted... so in my spare time I made many changes to my fork, also in Java code

Now I need to figure out how to sync my fork with upstream (4.1), keep my changes, and commit all these changes into separate pull requests. :smiley: :sos:

Probably some Java changes are now in conflict with the good work made by @Emkas wich are now part of 4.0.2 release so I need to manually merge or do some copy/paste and cherry pick my changes in the new code, but I will require some more time ... :v:

is there an ETA for 4.1 release of Mojarra?

pizzi80 avatar Mar 24 '23 10:03 pizzi80

cc: @arjantijms

BalusC avatar Mar 24 '23 11:03 BalusC