Page 1 of 1

Inplace edit buttons stay there.

Posted: 29 Apr 2019, 10:20
by mafaul
Bug: An inplace editor with ajax listener keeps buttons there after clicking on the tick button. It used to go away after the button is ticked, like it does without the ajax listener.
Barcelona v 2.0.0
PF 7.0

To recreate on barcelona demo (form page):

Code: Select all

<p:inplace editor="true">
	<f:facet name="output">
		<h:outputText value="sample"></h:outputText>
	</f:facet>

	<f:facet name="input">
		<p:inputText />
			<p:ajax event="save" listener="#{autoCompleteView.completeText}" update="@this" />
	</f:facet>
</p:inplace>

Re: Inplace edit buttons stay there.

Posted: 29 Apr 2019, 12:06
by aragorn
I couldn't replicate it. Also, <p:ajax event="save"> is in the wrong area. Please use;

Code: Select all

<p:inplace editor="true">
       <p:ajax event="save" listener="#{autoCompleteView.completeText}" update="@this" />
	<f:facet name="output">
		<h:outputText value="sample"></h:outputText>
	</f:facet>

	<f:facet name="input">
		<p:inputText />
	</f:facet>
</p:inplace>
I think this issue is unrelated to Barcelona Layout/Theme. Could you please try it without Barcelona? And Could you please attach a video?

Re: Inplace edit buttons stay there.

Posted: 29 Apr 2019, 16:15
by mafaul
Thank you for pointing out the ajax location tag.

Video: https://drive.google.com/file/d/1tZJgpB ... sp=sharing

To recreate, just add the inplace tag into the example site's forms.xhtml page:

Code: Select all

<!-- Left Side -->
<div class="card card-w-title">
	<h1>InputText</h1>
	<p:inplace editor="true">
		<p:ajax event="save" listener="#{autoCompleteView.completeText}" update="@this" />
		<f:facet name="output">
			<h:outputText value="sample">
			</h:outputText>
		</f:facet>

		<f:facet name="input">
			<p:inputText />
		</f:facet>
	</p:inplace>

	<p:panelGrid columns="3" layout="grid" styleClass="ui-panelgrid-blank form-group">
		<h:panelGroup styleClass="md-inputfield">
			<p:inputText />
			<label>Name</label>
		</h:panelGroup>
I get the issue on chrome and FireFox

Re: Inplace edit buttons stay there.

Posted: 30 Apr 2019, 09:06
by aragorn
Thanks a lot for the sample code and video. I still couldn't replicate it. Please check your server logs.

My Test;

Code: Select all

...
           <div class="card card-w-title">
                    <h1>InputText</h1>
                    <h:form>
                        <p:inplace editor="true">
                            <p:ajax event="save" listener="#{autoCompleteView.test}" update="@this" />
                            <f:facet name="output">
                                <h:outputText value="sample">
                                </h:outputText>
                            </f:facet>

                            <f:facet name="input">
                                <p:inputText />
                            </f:facet>
                        </p:inplace>
                    </h:form>

                    <p:panelGrid columns="3" layout="grid" styleClass="ui-panelgrid-blank form-group">
                        <h:panelGroup styleClass="md-inputfield">
                            <p:inputText />
                            <label>Name</label>
                        </h:panelGroup>
                    </p:panelGrid>
                </div>
...

Code: Select all

//AutoCompleteView.java
public void test(AjaxBehaviorEvent e) {
        System.out.println("org.primefaces.barcelona.view.input.AutoCompleteView.test()");
}
Best Regards,

Re: Inplace edit buttons stay there.

Posted: 30 Apr 2019, 12:42
by mafaul
I found the issue, my bad.

For the inplace buttons to disappear after clicking, you need to have update="@this" in the ajax tag. Also, the ajax call should work without issues and return 200.

Thank you so much for your assistance, it is much appreciated.

Re: Inplace edit buttons stay there.

Posted: 30 Apr 2019, 12:52
by aragorn
Glad to hear, thanks a lot for the update!

Re: Inplace edit buttons stay there.

Posted: 01 Nov 2019, 12:36
by ibanFR
Hi all,

I'm facing the same issue, before upgrading to version 7 of primefaces there was no need to include update="@this" on the <p:ajax> tag when using a listener. That must be something that has been introduced in the latest release.

We will have to merge code to be compliant with this requirement.

Regards