richfaces

Is @Produces more efficient that a getter in an EL expression

…衆ロ難τιáo~ 提交于 2019-11-29 17:57:33
I'm wondering which of those two code snippets is more efficient. First one In userSearch.xhtml : <rich:dataTable var="user" value="#{userSearchResultList}" rendered="#{not empty userSearchResultList}"> ... </rich:dataTable> In UserSearchAction.java : @Produces @RequestScoped @Named("userSearchResultList") public List<User> getResultList() { return resultList; } Second one In userSearch.xhtml : <rich:dataTable var="user" value="#{userSearchAction.resultList}" rendered="#{not empty userSearchAction.resultList}"> ... </rich:dataTable> In UserSearchAction.java : public List<User> getResultList()

Sending OutputStream to browser and let browser save it [duplicate]

三世轮回 提交于 2019-11-29 15:15:20
问题 This question already has answers here : How to provide a file download from a JSF backing bean? (4 answers) Closed 4 years ago . I want to export Data from a Rich Faces Data Table I have created outputStream from the data in the Data Table. Now want to send this OutputStream to browser and let it save. How can I do this? FileOutputStream stream = new FileOutputStream(new File(PATH)); OutputStream out = myMthodToCreateOutPutStream(); Now how to save this out to browser . 回答1: It's not clear

Dynamic value binding of JSF component

…衆ロ難τιáo~ 提交于 2019-11-29 14:27:25
How do I bind a value of certain component dynamically at runtime? For example, I have the following component tag, <h:inputText value="#{bean.someProp}" /> In my case, "#{bean.someProp}" is only known at runtime. What's the best strategy to implement this? Should I traverse the component tree and set the value binding programmatically? If yes, at which JSF lifecycle phase should I do the traversing? You can bind it to a Map<String, Object> bean property where the String key is less or more the dynamic property name. You can access map values in EL the following way: <h:inputText value="#{bean

How to populate the right side of a richfaces picklist?

雨燕双飞 提交于 2019-11-29 14:15:24
问题 I am using a Richfaces' picklist and I want to populate the right-side panel with a list of SelectItems from my backing bean. Populating the left-side is not a problem from the backing bean, however, the right hand side is problematic. This is what I currently have <h:outputText value="Roles" /> <rich:pickList showButtonsLabel="false"> <f:selectItems value="#{Bean.allRoles}" /> </rich:pickList> EDIT: So I have roles 'a', 'b', 'c', and 'd'. The user has roles 'a' and 'd', so 'a' and 'd' should

How do I stop richfaces adding borders to panels and calendars?

ε祈祈猫儿з 提交于 2019-11-29 13:28:47
问题 I'm hoping to use a custom richfaces skin to handle the bulk of my presentation work. Unfortunately richfaces renders borders around every cell in a calendar component and around each panel. I would like to turn them off so that day numbers site in an open grid with no borders. There is no obvious way to do that using skins or attributes of the calendar control. I could use custom CSS but I'd prefer to work with the framework to completely remove the border related properties from the

RichFaces4 don't render the components

◇◆丶佛笑我妖孽 提交于 2019-11-29 12:51:47
I try to run RichFaces4 app but the components don't render. For example when I try this demo: Demo I get something like this: Here is an example of default tab panel with 3 tabs. j_id1475365623_57f04a9f j_id1475365623_57f04a9f j_id1475365623_57f04a9f j_id1475365623_57f04a75 j_id1475365623_57f04a75 j_id1475365623_57f04a75 j_id1475365623_57f04a6b j_id1475365623_57f04a6b j_id1475365623_57f04a6b « ↓ » Here is tab #1 Here is an example of tab panel switched in "ajax" style. Second tab is disabled. j_id1475365623_57f04a27 j_id1475365623_57f04a27 j_id1475365623_57f04a27 j_id1475365623_57f04a1d j

Accessing java-based DOM tree directly from JSF/richfaces

天涯浪子 提交于 2019-11-29 11:12:25
Based on this question I have a couple of other questions: 1) the map in this question which is made available to jsf is actually one of a number, so i'm now not sure what the backing bean method's return type should now be. if i modify it's current Array<String> return type to Array<Map Integer, Map<String, String[]>>> (or ArrayList<Map Integer, Map<String, String[]>>> ?) would it just be a case of further nesting the iterator on the jsf side? Trouble is an Array/ArrayList isn't a Map and I'm unsure how this then looks in jsf. would this be correct: <c:forEach items="#{bean.map}" var="entry">

Is there a way to create dynamically <rich:tab> elements?

大兔子大兔子 提交于 2019-11-29 10:57:01
Let say that I want to create a variable set of <rich:tab> elements within a <rich:tabPanel> component. So I tried to do that way: <rich:tabPanel switchType="client" ...> <ui:repeat value="#{myBean.myTabs}" var="tab"> <rich:tab name="#{tab.name}" label="#{tab.label}"/> </ui:repeat> </rich:tabPanel> But it didn't work, as no tab is rendered. I also got the following message in the logs: j_id174: tab panel has no enabled or rendered tabs! This problem seems to be encountered by others people, for example here . So as suggested by the previous thread, I replaced my <ui:repeat> by a <c:forEach>

Deprecated richfaces javax.faces.el.MethodBinding replacement use

混江龙づ霸主 提交于 2019-11-29 10:51:13
I found this piece of code works in that i can programmatically creates a richfaces dropdown menu. But some of the code is deprecated. Can anyone tell me what to put in instead of the deprecated calls? Thanks public HtmlDropDownMenu getMyMenu() { HtmlDropDownMenu menu = new HtmlDropDownMenu(); menu.setValue( "Node Select" ); HtmlMenuItem menuItem = new HtmlMenuItem(); // TODO programmatically pass from getNodes into a String[] rather than an ArrayList of SelectItems String subOption = "myBox"; menuItem.setValue( subOption ); Application app = FacesContext.getCurrentInstance().getApplication();

RichFaces 4 - how to disable skins

杀马特。学长 韩版系。学妹 提交于 2019-11-29 09:58:39
Is there any way how to disable all skins RichFaces apply? They ruin my layout and override fonts, links,... Jean-Charles You can redefine each CSS style, but it'll be boring... Have a look at reset css , this can help you to redefine the CSS. or, you can try to remove style: <context-param> <param-name>org.richfaces.CONTROL_SKINNING</param-name> <param-value>disable</param-value> </context-param> <context-param> <param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name> <param-value>disable</param-value> </context-param> or try to use the plain style <context-param> <param-name>org