jsf-2

jsf custom converter

半世苍凉 提交于 2019-12-12 06:07:16
问题 I'm new to jsf 2.0 and spring 3.0 , i have a requirement to use custom converter in jsf 2.0.But it is not recognized,when i access my xhtml page it is showing an exception "Named object not found" .I had used @FacesConverter annotation for the custom converter and it is using in the h:selectOneMenu.But i'm getting the error.could any one help in this... @FacesConverter("selectItemsConverter") public class SelectItemsConverter implements Converter { public Object getAsObject(FacesContext

CDI bean List in datatable is null on submit from JSF

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 05:56:02
问题 Please note: This question is about CDI scopes as we are using CDI scopes in the app and not JSF scopes. 1) Controller Bean (TestController.java) which is in RequestScoped (enterprise context) is called index_cut.xhtml, when we come for first time on this page. 2) On button “Load”, we load the following method to populate the sapFinancialPeriodList which works fine and displays the data 3) After changing the content on the page and submitting, the sapFinancialPeriodList appears as NULL in the

<a4j:commandLink> action not fired

久未见 提交于 2019-12-12 05:48:27
问题 I have an <a4j:commandLink> which I need to fire an action on my controller, <h:form> <a4j:commandLink actionListener="#{controller.send(viewBean.id, cc.attrs.guid)}" onbegin="$.efc.busy($.messages.sending);" oncomplete="$.efc.busy('', true);"> Send offer to this dealer </a4j:commandLink> </h:form> When I click on the link, the onbegin javascript is successfully fired but the action is never called. Here is my action from my controller: public void send(String id, String guid) { if (id !=

How to display menu items from database

筅森魡賤 提交于 2019-12-12 05:39:36
问题 I have two classes representing menu items. First one is Category , it represents the parent menu items. @Entity @Table(name = "category") @NamedQueries({ @NamedQuery(name = "Category.findAll", query = "SELECT c FROM Category c"), @NamedQuery(name = "Category.findByCateId", query = "SELECT c FROM Category c WHERE c.cateId = :cateId"), @NamedQuery(name = "Category.findByCateName", query = "SELECT c FROM Category c WHERE c.cateName = :cateName")}) public class Category implements Serializable {

Redirect a user to instagram login using POST

。_饼干妹妹 提交于 2019-12-12 05:38:26
问题 I am working on a website which deals with Instagram pictures. I have to direct the user to Instagram login page for verification. This process needs my website to send few parameters in the URL, for authorization. The format is given below. From instagram docs - https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=code It works fine when I use GET request to hit the Instagram URL. But now I want to hide these values from the URL and hide it

Placeholder in resource bundles

喜你入骨 提交于 2019-12-12 05:38:22
问题 I need some placeholders with automatic filling in my resource bundle. An user of my application has two possible configuration, for example "1" and "2". Depending on this configuration, an entry should returned with the correct value. I know, that conditions are possible: currentConfig=The configuration is currently the {0,choice,0#first|1#second} In my faces-config.xml the resource bundle is configured for access in JSF. Now, I want to get this value in JSF without specifying parameters: <h

JSF returns blank/unparsed page with plain/raw XHTML/XML/EL source instead of rendered HTML output

萝らか妹 提交于 2019-12-12 05:29:49
问题 I have some Facelets files like below. WebContent |-- index.xhtml |-- register.xhtml |-- templates | |--userForm.xhtml | `--banner.xhtml : Both pages are using templates from /templates directory. My /index.xhtml opens fine in browser. I get the generated HTML output. I have a link in /index.xhtml file to /register.xhtml file. However, my /register.xhtml is not getting parsed and returns as plain XHTML / raw XML instead of its generated HTML output. All EL expressions in form of #{...} are

p:layoutUnit content not changing on p:tree node selection

北城以北 提交于 2019-12-12 05:28:28
问题 I am trying to update the content of PrimeFaces <p:layoutUnit> on <p:tree> node selection. However, when I select a node, the content does not change. When I refresh the page I see that the content is changed. How can I change the content without refreshing the whole page? My view code is: <h:body> <h:form id="form"> <p:layout fullPage="true"> <p:layoutUnit position="north" size="100" resizable="false" closable="false" collapsible="false"> <h:outputText value="Top" /> </p:layoutUnit> <p

JSF2 form submit " Target Unreachable, identifier 'myModel' resolved to null ONLY on submit

China☆狼群 提交于 2019-12-12 05:27:23
问题 I have a very strange problem where a bean is not resolved but ONLY on submit. It works fine on view but on submit, it errors out saying that the identifier is null My JSF <h:form id="edit" styleClass="form"> <rich:panel> <f:facet name="header"> <h:outputText value="Edit Data" /> </f:facet> <rich:graphValidator value="#{myModel}" id="gv"> <rich:messages for="gv" /> <rich:messages id="goal-messages" globalOnly="true" /> <!-- form fields that reference #{myModel.fields} --> <h:commandButton id=

Update ui components from server event

两盒软妹~` 提交于 2019-12-12 05:27:23
问题 How would I go about updating a UI component when a server process finishes or anytime else for that matter? Can\Should I extend the UI component and register some kind of EventListener on it? bind the UI component in a backing bean? use some of the new PrimePush features? something else? If anyone could guide me in the right direction I'd appreciate it. Example Case One Server process ends and updates the database. I want to automatically update a DataTable with new rows based on the new