Bhaskar GR

Greenhorn
+ Follow
since Jun 13, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Bhaskar GR

you have to write <a4j:support> tag after selectItem only.
13 years ago
JSF
How to upload the file using jsf component can any body post the code of custom component. Thanking you in advance.


Bhaskar.G.r
9900924608.
13 years ago
JSF
You have to generate validation in backing bean
13 years ago
JSF
sorry man
13 years ago
JSF
<h:dataTable>
<h:column>
<f:facet name="header">
<h:outpuText value="bhaskar"/>
</f:facet>

Here value bhaskar will dispaly in header of the table.
13 years ago
JSF
How to store the html page parameters in sql data table,using html and sql only. Please help me.Thanks in advance.
using a4j support we can do easly.
13 years ago
JSF
write below code in jsp page


<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>

<%String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>
My JSF 'index.jsp' starting page
</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>

<body>
<f:view>
<h:panelGrid id="BatchesList" rendered="true">
<h:form>
<h:outputText value="Select Batch" />
<h:selectOneMenu value="#{dbl.selectedCategory}">
<f:selectItems value="#{dbl.items}" />
</h:selectOneMenu>


</h:form>


</h:panelGrid>
</f:view>
</body>
</html>
write below code in bean class


import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import javax.faces.model.SelectItem;

public class DynamicListBean {

private ArrayList dynList = new ArrayList();
private SelectItem[]items;
private List dList = new ArrayList();
private String selectedCategory;

public DynamicListBean()
{
items=populateSelectOneMenu();
}


public SelectItem[] getItems() {
return items;
}

public void setItems(SelectItem[] items) {
this.items = items;
}

public String getSelectedCategory() {
return selectedCategory;
}

public void setSelectedCategory(String selectedCategory) {
this.selectedCategory = selectedCategory;
}

public List getDList() {
return dList;
}

public void setDList(List list) {
dList = list;
}

public ArrayList getDynList() {
return dynList;
}

public void setDynList(ArrayList dynList) {
this.dynList = dynList;
}

public SelectItem[] populateSelectOneMenu() {
String a = "B";
List selectItems = new ArrayList();
for (int i = 1; i < 5; i++) {
dList.add(a + i);

}
Iterator it = dList.listIterator();
while (it.hasNext()) {
String label = (String) it.next();

selectItems.add(new SelectItem(label));
}
return (SelectItem[]) selectItems.toArray(new SelectItem[0]);
}

}
13 years ago
JSF
<f:convertDateTime type="date" pattern="dd/MM/yyyy"/>
use this tag .I think it will work
13 years ago
JSF
<h:commandButton action="#{actionBean.method}" immediate="true" value="Add"/>
checkit This.
13 years ago
JSF
Hi,Can you expain clearly whats is the problem
13 years ago
JSF
Hi ,First write binding input to slectOneMenu in jsp page.Write

private HtmlSelectOneMenu inputBinding;
in method calling
SelectOnemenuoriginalValue=inputBinding.getSubmittedValue.toString();
It gives wht you selected value;
13 years ago
JSF
remove action in faces config file and write managed bean
14 years ago
JSF
Remove from action and write managed bean in faces-config file
14 years ago
JSF
Take binding value to select oneradio, In backing bean
private HtmlSelectOneRadio slectinput;


and set/get methods.
in value change listener write this point
radio this is your original value
radio=selectinput.getSubmittedValue().toString();
14 years ago
JSF