Make JSF Tomahawk tree2 node selectable? - jsf

Is it possible to make <t:tree2> tree node selectable? I would need to select a node, and based on this selection to print out certain info on the page.

The Myfaces Wiki - Tree2 says
"Almost any type of JSF component (text, image, checkbox, etc.) can be rendered inside the nodes"
So I guess you you can place a button for example and use it for interacting and showing the needed data
I haven't worked with Tomahawk nor its tree2... but I think whatever i suggested would work for any tree... Also.. i'm not so sure that Tomahawk is the library to be used for fancy web app... You should check primefaces component library its for JSF 2 and its showcase is amazingly BIG and RICH... take a look at their tree , it got all you ever wanted and event more
PRIMEFACES Tree - Single Selection
PRIMEFACES Tree

Related

JSF or Primefaces component

i work on a project where we use JSF + Primefaces
I would like to know if it's preferable to use JSF components as much as possible even if there are sometimes the same components in Primefaces (for basic use)
Using Primefaces only for specific things not available on the JSF version
When should we use Primefaces instead of JSF ?
sorry for any faults
In general, I'd say prefer them than JSF standard components, the reason is simple: CSS skinning. For example, even if h:inputText and p:inputText are exactly the same component, you might want to have the same CSS skinning for all JSF components (specially if you use a premium layout from PF)
But, I think there are few exceptions:
If you use JSF 2.3. For example, I'd rather use h:commandScript than p:remoteCommand. As they're not "visual" components, I'd prefer to use standard components. See also what works better for you ;-)
Also, Oleg presents some performance killer using PF components in datatable, see here http://ovaraksin.blogspot.com/2013/05/jsf-choice-between-legacy-components.html
I think the most important point is consistency, which comes in a couple of flavours.
PrimeFaces (PF) components have a lot of styling put on them (through the theme options). If you use PF components throughout your application, you'll get a consistent style. If you mix PF and JSF components this will look messy.
PF components have a particular way of doing things - organising options, defining ajax calls etc. While it's important to know how the JSF stuff works underneath, using PF components consistently will make your code consistent too.
Finally, in many cases PF components are exact replacements for JSF components, but often with extra features added. There's no reason not to take advantage of them.
Better choose one of them and develop all application using mainly one stack. Will be easy to support, easy update, easy bug fix.
Primefaces at the moment good choose.

How to access PrimeFaces components through Graphene in the most portable way?

I'm writing Arquillian+Graphene functional tests for a Java EE web client with Primefaces 6.1 components and would like to write them in the most portable way from the beginning.
I noticed that there's no possibility to perform operations like WebElement.click on any PrimeFaces component which is clickable (e.g. not on p:selectBooleanCheckbox since the WebElement is a div containing another div containing an input), so that I have to
figure out how a clickable component is structured for every component and access it via XPath
figure the above out for every component after I change the PrimeFaces version
A similar problem is the case for access by id: the clickable element seems to be suffixed with _input, but that's probably as non-portable as the element hierarchy described above.
How to avoid as many problems listed above as possible? Or more abstract: How do people test PrimeFaces components?
The only answer to PrimeFaces fileUpload testing with Selenium WebDriver is proposing my problem as a solution.

Request processing JSF lifecycle, only if the component tree was previously saved

Indeed, very less has been written/shed on the component tree itself, that seems to be source for a whole lot of problems when one takes on understanding JSF.
One of the quote I recently read on a social networking site-
LIBRARY - Because not everything on the Internet is true.
Neither the above nor its opposite holds true either.
This is a screenshot from Anghel Leonard's book- Mastering Java Server Faces 2.2
I think this is plainly wrong. The author seems to be confused on whether its the component tree that gets saved OR the states of the components in the view(tree of UI components)
Considering this thread by BalusC-
When the form is submitted and the view is restored, the JSF
component tree is just rebuilt from scratch and all binding attributes
will just be re-evaluated like described in above paragraph. After the
component tree is recreated, JSF will restore the JSF view state into
the component tree.
Don't forget to read the comments.
Nonetheless, I would love to clarify the above note. Is my understanding perfectly correct?
... only if the component tree was previously saved ...
This is indeed not specific enough. How it really should read is:
... only if the non-transient state of the component tree was previously saved ...

Is there any insensitive to use rendered instead of jstl c:if?

Is there any reason not to use c:if over the rendered attribute? When I started learning jsf the general vibe I got from the tutorials I read was that jstl tags should be forgotten. So everytime I use a jstl tag I feel like I'm doing something wrong.
However for c:if, it is executed at build time while rendered jsf attribute is executed at rendering time (explanation here). It looks like a waste to me to add something to the component tree if it's not to be rendered afterwards. Better not adding it at all using c:if, amiright?
For example on a all my pages, I've an admin menu that is included if the user is admin. I see no reason to add the menu to the tree if it's not to display it when page is rendered. So I just use c:if there. I use rendered on small parts when it's more convenient or for ajax type things.

Implementing a tree view in seam / JSF using Richfaces or jsTree

I am using seam with EJB3 + JSF and I would like to add a tree view component to the UI. The tree view must allow sorting of the nodes (preferably drag and drop) and must allow selection of leaf nodes.
The options I have looked at are:
RichFaces Tree
jsTree
Is there a major benefit to one option over the other?
If I use jsTree, what is the best way to connect to my data in EJB3? Should I use RESTEasy , Java script Remoting, or some other way?
I would use Richfaces tree as you are already using JSF becuase in this way everything is pretty much integrated and you wouldnt have to "wire" all the requirements manually.
The major benefit with richfaces is that everything is already there so the development time is shorter.

Resources