Is their a way to output to a panel in JSF - jsf

I am relatively new to JSF. I am trying to display data into a web page sorta like a jTextArea or at least onto a panel that is on the webpage, something similar to that. I can display the data in a particular format but it won't appear onto a panel in a specific location or the panel being a particular setSize. Can someone point me into the right direction of what I need to learn in order to do this. The simpler the better as I believe in simplicity.

Primefaces provides you many forms to display data: dataGrid, carousel,... you should use pimefaces showcase http://www.primefaces.org/showcase/ui/datagrid.jsf .

Related

Reusable edit form in Apache Wicket

I have a simple ContactEditPanel which contains a form and a number of textfields. Up until now I included an AjaxSubmitLink in this panel which, if the form content is valid, saves/updates the Contact instance contained in the Panel model. So far so simple. However now I'd like to remove the link in order that I may, depending on the context in which I use the ContactEditPanel, place the submit link at different levels of my overall component hierarchy. For instance in one context I'd like to use to flip between ContactEditPanel and ContactViewPanel with a bar of actions above the current view (edit | save , cancel). Another context would be to use ContactEditPanel in a standalone way (maybe part of a multi-step process) with just a save link below.
I was contemplating refactoring my ContactEditPanel to extends FormComponentPanel rather than Panel as described here but I'm not sure whether this is the right approach and I'm having trouble wrapping my head around this.
Any help would be most appreciated!
Many Thanks,
A
Your using the panel like a FormComponent so extend FormComponentPanel, it will allow you to keep all the validation you write contained to the component and also allow you to reuse it as you wish.
Just think of it as you've created a new FormComponent, like a TextField or DropDownChoice.

Can Richfaces components be inserted into rich:editor component?

I have another Richfaces question which may seem rather weird. I am developing a web-based application, using Richfaces for a front-end, that allows users to create templates for certain documents. For example: the user is presented with a rich:editor component, which, perhaps, has certain text already typed in, but it also has an input for a date, or specific text. The date can be entered in rich:calendar, the text can be entered in rich:inplaceInput, but the main idea is to be able to place those components INSIDE the rich:editor. I was trying to find an example where it's used and couldn't. So, my question is: is it even possible? Can you place RichFaces components (and, maybe, Seam components) into rich:editor? If not, is there a something similar out there that allows the user to do this? Can Seam do that? The reason I'm asking about Seam is because it appears to have some template-friendly logic and can work along with JSF and Richfaces.
Thanks for your help
Essentially your asking if you can add HTML elements to a textarea tag, and have them work. Unfortunately, no you can't.
What I've done in the past for such things has been to either weave boilerplate text, with inplaceInput, and free form text areas, or to simply provide the needed fields above/beside/below the editor.

jsf popupwindow with a datatable

I have a form which one of it's fields is a code and description, also a button for opening a popup window that contains a list of all of the available codes.
when the user double clickes a row from that table i want to set these values to the code and description. - how can this be done?
Another question, I want to create this popup and table to be initialized dynamically - by that i mean that if i have a few forms in my application, when ever i have a field which has a description i want to be able to open this popup and to see the available list for that field. (every field can be from a diffrent table). is it possible to create something like that? if so, how?
Any help will be appritiated,
Thank's In Advance.
Yes, it is possible. Even more, many component libraries have ready to use popup/dialog components, such as RichFaces with <rich:popupPanel> and PrimeFaces with <p:dialog>.
If you do not want to use a component library for some reason, you would need to create a custom component for this which generates basically an absolutely positioned HTML <div> element with a CSS overlay which get shown/hidden by JS on a particular click/action. The HTML/CSS/JS part should be relatively simple if you are familiar with those languages. The JSF part is somewhat hard if you have never created a custom component before, but it should be possible with a composite component as well, so you could also just create one with pure XHTML. The updating/refreshing can just take place by the usual <f:ajax> means.

Desktop-like jsf-web-application

I want to create a desktop-like application with JSF 2.0 and Primefaces 2.2.1
I created a main Layout with two divs, the upper div containing a menubar with several submenus. When the user chooses a menuitem, I want to show the spezifyed xhtml page in the bottom div of my main layout, without loading the full page. So I am thinking of Ajax to do it. But I don't know how to realize it.
And by the way, is there a chance to change a p:menubar or a p:submenu by javascript?
Can someone help me?
At the risk of being down-voted, may I suggest that since it sounds like you're at the beginning of your project, you should consider a framework other than JSF 2.0 because it sounds like you're shoe-horning. GWT is the most obvious candidate. If you're used to desktop app development (especially in Java), Vaadin is another great candidate.

Create Form in J2ME

I want to design one form that contains TextField and ListView in J2ME. But I don't know how to create this form. It is looked like Dictionary Form. Could anybody help me to do that?
You can't really do that with the basic UI controls in MIDP.
List can't contain TextField.
I would suggest looking at LWUIT since it has better controls.
Otherwise, if you don't need to display Images in your List, then you can use a Form containing both TextField and StringItem. Unfortunately, an ItemStateListener added to the Form will probably not give you as much information as a List.
Implementing the list yourself in a CustomItem means writing quite a bit of code but is doable.
If what you need is a TextField where you enter a search String and a List that displays the search result, I suggest using a TextBox first, then a List. Separate screens are by far the quickest solution here.
Edit: you can't use swing in j2me. what you can do is have just a textfield in a form, then add/remove StringItems to/from the Form when the user changes the content of the TextField. You should be able to rely on ItemStateListener to tell you when the textfield content changes.

Resources