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

Highlight handler but for the whole form being edited #68

Open
MatthewVaadin opened this issue Jun 9, 2022 · 1 comment
Open

Highlight handler but for the whole form being edited #68

MatthewVaadin opened this issue Jun 9, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@MatthewVaadin
Copy link

Is your feature request related to a use case? Please describe.
I want to be able to respond to a user editing a form. This could be to make the fields read-only when another user is editing the form and to make them writable once the other user is finished.

Describe the solution you'd like
A clear and concise description of what you want to happen. If you have an idea for new API to the product, describe the API and how you think it should work.
Currently the FormManager API allows me to programmatically highlight a field being edited and to respond to another user doing the same. This feature could work in a very similar way. Here is a possible API:

public class FormManager extends AbstractCollaborationManager
    implements HasExpirationTimeout {
    ...
    public void edit(boolean edit) {
        ...
    }

    public void setEditHandler(EditHandler handler) {
        ...
    }
    ...
}

public interface EditHandler {
    interface EditContext extends Serializable {
        UserInfo getUser();
    }

    Registration handleEdit(EditContext context);
}

Describe alternatives you've considered
Using the highlight handler to check whenever any field is being edited and respond to that. However, you can't track when a user has no fields highlighted, but is still editing the form.

@MatthewVaadin MatthewVaadin added the enhancement New feature or request label Jun 9, 2022
@Legioth
Copy link
Member

Legioth commented Jun 29, 2022

To me, this looks like tracking overall presence, but with slightly custom logic for when the user would be marked as present and not. That's something that's already supported using PresenceManager, which makes me wonder whether the use case would be common enough to justify also creating a dedicated API for it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants