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

Document Viewer: java.lang.RuntimeException: ToggleButton.selected: A bound value cannot be set #10935

Closed
2 tasks done
Siedlerchr opened this issue Feb 27, 2024 · 13 comments · Fixed by #10987
Closed
2 tasks done
Assignees
Labels
bug Confirmed bugs or reports that are very likely to be bugs FirstTimeCodeContribution Triggers GitHub Greeter Workflow good first issue An issue intended for project-newcomers. Varies in difficulty.

Comments

@Siedlerchr
Copy link
Member

JabRef version

Latest development branch build (please note build date below)

Operating system

Windows

Details on version and operating system

No response

Checked with the latest development build (copy version output from About dialog)

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

  1. Have a pdf file linked to an entry
  2. Click entry
  3. Go to View -> Open Document Viewer
  4. Optional: Maximize the window
  5. Click on "locked"
java.lang.RuntimeException: ToggleButton.selected : A bound value cannot be set.
	at javafx.base@21.0.2/javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:141)
	at javafx.controls@21.0.2/javafx.scene.control.ToggleButton.setSelected(ToggleButton.java:151)
	at javafx.controls@21.0.2/javafx.scene.control.ToggleButton.fire(ToggleButton.java:262)
	at javafx.controls@21.0.2/com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:207)
	at javafx.controls@21.0.2/com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
	at javafx.base@21.0.2/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
	at javafx.base@21.0.2/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
	at javafx.base@21.0.2/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
	at javafx.base@21.0.2/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
	at javafx.base@21.0.2/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at javafx.base@21.0.2/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at javafx.base@21.0.2/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@21.0.2/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at javafx.base@21.0.2/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@21.0.2/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at javafx.base@21.0.2/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@21.0.2/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at javafx.base@21.0.2/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at javafx.base@21.0.2/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at javafx.base@21.0.2/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
	at javafx.base@21.0.2/javafx.event.Event.fireEvent(Event.java:198)
	at javafx.graphics@21.0.2/javafx.scene.Scene$MouseHandler.process(Scene.java:3984)
	at javafx.graphics@21.0.2/javafx.scene.Scene.processMouseEvent(Scene.java:1890)
	at javafx.graphics@21.0.2/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2708)
	at javafx.graphics@21.0.2/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:411)
	at javafx.graphics@21.0.2/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:301)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at javafx.graphics@21.0.2/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:450)
	at javafx.graphics@21.0.2/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:424)
	at javafx.graphics@21.0.2/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:449)
	at javafx.graphics@21.0.2/com.sun.glass.ui.View.handleMouseEvent(View.java:551)
	at javafx.graphics@21.0.2/com.sun.glass.ui.View.notifyMouse(View.java:937)
	at javafx.graphics@21.0.2/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at javafx.graphics@21.0.2/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:185)
	at java.base/java.lang.Thread.run(Thread.java:1583)

documentViewerlocked

Appendix

...

Log File
Paste an excerpt of your log file here
@Siedlerchr Siedlerchr added bug Confirmed bugs or reports that are very likely to be bugs good first issue An issue intended for project-newcomers. Varies in difficulty. labels Feb 27, 2024
@Anirudhxx
Copy link
Contributor

Hi, can take up this issue?

@Siedlerchr Siedlerchr added the FirstTimeCodeContribution Triggers GitHub Greeter Workflow label Feb 28, 2024
Copy link
Contributor

As a general advice for newcomers: check out Contributing for a start. Also, guidelines for setting up a local workspace is worth having a look at.

Feel free to ask here at GitHub, if you have any issue related questions. If you have questions about how to setup your workspace use JabRef's Gitter chat. Try to open a (draft) pull-request early on, so that people can see you are working on the issue and so that they can see the direction the pull request is heading towards. This way, you will likely receive valuable feedback.

@Anirudhxx
Copy link
Contributor

Anirudhxx commented Mar 3, 2024

Steps to reproduce the behaviour

Have a pdf file linked to an entry
Click entry

Hi I'm new to Jabref and I'm facing issues reproducing this error , can you please give me bit more detailed explanation what is an entry and what kind of pdf file i should use to reproduce this error?

@koppor
Copy link
Member

koppor commented Mar 4, 2024

An entry is an entry in a .bib file. Example bib file: https://github.com/JabRef/jabref/blob/main/src/test/resources/testbib/Chocolate.bib

Drag and drop a PDF into a line in the main table. Attach the PDF. Then, you can open the PDF in JabRef.

@koppor
Copy link
Member

koppor commented Mar 4, 2024

  • There should also be a tooltip showing what "Locked" means

@Anirudhxx
Copy link
Contributor

An entry is an entry in a .bib file. Example bib file: https://github.com/JabRef/jabref/blob/main/src/test/resources/testbib/Chocolate.bib

