jsf-2

Determine absolute id

 ̄綄美尐妖づ 提交于 2020-01-11 12:59:06
问题 How do I determine the absolute id of the organizationUnit(from /webapp/resources/acme/organizationUnit.xhtml )? When I select a node from the tree, the organizationUnit should display the selected node. I can't use a relative id because the p:ajax element is not in the same naming container with the organizationUnit component. I need to use absolute id in this case. With Firebug the id of the component is tabs:0:editorsGroup:4:editor3:accountWindowsContainer:organizationUnit . Isn't :form

Every time I make an Ajax request in JSF2 I am getting a new session bean,why?

时光总嘲笑我的痴心妄想 提交于 2020-01-11 09:56:26
问题 Hi I am getting a new session bean for every ajax request made to this Bean... Can any of you tell me why ? ...... imports ...... @Named(value = "userController") @SessionScoped public class UserController implements Serializable { private User current; private DataModel items = null; @EJB private br.com.cflex.itm.dataaccess.UserFacade ejbFacade; private PaginationHelper pagination; private int selectedItemIndex; public UserController() { } public Collection<Project> getMyProjectList(){

Programatically adding Ajax Behaviour - “Mojarra is not defined”

柔情痞子 提交于 2020-01-11 09:51:55
问题 I have a page using dynamic forms where I am creating the component tree programatically (which is not up for debate in this question) Some of the input controls I need to render require an ajax handler. The xhtml fragment (included by a <ui:include> from another fragment) is : <ui:composition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://xmlns.jcp

Render selectManyCheckbox without HTML table

。_饼干妹妹 提交于 2020-01-11 06:51:08
问题 is there a way to remove the table out of rendered html that is created by the h:selectManyCheckbox tag in server faces? I am using twitter bootstrap and i placed the checkboxes inside a dropdown menu: <ul class="dropdown-menu dropdown-menu-form"> <li><label class="checkbox"> <input type="checkbox" /> Activated </label></li> <li><label class="checkbox"> <input type="checkbox" /> Deactivated </label></li> </ul> So the generated html table destroys the layout ... 回答1: You could just render a

In JSF2, how to know if composite component has children?

杀马特。学长 韩版系。学妹 提交于 2020-01-11 05:29:08
问题 I'm writing a composite component, you have a special tag named: <composite:insertChildren /> Which inserts all the component's children there. Is there any way to know whether the component has children? Like a boolean value that could go on a "rendered" attribute. 回答1: The basic expression you're after is the following: #{cc.childCount} or more elaborately: #{component.getCompositeComponentParent(component).childCount} E.g. the following composite component: <html xmlns="http://www.w3.org

Passing EL expression to composite component

血红的双手。 提交于 2020-01-11 04:16:12
问题 we are still in a JSF 1.2 to 2.0 migration scenario and we are now facing a problem related to c:set or ui:param variables used inside an EL expression. Here are the facts. There is a button as composite component: <cc:interface name="button" shortDescription="A button."> ... <cc:attribute name="disabled" required="false" default="false" shortDescription="The disabled flag." /> ... </cc:interface> <cc:implementation> <ice:commandButton ... disabled="#{cc.attrs.disabled}" ... /> </cc

Primefaces p:inplace: How to more elegantly propagate the EL expression for entity to merge

只愿长相守 提交于 2020-01-11 04:11:05
问题 I would like to share the following powerful "hack" for getting at an entity whose value as been edited using p:inplace. My question is about how to achieve this more elegantly using other existing attributes of p:inplace or otherwise. The trick is adapted from a suggestion by BalusC on Stackoverflow: JSF (and PrimeFaces) How to pass parameter to a method in ManagedBean The question there involves getting at an Employee object that has a p:inplace edited #{emp.firstName}: <h:outputText value=

Passing parameters with h:commandButton — or the equivalent

不羁的心 提交于 2020-01-11 03:53:05
问题 I read on other threads that this does not work: <h:commandButton value="Create New Account" action="#{acctBean.doCreate}" > <f:param name="acctName" value="#{acctBean.handle}" /> <f:param name="acctNo" value="#{acctBean.id}" /> </h:commandButton> The doCreate() method will return a navigation to a "congratulations" page if it creates the account. The target page can then resolve #{param.handle} and #{param.id} . I know this will work if I use h:commandLink instead, but I want a button, not a

JSF 2.0 Simple login page

…衆ロ難τιáo~ 提交于 2020-01-10 20:02:16
问题 I need to restrict the access to a part of the application. In order to access that part, user needs to log in. I have a table in my database called User, with usernames and hashed passwords and a login form that consists of two inputs and a submit. However, I don't know which classes/mathids should I use to log in the user (I assume that there is a support for this functionality in jsf). Also, as far as I know, I need to edit my web.xml to support the authentification. Could someone propose

JSF 2.0 Simple login page

怎甘沉沦 提交于 2020-01-10 20:02:12
问题 I need to restrict the access to a part of the application. In order to access that part, user needs to log in. I have a table in my database called User, with usernames and hashed passwords and a login form that consists of two inputs and a submit. However, I don't know which classes/mathids should I use to log in the user (I assume that there is a support for this functionality in jsf). Also, as far as I know, I need to edit my web.xml to support the authentification. Could someone propose