Search Results

Search found 3678 results on 148 pages for 'jsf jsp el'.

Page 37/148 | < Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >

  • How do i create a group of h:selectOneRadio in JSF?

    - by Nitesh Panchal
    Hello, I am trying to create a grooup of h:selectOneRadio but ui:repeat gives it different id for each row. This is my code :- <ui:repeat id="themes" value="#{RegisterBean.objBlogTemplateList}" var="item"> <p:graphicImage alt="#{item.templatePicName}" style="border: solid 5px white;width: 200px;height: 200px;" value="#{app:getCommonImagePath(item.templatePicName)}"/> <h:selectOneRadio rendered="false" value="#{RegisterBean.blogTemplateId}" layout="lineDirection" id = "rdTemplateId"> <f:selectItem itemLabel="#{item.templateName}" itemValue="#{item.templateId}"/> </h:selectOneRadio> </ui:repeat> Actually i want to create a single radio button with different selectItems in it which should be from the rows of my table in database. How do i do this?

    Read the article

  • In JSF How can I understand of multi checkboxes whether all of them is checked or not?

    - by Bariscan
    As you understand from the title above, I have a datatable and checkboxes in each row. I want to enable a button when at least one checkbox is selected, and disable it when there is no selected checkboxes (I mean all of them is unselected). I could achieve this as like if one of the checkboxes is selected, the button becomes enable. However, the reversable case I have to do is when the checkboxes is being unselected, when the last selected checbox becomes unselected, the button immediately must become disabled... BTW, I must do it without using a setter method nor a backing bean. Can I perform it by using jquery or a jsfunction, richfaces, etc? As a result, I want to learn how I can disable a button at the moment when all of the checkboxes are unselected? In order to clarify the case, here is my code below; <h:selectBooleanCheckbox id="selectionCheck" onclick="document.getElementById('form1:button1').disabled=false" value="#{_apiV2Product.selectValue}" > </h:selectBooleanCheckbox> Any help would be appreciated, Many thanks, Baris

    Read the article

  • How to pass get-parameter to backing bean in jsf?

    - by Roman
    I have get parameter with name controller. When I try to pass it (with propertyChangeListener) to my backing bean I get null instead of the real value of the parameter: <h:commandButton value="#{msg['mail.send']}" styleClass="mailbutton" action="#{mailSender.sendMail}"> <f:setPropertyActionListener target="#{mailSender.controllerName}" value="{#param.controller}"/> </h:commandButton> So, I have two questions: What is the proper way to set bean property with a get-parameter value? Actually, I've already get the value from ExternalContext#getRequestParam but maybe there are some other solutions. More interesting question: why propertyActionListener didn't work here? What does it do actually? (again I have some thoughts about it but it would be nice to read more comprehensive explanations).

    Read the article

  • how to settle JSF combobox with values depending on another combobox if both are set to required

    - by mykola
    Hi, everybody! Can anyone tell me how to automatically set <h:selectOneMenu (or any other component) with values depending on another <h:selectOneMenu if there empty elements with 'required' set to 'true' on the form? If to set <a4j:support event="onchange" reRender="anotherElement" immediate="true"/ then nothing is changed because changed value isn't set. But without immediate i always have message that this or that element cannot be empty. Here's code example that doesn't work :) <h:outputLabel value="* #{msg.someField}: "/> <h:panelGrid cellpadding="0" cellspacing="0"> <h:selectOneMenu id="someSelect" value="#{MyBean.someObj.someId}" required="true" label="#{msg.someField}" > <a4j:support event="onchange" reRender="anotherSelect" limitToList="true" immediate="true"/> <f:selectItem itemValue=""/> <f:selectItems value="#{MyBean.someList}"/> </h:selectOneMenu> <rich:message for="someSelect" styleClass="redOne"/> </h:panelGrid> <h:outputLabel value="* #{msg.anotherField}: "/> <h:panelGrid cellpadding="0" cellspacing="0"> <h:selectOneMenu id="anotherSelect" value="#{MyBean.someObj.anotherId}" required="true" label="#{msg.anotherField}" > <f:selectItem itemValue=""/> <f:selectItems value="#{MyBean.anotherList}"/> </h:selectOneMenu> <rich:message for="anotherSelect" styleClass="redOne"/> </h:panelGrid> <h:outputLabel value="* #{msg.name}: "/> <h:panelGrid cellpadding="0" cellspacing="0"> <h:inputText id="myName" value="#{MyBean.someObj.myName}" required="true" label="#{msg.name}"/> <rich:message for="myName" styleClass="redOne"/> </h:panelGrid> So, here (i repeat), if i try to change 'someSelect' then 'anotherSelect' should update its values but it doesn't because either when it tries to get value of 'someSelect' it gets null (if immediate set to 'true') or form validation fails on empty elements. How can i skip validation but get this changed value from 'someSelect'?

    Read the article

  • How to set header font style as bold for the header of the table in a pdf file, in jsf

    - by Radhika
    Hi I have used PdfPTable to convert table data into a pdf file using com.itextpdf.text.pdf.PdfPTable. Table is displaying, but table data and the header are in same style. To make difference i have to set the header font style to bold. can anybody help me out in this, I have attached my code here.. Thanks in advance import java.awt.Color; import java.util.ArrayList; import java.util.List; import javax.faces.model.ListDataModel; import com.mypackage.core.filter.domainobject.FilterResultDO; import com.itextpdf.text.Font; import com.itextpdf.text.FontFactory; import com.itextpdf.text.Phrase; import com.itextpdf.text.pdf.PdfPTable; public class PDFGenerator { //This method will generate PDF for Filter Result Screen (only DataTable level) @SuppressWarnings("unchecked") public static PdfPTable generatePDF(PdfPTable table,List filterResultDOList ,List filterResultHeaderList ) { //Initialize the table with number of columns required for the Datatable header int numberOfFilterLabelCols = filterResultHeaderList.size(); //PDF Table Frame table = new PdfPTable(numberOfFilterLabelCols); //Getting Filter Detail Table Heading for(int i = 0 ; i < numberOfFilterLabelCols; i++) { ColumnHeader commandHeaderObj = filterResultHeaderList.get(i); table.addCell(commandHeaderObj.getLabel()); } //Getting Filter Detail Data (Rows X Cols) FilterResultDO filterResultDOObj = filterResultDOList.get(0); List filterResultDataList = filterResultDOObj.getFilterResultLst(); int numberOfFilterDataRows = filterResultDataList.size(); //each row iteration for(int row = 0; row < numberOfFilterDataRows; row++) { List filterResultCols = filterResultDataList.get(row); int numberOfFilterDataCols = filterResultCols.size(); //columns iteration of each row for(int col = 0; col < numberOfFilterDataCols ; col++) { String filterColumnsValues = (String) filterResultCols.get(col); table.addCell(filterColumnsValues); } } return table; }//generatePDF }

    Read the article

  • Can I not submit a form to a servlet from JSF?

    - by simpatico
    * Unable to find matching navigation case with from-view-id '/home.xhtml' for action 'MemoServlet' with outcome 'MemoServlet' I try to accomplish it through: <h:commandButton type="submit" value="add" action="MemoServlet"/> but all the tutorials in the world only do it with a bean, which i don't want. I've come across any navigation rule that accomplishes my request.

    Read the article

  • What would be a correct implemantation of JSF Converter if I need to get an Integer to run a query?

    - by Ignacio
    HI here's my code: List.xhmtl <h:selectOneMenu value="#{produtosController.items}"> <f:selectItems value="#{produtosController.itemsAvailableSelectOne}"/> </h:selectOneMenu> <h:commandButton action="#{produtosController.createByCodigos}" value="Buscar" /> My Controller Class with innner Converter implemantation @ManagedBean (name="produtosController") @SessionScoped public class ProdutosController { private Produtos current; private DataModel items = null; @EJB private controladores.ProdutosFacade ejbFacade; private PaginationHelper pagination; private int selectedItemIndex; public ProdutosController() { } public Produtos getSelected() { if (current == null) { current = new Produtos(); selectedItemIndex = -1; } return current; } private ProdutosFacade getFacade() { return ejbFacade; } public PaginationHelper getPagination() { if (pagination == null) { pagination = new PaginationHelper(10) { @Override public int getItemsCount() { return getFacade().count(); } @Override public DataModel createPageDataModel() { return new ListDataModel(getFacade().findRange(new int[]{getPageFirstItem(), getPageFirstItem()+getPageSize()})); } }; } return pagination; } public String prepareList() { recreateModel(); return "List"; } public String prepareView() { current = (Produtos)getItems().getRowData(); selectedItemIndex = pagination.getPageFirstItem() + getItems().getRowIndex(); return "View"; } public String prepareCreate() { current = new Produtos(); selectedItemIndex = -1; return "Create"; } public String create() { try { getFacade().create(current); JsfUtil.addSuccessMessage(ResourceBundle.getBundle("/Bundle").getString("ProdutosCreated")); return prepareCreate(); } catch (Exception e) { JsfUtil.addErrorMessage(e, ResourceBundle.getBundle("/Bundle").getString("PersistenceErrorOccured")); return null; } } public String createByMarcas() { items = new ListDataModel(ejbFacade.findByMarcas(current.getIdMarca())); updateCurrentItem(); return "List"; } public String createByModelos() { items = new ListDataModel(ejbFacade.findByModelos(current.getIdModelo())); updateCurrentItem(); return "List"; } public String createByCodigos(){ items = new ListDataModel(ejbFacade.findByCodigo(current.getCodigo())); updateCurrentItem(); return "List"; } public String prepareEdit() { current = (Produtos)getItems().getRowData(); selectedItemIndex = pagination.getPageFirstItem() + getItems().getRowIndex(); return "Edit"; } public String update() { try { getFacade().edit(current); JsfUtil.addSuccessMessage(ResourceBundle.getBundle("/Bundle").getString("ProdutosUpdated")); return "View"; } catch (Exception e) { JsfUtil.addErrorMessage(e, ResourceBundle.getBundle("/Bundle").getString("PersistenceErrorOccured")); return null; } } public String destroy() { current = (Produtos)getItems().getRowData(); selectedItemIndex = pagination.getPageFirstItem() + getItems().getRowIndex(); performDestroy(); recreateModel(); return "List"; } public String destroyAndView() { performDestroy(); recreateModel(); updateCurrentItem(); if (selectedItemIndex >= 0) { return "View"; } else { // all items were removed - go back to list recreateModel(); return "List"; } } private void performDestroy() { try { getFacade().remove(current); JsfUtil.addSuccessMessage(ResourceBundle.getBundle("/Bundle").getString("ProdutosDeleted")); } catch (Exception e) { JsfUtil.addErrorMessage(e, ResourceBundle.getBundle("/Bundle").getString("PersistenceErrorOccured")); } } private void updateCurrentItem() { int count = getFacade().count(); if (selectedItemIndex >= count) { // selected index cannot be bigger than number of items: selectedItemIndex = count-1; // go to previous page if last page disappeared: if (pagination.getPageFirstItem() >= count) { pagination.previousPage(); } } if (selectedItemIndex >= 0) { current = getFacade().findRange(new int[]{selectedItemIndex, selectedItemIndex+1}).get(0); } } public DataModel getItems() { if (items == null) { items = getPagination().createPageDataModel(); } return items; } private void recreateModel() { items = null; } public String next() { getPagination().nextPage(); recreateModel(); return "List"; } public String previous() { getPagination().previousPage(); recreateModel(); return "List"; } public SelectItem[] getItemsAvailableSelectMany() { return JsfUtil.getSelectItems(ejbFacade.findAll(), false); } public SelectItem[] getItemsAvailableSelectOne() { return JsfUtil.getSelectItems(ejbFacade.findAll(), true); } @FacesConverter(forClass=Produtos.class) public static class ProdutosControllerConverter implements Converter{ public Object getAsObject(FacesContext facesContext, UIComponent component, String value) { if (value == null || value.length() == 0) { return null; } ProdutosController controller = (ProdutosController)facesContext.getApplication().getELResolver(). getValue(facesContext.getELContext(), null, "produtosController"); return controller.ejbFacade.find(getKey(value)); } java.lang.Integer getKey(String value) { java.lang.Integer key; key = Integer.decode(value); return key; } String getStringKey(java.lang.Integer value) { StringBuffer sb = new StringBuffer(); sb.append(value); return sb.toString(); } public String getAsString(FacesContext facesContext, UIComponent component, Object object) { if (object == null) { return null; } if (object instanceof Produtos) { Produtos o = (Produtos) object; return getStringKey(o.getCodigo()); } else { throw new IllegalArgumentException("object " + object + " is of type " + object.getClass().getName() + "; expected type: "+ProdutosController.class.getName()); } } } } and my EJB @Entity @ViewScoped @Table(name = "produtos") @NamedQueries({ @NamedQuery(name = "Produtos.findAll", query = "SELECT p FROM Produtos p"), @NamedQuery(name = "Produtos.findById", query = "SELECT p FROM Produtos p WHERE p.id = :id"), @NamedQuery(name = "Produtos.findByCodigo", query = "SELECT p FROM Produtos p WHERE p.codigo = :codigo"), @NamedQuery(name = "Produtos.findByDescripcion", query = "SELECT p FROM Produtos p WHERE p.descripcion = :descripcion"), @NamedQuery(name = "Produtos.findByImagen", query = "SELECT p FROM Produtos p WHERE p.imagen = :imagen"), @NamedQuery(name = "Produtos.findByMarcas", query="SELECT m FROM Produtos m WHERE m.idMarca.id = :idMarca"), @NamedQuery(name = "Produtos.findByModelos", query="SELECT m FROM Produtos m WHERE m.idModelo.id = :idModelo")}) public class Produtos implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Basic(optional = false) @Column(name = "id") private Integer id; @Column(name = "codigo") private Integer codigo; @Column(name = "descripcion") private String descripcion; @Column(name = "imagen") private String imagen; @JoinColumn(name = "id_modelo", referencedColumnName = "id") @ManyToOne(optional = false) private Modelos idModelo; @JoinColumn(name = "id_marca", referencedColumnName = "id") @ManyToOne(optional = false) private Marcas idMarca; public Produtos() { } public Produtos(Integer id) { this.id = id; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Integer getCodigo() { return codigo; } public void setCodigo(Integer codigo) { this.codigo = codigo; } public String getDescripcion() { return descripcion; } public void setDescripcion(String descripcion) { this.descripcion = descripcion; } public String getImagen() { return imagen; } public void setImagen(String imagen) { this.imagen = imagen; } public Modelos getIdModelo() { return idModelo; } public void setIdModelo(Modelos idModelo) { this.idModelo = idModelo; } public Marcas getIdMarca() { return idMarca; } public void setIdMarca(Marcas idMarca) { this.idMarca = idMarca; } @Override public int hashCode() { int hash = 0; hash += (id != null ? id.hashCode() : 0); return hash; } @Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof Produtos)) { return false; } Produtos other = (Produtos) object; if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { return false; } return true; } @Override public String toString() { return "" + codigo + ""; } }

    Read the article

  • How to zoom image on mouseover at some XY coordinate in JSF?

    - by Paul
    This is the code I use to display images. <t:dataList var="item" value="#{occasionBean.messageInfo}" layout="simple"> <h:commandLink action="#{occasionBean.selectedImage}" > <h:graphicImage styleClass="thumbnail" width="100" height="100" url="#{item.imageSnapUrl}" onclick="return setMsgId(this.id,#{item.img_id},'#{item.imageUrl}');" id="test" onmouseover="" onmouseout=""> </h:graphicImage> </h:commandLink> </t:dataList> Please give some solution.

    Read the article

  • By using ejb 3 , jsf and jboss is it possible to call a ejb method from web module?

    - by Bariscan
    Even if I have different modules in my jee application including myproject-web and myproject-ejb; is it possible to call (or inject) my ejb session bean which is in the ejb module from a managed bean which is in the web module? When I asked before, I see the following declaration: @EJB private BeanInterface yourbean However, I wanna learn that whether it is possible or not, to call each other between different contexts (one of it in ejb context, the other one -managed bean- is in web context)? Any help would be appreciated Best wishes Bariscan

    Read the article

  • JSF: attach rich:toggleControl to radio buttons or select items.

    - by arw
    Has anyone had any success attaching a rich:toggleControl component to a radio button component (h:selectOneRadio) or alternatively any of its children select items (in this case s:enumItem). Basic code example: <h:selectOneRadio value="#{backingValue}"> <s:enumItem enumValue="VAL_1" itemLabel="Value One" /> <s:enumItem enumValue="VAL_2" itemLabel="Value Two" /> <s:convertEnum /> </h:selectOneRadio> The ideal thing would be to attach the toggle control to the enumItems so I could have it switch to a particular state. However at this point I'd be happy if the toggle control can just be attached to the selectOneRadio. I've tried the toggle control as a child of the selectOneRadio and enumItems; neither works. I've also tried wrapping the toggleControl around the selectOneRadio, the toggle control works in this case but the radio buttons don't :(

    Read the article

  • how to pass javascript function argument within JSF component?

    - by Milan
    Hello everybody! I have the folowing code: <script Language="JavaScript"> function load(url) { var load = window.open(url,'','scrollbars=no,menubar=no,height=600,width=800,resizable=yes,toolbar=no,location=no,status=no'); } </script> <h:commandLink value="aaa" onclick="load('<h:outputText value="http://www.google.com" /> '); /> I want to pass attribute in JS function but probably inside onclick is not the right way. Any solution?

    Read the article

  • Is there any problem when I mix JSF with plain HTML?

    - by RhigoHR
    I have the next code: <li> <h:form rendered="#{!loginController.session}"> <h3>Inicio de Sesi&oacute;n</h3> <h:panelGrid columns="2" cellpadding="7"> <h:outputText value="Usuario: " /> <h:inputText id="loginname" value="#{loginController.loginname}" maxlength="16" /> <h:outputText value="Contrase&ntilde;a: " /> <h:inputSecret id="password" value="#{loginController.password}" maxlength="16"/> <h:outputText value="" /> <h:commandButton value="Iniciar Sesi&oacute;n" action="#{loginController.CheckValidUser}" /> </h:panelGrid> </h:form> </li> But when run that the page doesn't render the form, anybody can tell me why?

    Read the article

  • Does exist any problem with mixing jsf html xhtml?

    - by RhigoHR
    Hi! I have the next code: <li> <h:form rendered="#{!loginController.session}"> <h3>Inicio de Sesi&oacute;n</h3> <h:panelGrid columns="2" cellpadding="7" > <h:outputText value="Usuario: " /> <h:inputText id="loginname" value="#{loginController.loginname}" maxlength="16" /> <h:outputText value="Contrase&ntilde;a: " /> <h:inputSecret id="password" value="#{loginController.password}" maxlength="16"/> <h:outputText value="" /> <h:commandButton value="Iniciar Sesi&oacute;n" action="#{loginController.CheckValidUser}" /> </h:panelGrid> </h:form> </li> But when run that the page doesn't render the form, anybody can tell me why? Thx

    Read the article

  • JSF myfaces dataTable , how to avoid NBSP; tags in the TDs

    - by Peter
    Hi, I have style applied to the TD elements of the dataTable of my myfaces application. td.financialReportTd { font-family: Arial; font-size: 12px; line-height: 12px; color:black; background-color: white; padding-right: 5px; text-align: right; border:0px black solid; height: 30px; padding-top:4px; padding-left:4px; vertical-align: top; direction: rtl; } Output: <td class="financialReportTd"> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;MY TEXT </td> No matter what I try, those NBSP tags fill up the TD and position of the text changes to the worse. I tried style text-align:right; (I need RTL text), I tried direction: rtl; Nothing helps. How can I align my text to the very right of the TD and avoid those space tags?

    Read the article

  • Jsf validation error (shown by h:message) while updating Model, why?

    - by Ignacio
    List.xhtml: <h:selectOneMenu value="#{produtosController.selected.codigo}"> <f:selectItems value="#{produtosController.itemsAvailableSelectOne}"/> </h:selectOneMenu> <h:commandButton action="#{produtosController.createByCodigos}" value="Buscar" /> Controller Class method: public String createByCodigos(){ items = new ListDataModel(ejbFacade.findByCodigos(current.getCodigo())); updateCurrentItem(); return "List"; } Facade Class method: public List<Produtos> findByCodigos(Integer codigo){ Query q = em.createNamedQuery("Produtos.findByCodigo"); q.setParameter("codigo", codigo); return q.getResultList(); } Bean Class query: @NamedQuery(name = "Produtos.findByCodigo", query = "SELECT p FROM Produtos p WHERE p.codigo = :codigo") @Column(name = "codigo") private Integer codigo;

    Read the article

  • @Intertceptors does not work for web bean for JSF page.

    - by Drevlyanin
    @Named @ConversationScoped @Interceptors(MyInterceptor.class) public class BeanWeb implements Serializable { public String methodThrowException throws Exception() { throws new Exception(); } } public class MyInterceptor { @AroundInvoke public Object intercept(InvocationContext ic) throws Exception { try { return ic.proceed(); } catch (Exception e) { return null; } } } For @Stateless beans interceptor works, but for the BeanWeb interceptor does not work. And we have never entered into "intercept" method. Why is this happening? How could intercept method calls in BeanWeb? P.S.: All this spin under Glassfish 3.x.

    Read the article

  • JSF/HTML - Add a java applet to web page programmaticly.

    - by Ben
    Hi, Theres a web page i'm making which content is very dynamic and so I'm building it from inside the backing bean. I would like to add a java applet to the web page but I could not find the Java Object to correspond to the <applet> tag. So My questions are - What is the JAVA Object for an applet? How did you find it? (For similar future searches) Thanks! P.S - Just to be clear. An example: <h:PanelGroup> would be HtmlPanelGroup as a java object.

    Read the article

< Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >