Search Results

Search found 1116 results on 45 pages for 'jsf 2'.

Page 31/45 | < Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >

  • keeping the header fixed in datatable while allowing its contents to scroll

    - by Sunny Mate
    I have a table with header and data. When I am scrolling the header is also getting scrolled my code is as follows: <div style="height:200px;overflow-x:auto;overflow-y:scroll;"> <h:dataTable cellpadding="0" cellspacing="0" border="0" width="60%" headerClass="HeaderCellSorted" columnClasses="DataCell" rowClasses="OddRow,EvenRow" styleClass="SearchResults" footerClass="FooterCell" id="userListTable" value="#{pc_WorkInProgressUserGrid.userGridModel.rebalanceByUserList}" var="userGridDO"> <h:column id="userNameColumn"> <f:facet name="header"> <h:outputLink id="userNameColumnLink" styleClass="Header" value="#" onclick="refreshUserGrid('DISPLAYNAME')"> <h:outputText id="userNameColID" styleClass="outputText" value="User"/> Any suggestion would be helpful.

    Read the article

  • h:graphicimage not working in c:foreach

    - by Muneeswaran Balasubramanian
    I have used c:forEach loop for display the list of images using h:graphicImage. But I can't display the images. I have the h:commandLink also in my page. The image have to be displayed at the time of form inititalization. But its not working. But after click the h:commandlink, the images are displayed properly. Before that it shows the image not found text (alt message). I have used h:graphicImage tag like below <c:forEach items="#{Sample.imageList}" var="images" varstatus="imageStatus"> <h:graphicimage id="image" url="#{images}" alt="Image Not Found"/> </c:forEach> What I do wrong in that and how can I achieve that?

    Read the article

  • Does NavigationHandler.handleNavigation() clear the flash?

    - by kgrad
    I am using JSF2.0 Mojarra 2.0.2. I have a method that logs out a user and puts a logout message in the flash, forwards to the login page (which has a div that prints out the flash). However, when I use navigationHandlers handleNavigation method for some reason the flash is not being displayed. I have a similar method that forwards a user to the login page if he/she isn't logged in. If I handle the navigation through an h:link and just call the logout method directly, the flash is displayed as normal, but if I use the handleNavigation() method, the flash is cleared for some reason. The code in question is: public void performLogout() { getFacesContext().getExternalContext().invalidateSession(); setCurrentUser(null); getFlash().put("notice", "Successfully logged out."); super.getFacesContext().getApplication().getNavigationHandler() .handleNavigation(getFacesContext(), null, "login"); } Is there some way I can keep the flash when navigating like this? thanks.

    Read the article

  • Refactor a link and an image

    - by Mihail Stoynov
    I have to write an link with an image inside. Instead of explaining, here's the code I have now: <c:if test="${userSession.loggedUser eq null and company.image != null}"> <a onclick="${rich:component('loginPanel')}.show()"> <img src="/download.do?hash=#{company.image.hash}" /> </a> </c:if> <c:if test="${userSession.loggedUser eq null and company.image == null}"> <a onclick="${rich:component('loginPanel')}.show()"> <img src="${request.contextPath}/img/icons/logo_default.jpg" /> </a> </c:if> <c:if test="${userSession.loggedUser ne null and company.image != null}"> <a href="company.xhtml?${company.name}"> <img src="/download.do?hash=#{company.image.hash}" /> </a> </c:if> <c:if test="#{userSession.loggedUser ne null and company.image == null}"> <a href="company.xhtml?${company.name}"> <img src="${request.contextPath}/img/icons/logo_default.jpg" /> </a> </c:if> This code looks awful - there are two exact links with two exact images but combined in all possible combinations. Is there a better way? Is there a way to avoid c:if - it created tables? Update: Bozho proposes: You can replace <c:if and <a with <h:outputLink rendered="#{..}". Apart from that I don't see any other optimization. But it doesn't work. This does not render correctly: <a href=> <h:outputLink rendered="#{..} <h:outputLink rendered="#{..} </a> (the image is outside the anchor) This does render fine: <h:outputLink value=> <h:outputLink rendered="#{..} <h:outputLink rendered="#{..} </a> , but it always adds href and in two of the cases I don't want href when rendered.

    Read the article

  • Can we use Facelets in JSF1.1_02?

    - by ramkarthik12
    Can we use Facelets in JSF1.1_02?If we can please send me some piece of code relating to that?Can anyone tell me which version of tomcat will support Sun RI1.1_02?I have a restriction of jsf1.1 in my project so if anyone know the thing related to this please share with me!!!!

    Read the article

  • How can a servlet always perform the same task?

    - by membersound
    I want a Servlet to perform always the same tasks. Regardless of if it is a GET or POST. At the moment I just call the doGet() from doPost(), which works fine. Then I tried overriding the service() method, and I thought it would just work the same way. But it does not! The code somehow gets executed, but the response does not generate the webpage: response.getWriter(); response.println(string); This code works for the doGet/doPost methods, but not for the service. Why? Servlet: class MyWebServlet extends HttpServlet { @Override public void service(ServletRequest request, ServletResponse response) { response.setContentType("text/html"); PrintWriter out = response.getWriter(); String string = "teststring"; out.println(string); } }

    Read the article

  • Richfaces Calendar Minimum and Maximum Dates

    - by DaUltimateTrooper
    Hello everybody! My problem is making the RichFaces calendar restricting the dates to be allowed to be chosen by the user. Let's say I want to allow only the dates of this month and the dates of the next month to be chosen by the user. I used the preloadDateRangeStart and preloadDateRangeEnd attributes but they did nothing. I created my own CalendarDataModel which uses the preloadDateRangeStart and preloadDateRangeEnd and enables the items but the calendar on the screen allows only the dates of the current month to be selected. Note that the preloadDateRangeStart is today's date and preloadDateRangeEnd is today's date plus 2 months. I am missing something here for sure. Can someone help me please?

    Read the article

  • javax.xml.bind.MarshalException

    - by sandeep
    Hi, I am getting javax.xml.bind.MarshalException error. I am sending List from my webservice to the backingbean and I have this error. Here is my code: Backing bean @WebServiceRef(wsdlLocation = "http://localhost:26565/Login_webserviceService/Login_webservice?WSDL") public String login() { System.out.println("Login Phase entered"); int result = 0; List list; List finalList = null; try { Weblogin.LoginWebserviceService service = new Weblogin.LoginWebserviceService(); Weblogin.LoginWebservice port = service.getLoginWebservicePort(); result = port.login(voterID, password); Weblogin.LoginWebservice port1 = service.getLoginWebservicePort(); list = port1.candDetails(1); finalList = list; this.setList(finalList); } catch (Exception e) { e.printStackTrace(); } if (result == 1) return "polling"; else return "login"; } Webservice public List candDetails(int pollEvent) { List resultList = null; List finalList = null; try { if (pollEvent == 1) { resultList = em.createNamedQuery("Cantable.findAll").getResultList(); finalList = resultList; } } catch (Exception e) { e.printStackTrace(); } return resultList; }

    Read the article

  • Why can't I have static public fields in my managed beans?

    - by AlanObject
    I just started using the Netbeans 7.1 beta and it is calling out errors of a type which I have never seen before. Specifically: A managed bean with a public field should not declare any scope other than @Dependent. The fields it is complaining about are public static final. I can understand the restriction on non-static fields, but I can't think of a good reason this would not be allowed for a static field. Unfortunately I use a lot of them since I don't like having constants in my code. I note that even though I get the red dot in the margin in the editor, the maven-driven build still works and GlassFish still runs my application the way I would expect. So what is my denoument on this issue? Am I going to have to move my static fields elsewhere or is there another way of handling this?

    Read the article

  • Strange lifecycle behaviour with f:ajax and valueChangedListener

    - by gerry
    I want to use the f:ajax tag to update a part of a page with a editor gui, which style depends on a selectOneMenu and its selected item. The problem is, that if the ajax is called the server first renders the editor and then executes the valueChangedListener method. In my JSF2.0 / Facelets app I've the following code: ... <h:selectOneMenu id="typeSelect" validator="#{addEntityBean.checkType}" value="#{addEntityBean.selectedTypeAsString}" valueChangeListener="#{addEntityBean.selectedTypeChanged}"> <f:ajax render="editorGrid"/> <f:selectItems value="#{addEntityBean.entityTypeListAsString}"/> </h:selectOneMenu> ... <h:panelGrid id="editorGrid" columns="2" binding="#{addEntityBean.dynamicEditorGrid}" /> The BackingBean code looks like this: public String getSelectedTypeAsString() { return selectedTypeAsString; } public void setSelectedTypeAsString(String selectedType) { this.selectedTypeAsString = selectedType; } public Class<? extends Entity> getSelectedType() { log.severe("getSelectedType"); Class<? extends Entity> res = null; if(selectedTypeAsString != null){ int index = entityTypeListAsString.indexOf(selectedTypeAsString); res = entityTypeList.get(index); } return res; } public void selectedTypeChanged(ValueChangeEvent event){ setSelectedTypeAsString((String)event.getNewValue()); Class<? extends Entity> clazz = getSelectedType(); if(clazz != null){ try { setEntity(clazz.newInstance()); } catch (Exception e) { log.severe(e); } } else{ setEntity(null); } } public HtmlPanelGrid getDynamicEditorGrid() { HtmlPanelGrid grid = DynamicHtmlComponentCreator.createHtmlPanelGrid(); Entity entity = getEntity(); if(entity != null){ log.severe("getEntity() -->"+entity.getClassName()); grid = (HtmlPanelGrid)buildGui(grid, entity, "entityBean.entity", false); } else log.severe("getEntity() --> null"); return grid; } The problem is, that the server logs show that at first the getDynamicEditorGrid() is executed. And later the selectedTypeChanged()-listener-method. So everytime the selected editor style type is update one selection later. I.e. after a page reload (the type is initally null) the user selects the A, now the getDynamicEditorGrid() is executed again with type null and after that the type is changed to A. Again the user selects now B (after A) and now the getDynamicEditorGrid() is executed with the type A and after that the type is changed to B. What is wrong with my code? How can I fix this really strange behavior...

    Read the article

  • Enlist a table's columns in other component

    - by bungrudi
    The main goal is to have a dropdown menu where each of its menuItems represents one column of a <rich:extendedDataTable />. Above the table I have this: <rich:dropDownMenu value="Column visibility" submitMode="none" direction="bottom-right"> <c:forEach var="columnConfigVO" items="#{gridConfigurationManager.getColumnConfigs(listId)}"> <rich:menuItem value="columnConfigVO.columnId" /> </c:forEach> </rich:dropDownMenu> And then bellow that I have the usual <rich:extendedDataTable /> with its columns. I register the table columns to gridConfigurationManager component by overriding beforeRenderResponse() in ExtendedDataTable class. The problem is that <c:forEach /> is executing before renderResponse phase, thus gridConfigurationManager.getColumnConfigs(listId) return empty. The question is, how do I register the columns in gridConfigurationManager component before <c:forEach /> start executing? Or, anyone know a different approach to accomplish this? Thanks.

    Read the article

  • populate drop-down values dynamically using Ajax

    - by abhishek
    Hi, I have 3 drop-downs. 1st drop-down contains some values when the page loads. I need to populate 2 nd drop-down based on the value selected in 1st dropdown. Similarly, I need to populate 3 nd drop-down based on the value selected in 1st and 2nd dropdown. Initially I tried like this. <h:selectOneMenu value="#{stu.country}" > <f:selectItems value="#{bean.allCountries}" /> <a4j:support event="onchange" action="#{bean.retrieveStates(stu.country)}" reRender="states_dropDown"></a4j:support> </h:selectOneMenu> //ly, for 2nd drop-down <h:selectOneMenu id="states_dropDown" value="#{stu.state}" > <f:selectItems value="#{bean.allStates}" /> <a4j:support event="onchange" action="#{bean.retrieveCities(stu.country,stu.state)}" reRender="City_dropDown"></a4j:support> </h:selectOneMenu> Some times this code works fine. But some times it doesn't invoke managed bean method. Can you please help??

    Read the article

  • Using h:outputFormat to message-format the f:selectItems of a h:selectOneRadio

    - by msharma
    I am having some trouble with using h:selectOneRadio. I have a list of objects which is being returned which needs to be displayed. I am trying something like this: <h:selectOneRadio id="selectPlan" layout="pageDirection"> <f:selectItems value="#{detailsHandler.planList}" /> </h:selectOneRadio> and planList is a List of Plans. Plan is defined as: public class Plan { protected String id; protected String partNumber; protected String shortName; protected String price; protected boolean isService; protected boolean isOption; //With all getters/setters } The text that must appear for each radio button is actually in a properties file, and I need to insert params in the text to fill out some value in the bean. For example the text in my properties file is: plan_price=The price of this plan is {0}. I was hoping to do something like this: <f:selectItems value="<h:outputFormat value="#{i18n.plan_price}"> <f:param value="#{planHandler.price}"> </h:outputFormat>" /> Usually if it's not a h:selectOneRadio component, if it's just text I use the h:outputFormat along with f:param tags to display the messages in my .property file called i18n above, and insert a param which is in the backing bean. here this does not work. Does anyone have any ideas how I can deal with this? I am being returned a list of Plans each with their own prices and the text to be displayed is held in property file. Any help much appreciated. Thanks!

    Read the article

  • Click event of buttons is not fired when it causes onChange event of textbox is fired first

    - by bakkujp
    Hi All, I have a textbox like below <h:inputText value="#{bean.strQuantite}"> <a4j:support actionListener="#{tabacListCommandeAltadisDetailBean.actionListenerQuantity}" event="onchange" /> </h:inputText> I input some value into the textbox above and keep the caret inside the textbox. After that, when I continue to click a other button, the event onchange of the input text above is fired. I want to when clicking the button, the click event is fired before. Can anyone help me to solve this problem ?

    Read the article

  • How to call an action method of a UICommand Component which was rendered conditionally?

    - by gurupriyan.e
    action method is not called Please refer to this question - , One of my UICommand Component is rendered conditionally , it was said in the answer of the linked question - point 5 - that if the Component's or any of its parents rendered or disabled attributes are false - then the action method will not be called ? If thats the case- How do i achieve the same functionality? Is there a work around ? or a trick ? or any other approach ? Thanks!

    Read the article

  • Changing background color of inputfield of editable coloumn in primefaces datatable on value change

    - by Shikha
    I have an editable coloumn in dataTable. The code is: <p:column id="articleDescription" headerText="Article Description" filterBy="#{article.description}" filterMatchMode="startsWith"> <p:inputText id="description" value="#{article.description}"style="border:none; box-shadow:none;" /> </p:column> I want to change the background color of the inputText - description on the event - valueChange. How can I change that ? Also, the default background color of it should be the same as of its parent row? Is it possible? How can it be done? Thanks, Shikha

    Read the article

  • Faces on WAS 6.1

    - by Nisse
    Hello, I'm running Java Facets on a IBM WebSphere 6.1. I'm getting this strange error message when I start the server: [2009-07-21 15:49:35:784 CEST] 00000015 ServletWrappe E SRVE0100E: Did not realize init() exception thrown by servlet Faces Servlet: java.lang.IllegalStateException: ApplicationAssociate ctor not called in same callstack as FacesConfigParser.contextInitialized(). Does anyone have an idea what's wrong?

    Read the article

  • Download File from server that uses Icefaces form based authentication

    - by user266443
    I am a newbie to ICEfaces and i have a requirement where i need to download a document from a given url (http://ipaddress/formexec?objectid=201). This URL uses a form based authentication that is deployed through ICEFaces. i tracked the request of this URL and i get the following line: &ice.submit.partial=false&ice.event.target=loginForm%3Aj_id33&ice.event.captured=loginForm%3Aj_id33 Is there any libraries or code to download the document by successfully passing the username and password.

    Read the article

< Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >