Hi Gerald, Thanks for the reply.
I shall give a full view of what am trying to do. I have a page with search facility with some parameters and obtain search results on that page. The search results is displayed in a datatable. I need to put the bean either in session or in saveState to get the row data. But if I put session or saveState , the search results will have problem. That is when I do a new search , the old search results won't be removed. The removeSession problem , I think solved, it was because the session becomes null at times. I solved i by getting new request from facescontext every time the session is called. Codes follows : jsp : <t:saveState id="st1" value="#{EXTBean}"/> <h:dataTable value="#{EXTBean.clientDataList}" var="QuotesSelected" style="width:100%;" cellspacing="0" border="0" columnClasses="column1,column2,column3 ,column4,column5,column6,column7,column8,column9,column10,column11" headerClass="dataHeader" binding="#{EXTBean.myDataTable}"> <h:column> <f:facet name="header"> <h:outputText id="select" value="Select"/> </f:facet> <h:selectBooleanCheckbox value="#{EXTBean.checked}" valueChangeListener="#{EXTBean.select}" onclick="dataTableSelectOneRadio(this);"/> </h:column> <h:column> <f:facet name="header"> <h:outputText id="client" value="Client" /> </f:facet> <h:outputText id ="clnt" value="#{QuotesSelected.parentCustomer}" rendered="true"/> </h:column> <h:column> <f:facet name="header"> <h:outputText id="brand" value="Brand" /> </f:facet> <h:outputText id="bnd" value="#{QuotesSelected.childCustomer}" /> </h:column> <h:column> <f:facet name="header"> <h:outputText id="qtNumber" value="Quote Number" /> </f:facet> <h:outputText id="qtNo" value="#{QuotesSelected.quoteNo}" /> </h:column> </h:dataTable> <h:commandButton id="createnew" action="createNew" value="#{msg.createnew}" styleClass="focusButton" immediate="true"/> <h:commandButton id="del" action="#{EXTBean.deleteQuote}" value="#{msg.delete}" styleClass="focusButton"/> <h:commandButton id="genQt" action="#{EXTBean.generateQuote}" value="#{msg.gen_qt}" styleClass="focusButton" /> <h:commandButton id="supQt" action="#{EXTBean.suppluQuote}" value="#{msg.supply_qt}" styleClass="focusButton"/> bean public String searchQuotes() throws ServiceException,ParseException { //search action method to get the results.results stored in getClientDataList() methos try { removeFromSession("clientData"); int clientId = Integer.parseInt(getClientId()); List selQuoteList = QuoteDetailFacade.getCurrentQuotes(clientId,getFromDt(),getToDt()); EXTCustomer customer; EXTCustomer parentCust; QuoteType type; Category ctg; for (Iterator iter = selQuoteList.iterator(); iter.hasNext();) { QuoteDetail key = (QuoteDetail)iter.next(); //QuotesSelected qtSel = new QuotesSelected(); setQtSel(new QuotesSelected()); getQtSel().setQuoteNo(String.valueOf(key.getQuoteNo())); customer = EXTCustomerFacade.getCustomerById(key.getCustomerId()); parentCust = EXTCustomerFacade.getCustomerById(Integer.parseInt(String.valueOf(customer.getParent_cust_id()))); getQtSel().setParentCustomer(parentCust.getCustomer_nm()); getQtSel().setChildCustomer(customer.getCustomer_nm()); List nmList = UserFacade.getNameById(key.getOwner()); for (Iterator tr = nmList.iterator(); tr.hasNext();) { Object[] obj = (Object[])tr.next(); if(obj[0] != null && obj[1] != null) { String uname = obj[0].toString() +" "+obj[1].toString(); getQtSel().setOwner(uname); } } getQtSel().setValue(String.valueOf(key.getTotalCost())); getQtSel().setVat(String.valueOf(key.getTotalVAT())); type = QuoteTypeFacade.getTypeById(key.getTypeId()); getQtSel().setTypeNm(type.getQtTypeNm()); ctg = CategoryFacade.getCtgById(key.getCategoryId()); getQtSel().setCategoryNm(ctg.getCtgNm()); getQtSel().setDateRequested(key.getDateRequested()); Logger.getLog().debug("quoteNumber : "+getQtSel().getQuoteNo()); getClientDataList().add(getQtSel()); } setSession("clientData",clientDataList); Logger.getLog().debug("clientDataList : "+clientDataList.size()); }catch(ServiceException se){Logger.getLog().error("error : "+se.getMessage());} return "searchQuotes"; } public List getClientDataList() { if(clientDataList == null) { clientDataList = new ArrayList(); } return clientDataList; } public void setClientDataList(List clientDataList) { this.clientDataList = clientDataList; } public String generateQuote() throws ServiceException { //action methos for command button genQt removeFromSession(Constants.QUOTE_DETAILS); QuoteDetail detail = null; Logger.getLog().debug("qtSelected !!!!! : "+qtSel.getQuoteNo()); String quoteNo = qtSel.getQuoteNo(); List detList = QuoteDetailFacade.getDetailsByQtNo(Integer.parseInt(quoteNo)); Logger.getLog().debug("detList : "+detList.size()); for (Iterator dt = detList.iterator(); dt.hasNext();) { detail = (QuoteDetail) dt.next(); Logger.getLog().debug("qtdetail : "+detail.getQuoteNo()); } setSession(Constants.QUOTE_DETAILS,detList); return "generatequote"; } public void select(ValueChangeEvent event) { qtSel = (QuotesSelected) myDataTable.getRowData(); } Please have a look if you can help me on this. Thanks, JS. Gerald Müllan wrote: > > Hi, > > can you post little code snippet of what you wanna exactly do? > > regards, > > Gerald > > On 11/28/06, JS <[EMAIL PROTECTED]> wrote: >> >> A big thank you to you Gerald. It worked for me. But, when I set the >> session >> separately in each bean object(but not all obejct) , I cannot remove it >> from >> the session. Why is that ? >> I used, session.removeAttribute(atrib); >> >> >> >> Gerald Müllan wrote: >> > >> > Hi, >> > >> > use t:saveState in this case. With this component, scope of the bean >> > will be longer than request but shorter than session. >> > >> > Usage: >> > >> > <t:saveState value="#{yourBean}"/> >> > >> > cheers, >> > >> > Gerald >> > >> > On 11/28/06, JS <[EMAIL PROTECTED]> wrote: >> >> >> >> Hi, >> >> >> >> I am getting the selected row value now. I am using javascript and >> >> valueChangelIstener to get the rowData. >> >> But it will work only if I gave the bean in session scope. Here is my >> >> code : >> >> jsp : >> >> >> >> function dataTableSelectOneRadio(radio) { >> >> var id = radio.name.substring(radio.name.lastIndexOf(':')); >> >> var el = radio.form.elements; >> >> for (var i = 0; i < el.length; i++) { >> >> if (el[i].name.substring(el[i].name.lastIndexOf(':')) == id) { >> >> el[i].checked = false; >> >> } >> >> } >> >> radio.checked = true; >> >> } >> >> >> >> >> >> <h:dataTable value="#{EXTBean.clientDataList}" var="QuotesSelected" >> >> style="width:100%;" cellspacing="0" border="0" >> >> columnClasses="column1,column2,column3 >> >> ,column4,column5,column6,column7,column8,column9,column10,column11" >> >> headerClass="dataHeader" binding="#{EXTBean.myDataTable}"> >> >> <h:column> >> >> <f:facet name="header"> >> >> <h:outputText id="select" value="Select"/> >> >> </f:facet> >> >> <h:selectOneRadio valueChangeListener="#{EXTBean.select}" >> >> onchange="dataTableSelectOneRadio(this);"> >> >> <f:selectItem itemValue="#{QuotesSelected.quoteNo}" itemLabel=""/> >> >> </h:selectOneRadio> >> >> >> >> >> >> bean: >> >> >> >> public void select(ValueChangeEvent event) { >> >> qtSel = (QuotesSelected) myDataTable.getRowData(); >> >> } >> >> >> >> public HtmlDataTable getMyDataTable() { >> >> return myDataTable; >> >> } >> >> >> >> public void setMyDataTable(HtmlDataTable myDataTable) { >> >> this.myDataTable = myDataTable; >> >> } >> >> >> >> >> >> If I put the bean in session scope I cannot remove the earlier session >> >> when >> >> I do the actions. >> >> How can I manage a session scoped bean ? Or can I use request scope to >> do >> >> this ? >> >> >> >> Thanks, >> >> JS. >> >> >> >> >> >> >> >> Cagatay Civici wrote: >> >> > >> >> >> >> >> >> datatable rows : >> >> >> select column1 column2 >> >> >> o row1 row1 >> >> >> o row2 row2 >> >> >> >> >> >> Generate Delete >> >> > >> >> > >> >> > Hi JS, have you tried selectOneRow in sandbox? >> >> > >> >> > http://example.irian.at/example-sandbox-20061127/selectOneRow.jsf >> >> > >> >> > Cagatay >> >> > >> >> > On 11/27/06, JS <[EMAIL PROTECTED]> wrote: >> >> >> >> >> >> >> >> >> Hi Andrew, >> >> >> >> >> >> Thanks for the reply. I have downloaded the jar. But where can I >> find >> >> the >> >> >> jenia tag library documentation ? >> >> >> >> >> >> Thanks, >> >> >> JS. >> >> >> >> >> >> >> >> >> Andrew Robinson-5 wrote: >> >> >> > >> >> >> > I recommend using the controls from "http://www.jenia.org/". They >> >> have >> >> >> > a radio and a checkbox that are made to work with data tables >> (and >> >> >> > work nicely with the tomahawk data table). >> >> >> > >> >> >> > -Andrew >> >> >> > >> >> >> > On 11/26/06, JS <[EMAIL PROTECTED]> wrote: >> >> >> >> >> >> >> >> Thanks Gerald. Let me just clear, so in short you are saying, I >> can >> >> >> use >> >> >> >> radio >> >> >> >> inside command link for just selection purpose even though its a >> >> >> circular >> >> >> >> way. >> >> >> >> >> >> >> >> Thanks, >> >> >> >> JS. >> >> >> >> >> >> >> >> Gerald Müllan wrote: >> >> >> >> > >> >> >> >> > Hi, >> >> >> >> > >> >> >> >> > from usability point of view i would suggest to delete an item >> >> >> >> > directly via clicking on a commandLink as the "o"; the >> >> requirement >> >> >> of >> >> >> >> > selecting only one entry can be also met with this approach. >> >> >> >> > >> >> >> >> > You are achieving the same result as with the radio structure, >> >> the >> >> >> >> > radio way seems little bit circular to me. >> >> >> >> > >> >> >> >> > The only way which comes to my mind to simulate the >> >> >> commandLink-radio >> >> >> >> > is doing a submit on every onchange event. But >> >> updateActionListener >> >> >> >> > will not work in this case, it`s only for components with an >> >> action >> >> >> >> > attribute (ActionSource comps). >> >> >> >> > >> >> >> >> > cheers, >> >> >> >> > >> >> >> >> > Gerald >> >> >> >> > >> >> >> >> > On 11/26/06, JS <[EMAIL PROTECTED]> wrote: >> >> >> >> >> >> >> >> >> >> Thanks Gerald. >> >> >> >> >> What I want exactly is, >> >> >> >> >> >> >> >> >> >> datatable rows : >> >> >> >> >> select column1 column2 >> >> >> >> >> o row1 row1 >> >> >> >> >> o row2 row2 >> >> >> >> >> >> >> >> >> >> Generate Delete >> >> >> >> >> >> >> >> >> >> Above shown 'o' represents radio(or checkbox or commandlink) >> >> >> Generate >> >> >> >> and >> >> >> >> >> Delete are command buttons. So when I select a row and press >> a >> >> >> command >> >> >> >> >> button I only need to get the value of the unique id. So when >> I >> >> >> user >> >> >> >> >> press >> >> >> >> >> the link or radio or check box , he can select only one row , >> >> not >> >> >> >> >> multiple >> >> >> >> >> rows. When he press another row the earlier slected one needs >> to >> >> be >> >> >> >> >> deselected. I think as you said command link works for that. >> But >> >> >> can >> >> >> I >> >> >> >> >> use >> >> >> >> >> radio inside command link ? >> >> >> >> >> >> >> >> >> >> Thanks, >> >> >> >> >> JS. >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Gerald Müllan wrote: >> >> >> >> >> > >> >> >> >> >> > Hi, >> >> >> >> >> > >> >> >> >> >> > well, in this case it would be best to use >> >> >> t:updateActionListener. >> >> >> >> You >> >> >> >> >> > can specify a value and push it to somewhere in the model. >> >> There >> >> >> is >> >> >> >> no >> >> >> >> >> > special need of a radio button or checkbox, you only have >> to >> >> give >> >> >> it >> >> >> >> a >> >> >> >> >> > commandLink and embed the updateActionListener in it. >> >> >> >> >> > >> >> >> >> >> > Have a look: >> >> >> >> >> > >> >> >> >> >> > <h:commandLink value="delete entry" >> >> >> action="#{bean.goDeleteItem}"> >> >> >> >> >> > <t:updateActionListener property="#{entry.id}" >> >> >> >> >> > value="#{bean.entryId}"/> >> >> >> >> >> > </h:commandLink> >> >> >> >> >> > >> >> >> >> >> > Hope this helps, >> >> >> >> >> > >> >> >> >> >> > cheers, >> >> >> >> >> > >> >> >> >> >> > Gerald >> >> >> >> >> > >> >> >> >> >> > On 11/26/06, JS <[EMAIL PROTECTED]> wrote: >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Thank you. Sorry for my vague question. I know we can >> select >> >> a >> >> >> row >> >> >> >> >> using >> >> >> >> >> >> checkbox. But I don't want multiple row selection. I want >> to >> >> >> select >> >> >> >> >> only >> >> >> >> >> >> one >> >> >> >> >> >> row since I want to get a unique id from that. So can I >> use >> >> >> >> >> selectBoolean >> >> >> >> >> >> checkbox for that ? Thanks for the time for me. >> >> >> >> >> >> >> >> >> >> >> >> JS. >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Cagatay Civici wrote: >> >> >> >> >> >> > >> >> >> >> >> >> > Builds are here; >> >> >> >> >> >> > http://people.apache.org/builds/myfaces/nightly/ >> >> >> >> >> >> > >> >> >> >> >> >> > There are several ways to select a row, selectOneRow is >> >> just >> >> >> one >> >> >> >> of >> >> >> >> >> >> them >> >> >> >> >> >> > that uses a radio button. >> >> >> >> >> >> > >> >> >> >> >> >> > Regards, >> >> >> >> >> >> > >> >> >> >> >> >> > Cagatay >> >> >> >> >> >> > >> >> >> >> >> >> > On 11/26/06, JS <[EMAIL PROTECTED]> wrote: >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Thanks for your reply Cagatay. Can you please tell me >> from >> >> >> where >> >> >> >> >> can I >> >> >> >> >> >> >> download jar for sandbox ? >> >> >> >> >> >> >> Is there anyway in jsf or myfaces for selecting a row ? >> >> >> >> >> >> >> >> >> >> >> >> >> >> Thanks, >> >> >> >> >> >> >> JS. >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Cagatay Civici wrote: >> >> >> >> >> >> >> > >> >> >> >> >> >> >> > Hi, >> >> >> >> >> >> >> > >> >> >> >> >> >> >> > There is a special datatable enhancement in sandbox >> for >> >> >> that >> >> >> >> >> called >> >> >> >> >> >> >> > selectOneRow; >> >> >> >> >> >> >> > >> >> >> >> >> >> >> > >> >> >> >> >> http://example.irian.at/example-sandbox-20061126/selectOneRow.jsf >> >> >> >> >> >> >> > >> >> >> >> >> >> >> > Cagatay >> >> >> >> >> >> >> > >> >> >> >> >> >> >> > On 11/26/06, JS <[EMAIL PROTECTED]> wrote: >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Hi paul, >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Thanks for the reply. Could you please tell me how >> can >> >> I >> >> >> >> select >> >> >> >> >> a >> >> >> >> >> >> row >> >> >> >> >> >> >> >> from >> >> >> >> >> >> >> >> the datatable ? I need to take a unique id from the >> >> >> datatable >> >> >> >> >> and >> >> >> >> >> >> with >> >> >> >> >> >> >> >> that >> >> >> >> >> >> >> >> id I need to do different actions. Please give me a >> >> >> solution >> >> >> >> . >> >> >> >> >> Can >> >> >> >> >> >> I >> >> >> >> >> >> >> use >> >> >> >> >> >> >> >> selectBooleanCheckBox for that purpose ? Can I get >> that >> >> >> >> unique >> >> >> >> >> >> value ? >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Thanks for the help, >> >> >> >> >> >> >> >> JS. >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Paul Spencer-3 wrote: >> >> >> >> >> >> >> >> > >> >> >> >> >> >> >> >> > JS, >> >> >> >> >> >> >> >> > I am not sure what you are asking for. A radio >> button >> >> is >> >> >> >> not a >> >> >> >> >> >> link, >> >> >> >> >> >> >> >> > this it can not be used to select a row. See the >> >> >> >> MasterDetail >> >> >> >> >> >> >> >> > example[1] for an example of linking from an >> detail >> >> row. >> >> >> >> >> >> >> >> > >> >> >> >> >> >> >> >> > Paul Spencer >> >> >> >> >> >> >> >> > >> >> >> >> >> >> >> >> > >> >> >> >> >> >> >> >> >> [1]http://example.irian.at/example-simple-20061125/masterDetail.jsf >> >> >> >> >> >> >> >> > >> >> >> >> >> >> >> >> > >> >> >> >> >> >> >> >> > JS wrote: >> >> >> >> >> >> >> >> >> Hi, >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Please anyone tell me how can I select a row from >> >> >> >> t:datatable >> >> >> >> >> >> using >> >> >> >> >> >> >> >> >> t:selectoneradioButton ? >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Please help me. >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Thanks, >> >> >> >> >> >> >> >> >> JS. >> >> >> >> >> >> >> >> > >> >> >> >> >> >> >> >> > >> >> >> >> >> >> >> >> > >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> -- >> >> >> >> >> >> >> >> View this message in context: >> >> >> >> >> >> >> >> >> >> http://www.nabble.com/select-a-row-tf2705195.html#a7546933 >> >> >> >> >> >> >> >> Sent from the MyFaces - Users mailing list archive >> at >> >> >> >> >> Nabble.com. >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> > >> >> >> >> >> >> >> > >> >> >> >> >> >> >> >> >> >> >> >> >> >> -- >> >> >> >> >> >> >> View this message in context: >> >> >> >> >> >> >> >> http://www.nabble.com/select-a-row-tf2705195.html#a7547087 >> >> >> >> >> >> >> Sent from the MyFaces - Users mailing list archive at >> >> >> >> Nabble.com. >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> > >> >> >> >> >> >> > >> >> >> >> >> >> >> >> >> >> >> >> -- >> >> >> >> >> >> View this message in context: >> >> >> >> >> >> http://www.nabble.com/select-a-row-tf2705195.html#a7547126 >> >> >> >> >> >> Sent from the MyFaces - Users mailing list archive at >> >> >> Nabble.com. >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> > >> >> >> >> >> > >> >> >> >> >> > -- >> >> >> >> >> > http://www.irian.at >> >> >> >> >> > >> >> >> >> >> > Your JSF powerhouse - >> >> >> >> >> > JSF Consulting, Development and >> >> >> >> >> > Courses in English and German >> >> >> >> >> > >> >> >> >> >> > Professional Support for Apache MyFaces >> >> >> >> >> > >> >> >> >> >> > >> >> >> >> >> >> >> >> >> >> -- >> >> >> >> >> View this message in context: >> >> >> >> >> http://www.nabble.com/select-a-row-tf2705195.html#a7548643 >> >> >> >> >> Sent from the MyFaces - Users mailing list archive at >> >> Nabble.com. >> >> >> >> >> >> >> >> >> >> >> >> >> >> > >> >> >> >> > >> >> >> >> > -- >> >> >> >> > http://www.irian.at >> >> >> >> > >> >> >> >> > Your JSF powerhouse - >> >> >> >> > JSF Consulting, Development and >> >> >> >> > Courses in English and German >> >> >> >> > >> >> >> >> > Professional Support for Apache MyFaces >> >> >> >> > >> >> >> >> > >> >> >> >> >> >> >> >> -- >> >> >> >> View this message in context: >> >> >> >> http://www.nabble.com/select-a-row-tf2705195.html#a7550444 >> >> >> >> Sent from the MyFaces - Users mailing list archive at >> Nabble.com. >> >> >> >> >> >> >> >> >> >> >> > >> >> >> > >> >> >> >> >> >> -- >> >> >> View this message in context: >> >> >> http://www.nabble.com/select-a-row-tf2705195.html#a7556438 >> >> >> Sent from the MyFaces - Users mailing list archive at Nabble.com. >> >> >> >> >> >> >> >> > >> >> > >> >> >> >> -- >> >> View this message in context: >> >> http://www.nabble.com/select-a-row-tf2705195.html#a7577462 >> >> Sent from the MyFaces - Users mailing list archive at Nabble.com. >> >> >> >> >> > >> > >> > -- >> > http://www.irian.at >> > >> > Your JSF powerhouse - >> > JSF Consulting, Development and >> > Courses in English and German >> > >> > Professional Support for Apache MyFaces >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/select-a-row-tf2705195.html#a7579540 >> Sent from the MyFaces - Users mailing list archive at Nabble.com. >> >> > > > -- > http://www.irian.at > > Your JSF powerhouse - > JSF Consulting, Development and > Courses in English and German > > Professional Support for Apache MyFaces > > -- View this message in context: http://www.nabble.com/select-a-row-tf2705195.html#a7596723 Sent from the MyFaces - Users mailing list archive at Nabble.com.