Drag and drop a PDF into a line in the main table. Attach the PDF. Then, you can open the PDF in JabRef.

Is there any tutorial available which guides how to create a .bib file or use an existing file in our local system?

@ThiloteE
Copy link
Member

ThiloteE commented Mar 4, 2024

@Anirudhxx If you open JabRef, an empty library will be created. If you add entries to that library, it will automatically be saved as .bib file.

See also

@koppor
Copy link
Member

koppor commented Mar 4, 2024

Is there any tutorial available which guides how to create a .bib file or use an existing file in our local system?

I don't know your previous experiences. Did you use an application working with files? Like Microsoft Word or Notepad++?

Maybe, the wording "library" is confusing for you? A library is a .bib file.

image

If you had installed JabRef and checked out JabRef, you could navigate to the JabRef folder, go to src/test/resources/testbib sub directory and double click on Chocolate.bib. Tests on Windows only.

@Anirudhxx
Copy link
Contributor

documentViewerView.setLiveMode(false);
i think here we're trying to directly set a bound value of togglebutton modeLive is causing the issue. But when i tried fixing it
boolean currentLiveModeValue = viewModel.liveModeProperty().get(); // Toggle the value boolean newLiveModeValue = !currentLiveModeValue; // Update the view model with the toggled value viewModel.setLiveMode(newLiveModeValue);
it's still showing the same error, do you have any suggestions?

@Siedlerchr
Copy link
Member Author

The error message is clear. You cannot set a value that is set using Binding. Maybe you should read about javafx. bindings first https://www.informit.com/articles/article.aspx?p=2251210&seqNum=4
https://edencoding.com/javafx-properties-and-binding-a-complete-guide/

@SimoneSantin
Copy link

Hello, I'm testing the software trying to understand the reason for the bug, but I'm struggling to fully comprehend the function of the 'live' and 'locked' buttons. What would be their purpose? Additionally, I've noticed that when I press the 'live' button, it then moves to 'locked' (thus allowing me to enter 'locked' mode and avoiding the bug). However, I would like to understand if this is an additional issue to be fixed or if it's intended behavior. Thank you for your responses, and I apologize for any potentially silly questions as I'm new to this software.

@koppor
Copy link
Member

koppor commented Mar 18, 2024

@SimoneSantin Do you know about Ctrl+Shift+F in IntelliJ? I searched for "Locked".

image

I found something interesting in DocumentViewer.fxml:

<Tooltip text="%Show this document until unlocked."/>

The other one is

<Tooltip text="%Show the document of the currently selected entry."/>

The intention is to be mutually exclusive:

Either the document viewer updates the document on change of a BibEntry (modeLive) or it keeps the current document (modeLocked). Therefore, there is a bi-directional binding of modeLock and modeLive.

HTH!

Siedlerchr added a commit to Anirudhxx/jabref that referenced this issue Mar 18, 2024
* upstream/main: (40 commits)
  Improve citation relations (JabRef#11016)
  Keep enclosing braces of authors (JabRef#11034)
  Bump org.apache.pdfbox:fontbox from 3.0.1 to 3.0.2 (JabRef#11042)
  Bump com.dlsc.gemsfx:gemsfx from 2.2.0 to 2.4.0 (JabRef#11044)
  Bump org.apache.pdfbox:xmpbox from 3.0.1 to 3.0.2 (JabRef#11041)
  Bump com.googlecode.plist:dd-plist from 1.23 to 1.28 (JabRef#11040)
  Bump gittools/actions from 0.13.4 to 1.1.1 (JabRef#11039)
  Change copy-paste function to handle string constants (follow up PR) (JabRef#11037)
  Fixes Zotero file handling for absolute paths (JabRef#11038)
  Speed up failure reporting (JabRef#11030)
  Importing of BibDesk Groups and Linked Files (JabRef#10968)
  Convert RemoveBracesFormatterTest to @ParameterizedTest (JabRef#11033)
  Update teaching.md
  Remove non-existing recipe (JabRef#11029)
  Update CSL styles (JabRef#11031)
  Clean up defintions of entry types (JabRef#11013)
  Fix log file path on Windows (JabRef#11028)
  Change to rolling logs (JabRef#11023)
  chore: remove repetitive words (JabRef#11015)
  Fix test names (JabRef#11014)
  ...
@koppor
Copy link
Member

koppor commented Mar 19, 2024

@SimoneSantin I saw that we both overlooked that the issue was already assigned. Thus, a fix was meanwhile implemented and merged into main. Please choose another issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs FirstTimeCodeContribution Triggers GitHub Greeter Workflow good first issue An issue intended for project-newcomers. Varies in difficulty.
Projects
Archived in project
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants