Meaningless Drivel is fun!*
The moose likes JSF and the fly likes how to set and get h:selectBooleanCheckbox value in h:datatabel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "how to set and get h:selectBooleanCheckbox value in h:datatabel" Watch "how to set and get h:selectBooleanCheckbox value in h:datatabel" New topic
Author

how to set and get h:selectBooleanCheckbox value in h:datatabel

ssjava
Greenhorn

Joined: Sep 26, 2007
Posts: 7
hello friends,

Please help me any one...i need urgent.........................
My jsf page:
------------
<h:panelGroup>
<h:panelGrid columns="6">
<h:dataTable border="2" value="#{planGroup.screenFlowValues}" var="result" bgcolor="#F1F1F1" cellpadding="2" cellspacing="1">
<h:column id="col1">
<f:facet name="header">
<hutputLabel id="lblchange" value="Select" />
</f:facet>
<h:selectBooleanCheckbox id="chkid" value="#{planGroup.chkValue}">
</h:selectBooleanCheckbox>
</h:column>
<h:column id="column1">
<f:facet name="header">
<hutputText value="Plan Group ID"></hutputText>
</f:facet>
<hutputText value="#{result.planGroupId}"></hutputText>
<h:inputHidden id="planGroupList" value="#{result.planGroupId}" />
</h:column>
<h:column id="column2">
<f:facet name="header">
<hutputText value="Plan ID"></hutputText>
</f:facet>
<hutputText value="#{result.planId}" converter="plantext"></hutputText>
</h:column>
<h:column id="column3">
<f:facet name="header">
<hutputText value="Group Description"></hutputText>
</f:facet>
<hutputText value="#{result.groupDesc}"></hutputText>
</h:column>
<h:column id="column4">
<f:facet name="header">
<hutputText value="Row Status"></hutputText>
</f:facet>
<hutputText value="#{result.rowStatus}"></hutputText>
</h:column>
<h:column id="column5">
<f:facet name="header">
<hutputText value="Modifiy"></hutputText>
</f:facet>
<h:commandLink id="link1" value="Edit" action="#{planGroup.ModifiyMemberrecord}" immediate="true"/>
</h:column>
</h:dataTable>
</h:panelGrid>
</h:panelGroup>

Here in this jsf page.......
1.value="#{planGroup.screenFlowValues}"--is Datamodel
2.For me page is displaying.How to set value to the check box and multiple selection of checkbox..when i click delete button ,
i have to delete selected rows from datamodel.how to do that what are all the changes i have to.Because boolean checkbox return only true false value.
3.by using h:datatabel i can do that ya..




My bean:
--------
public class PlanGroupBean {
private String planGroupID;
private String planID;
private String groupDesc;
private String rowStatus;
private static Log log = LogFactory.getLog(PlanGroup.class);
private static DataModel screenFlowValues;
private String hideWindows;
private String hiddenValue;
private boolean chkValue;


public List getProdlis() {
return prodlis;
}

public void setProdlis(List prodlis) {
this.prodlis = prodlis;
}
public List getData() {
return data;
}

public void setData(List data) {
this.data = data;
}

public boolean isChkValue() {
//System.out.println("CHECKED--CHK-value:"+chkValue);
return chkValue;
}

public void setChkValue(boolean chkValue) {

this.chkValue = chkValue;
}

public void setPlanGroupID(String planGroupID) {
this.planGroupID = planGroupID;
}

public String getPlanGroupID() {
return this.planGroupID;
}

public void setPlanID(String planID) {
this.planID = planID;
}

public String getPlanID() {
return this.planID;
}

public void setGroupDesc(String groupDesc) {

this.groupDesc = groupDesc;
}

public String getGroupDesc() {
return this.groupDesc;
}

public void setRowStatus(String rowStatus) {
this.rowStatus = rowStatus;
}

public String getRowStatus() {
return this.rowStatus;
}
public String getHiddenValue() {
screenFlowValues = new ListDataModel(ServiceDao.execute().fetchPlanGroupDisp());
return hiddenValue;
}

public void setHiddenValue(String hiddenValue) {
this.hiddenValue = hiddenValue;
}
public void setHideWindows(String hideWindows) {
this.hideWindows = hideWindows;

}

public String getHideWindows() {
return this.hideWindows;
}
public DataModel getScreenFlowValues() {
return screenFlowValues;
}
public void setScreenFlowValues(DataModel screenFlowValues) {
PlanGroupBean.screenFlowValues = screenFlowValues;
}

public String deleteMemberrecord()
{
}
...................................................
please help me how to set value to the check box and while clicking delete button i have to know what are all the checkbox selected..........

regards,
siva
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

"ssjava", please check your private messages.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: how to set and get h:selectBooleanCheckbox value in h:datatabel
 
Similar Threads
Unable to call Action Methof
JSF 1.2 Inner Datatable selectBooleanCheckBox - Selected options wrongly reflected in the Bean
How to get selected records from Data Table in JSF
data table,selectbooleancheckbox and row deleting
Action Event