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

Diagram: Inherit UIData #9551

Closed
rider87 opened this issue Dec 25, 2022 · 7 comments · Fixed by #11454
Closed

Diagram: Inherit UIData #9551

rider87 opened this issue Dec 25, 2022 · 7 comments · Fixed by #11454
Assignees
Milestone

Comments

@rider87
Copy link

rider87 commented Dec 25, 2022

Describe the bug

It seems the p:diagram does not generate a iterator (uniqueId).
Therefore all element / components inside a <f:facet name="element"> // MyComponent has the same id.

<h:form id="automationFlowChartForm">
	<p:diagram id="automationDiagram"
				value="#{myController.model}"
				var="diagramElement">
		<p:ajax event="positionChange"
					listener="#{automationFlowChartView.doSavePosition()}" />
		<f:facet name="element">
			<f:attribute name="element" value="#{diagramElement}" />
			<p:panel id="triggerPanel" >
				<f:facet name="header">
					<h:outputText styleClass="#{diagramElement.icon} Fs11" />
					<h:outputText value="#{diagramElement.name}"
				styleClass="FontBold Fs11" style="margin-left: 10px;" />
				</f:facet>
				<h:outputText id="triggerText" value="TEST" />
			</p:panel>
		</f:facet>
	</p:diagram>
</h:form>

This means also a normal actionListener for a element is also not working and I will always get only the first element from p:diagram.
<p:commandButton actionListener="#{myController.openDialogClicked(element)}" icon="fa fa-edit" />

<f:facet name="element"> has a unique ID, but all components inside has the same ID.
I would assume a iterator, like in the p:datatable etc.

So for the component inside the <f:facet name="element"> you have than something like:
automationFlowChartForm:0:triggerPanel, for the next panel automationFlowChartForm:1:triggerPanel, but currently for all panels you will have:
automationFlowChartForm:triggerPanel.
This means also for buttons etc.: if you hover on a button, it will change the color for each button with this ID, because all components are not unique...

I can see this also in the HTML console:
image

Green is the var="diagramElement", but you can see the ID from the panel is always the same.

Can this be fixed?

Reproducer

No response

Expected behavior

No response

PrimeFaces edition

None

PrimeFaces version

12.0.0

Theme

No response

JSF implementation

Mojarra

JSF version

2.4

Java version

11

Browser(s)

Chrome

@rider87 rider87 added ‼️ needs-triage Issue needs triaging 🐞 defect Bug...Something isn't working labels Dec 25, 2022
@jepsar jepsar changed the title p:diagram not generating a iterator / uniqueId Diagram: iterator / uniqueId not generated Dec 25, 2022
@jepsar jepsar changed the title Diagram: iterator / uniqueId not generated Diagram: not generating a iterator / uniqueId Dec 25, 2022
@melloware
Copy link
Member

Related to: #8765

And especially: #3781

@rider87
Copy link
Author

rider87 commented Dec 26, 2022

thanks... any plans to fix this?

@melloware
Copy link
Member

I added this ticket in #8765 so we can track it there. But to fix this if I had to guess would involve extending UIData instead of UIComponent or something along those lines which is not a simple fix.

@jepsar

This comment has been minimized.

@melloware

This comment has been minimized.

@melloware melloware closed this as not planned Won't fix, can't repro, duplicate, stale Dec 27, 2022
@melloware melloware removed the ‼️ needs-triage Issue needs triaging label Dec 27, 2022
@melloware melloware reopened this Feb 17, 2024
@melloware melloware added this to the 14.0.0 milestone Feb 17, 2024
@melloware melloware self-assigned this Feb 17, 2024
melloware added a commit to melloware/primefaces that referenced this issue Feb 17, 2024
melloware added a commit to melloware/primefaces that referenced this issue Feb 18, 2024
@melloware melloware modified the milestones: 14.0.0, 13.0.6 Feb 18, 2024
melloware added a commit to melloware/primefaces that referenced this issue Feb 18, 2024
melloware added a commit to melloware/primefaces that referenced this issue Feb 20, 2024
melloware added a commit to melloware/primefaces that referenced this issue Feb 20, 2024
melloware added a commit that referenced this issue Feb 20, 2024
@melloware melloware removed this from the 13.0.6 milestone Feb 20, 2024
@melloware melloware removed their assignment Feb 20, 2024
@melloware melloware reopened this Feb 20, 2024
@melloware

This comment has been minimized.

@melloware melloware changed the title Diagram: not generating a iterator / uniqueId Diagram: Inherit UIData Feb 21, 2024
@melloware melloware added new feature and removed 🐞 defect Bug...Something isn't working labels Feb 21, 2024
@melloware
Copy link
Member

melloware commented Feb 21, 2024

Same as #10762 this component needs to inherit UIData.

@melloware melloware assigned melloware and unassigned melloware Mar 5, 2024
@Rapster Rapster self-assigned this Mar 12, 2024
Rapster added a commit to Rapster/primefaces that referenced this issue Mar 13, 2024
@melloware melloware added this to the 15.0.0 milestone Mar 20, 2024
melloware pushed a commit to Rapster/primefaces that referenced this issue May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants