-
1. Re: unable to update selectOneMenu in datatable
ilya_shaikovsky May 5, 2009 7:53 AM (in response to waq)please check richfaces-demo a4j:repeat sample. the same thing could be performed with rich:dataTable
-
2. Re: unable to update selectOneMenu in datatable
waq May 5, 2009 8:49 AM (in response to waq)
please check richfaces-demo a4j:repeat sample
Sorry I can't find it. Please refer the link -
4. Re: unable to update selectOneMenu in datatable
waq May 5, 2009 10:27 AM (in response to waq)thanks
Lot of confusion in this example. Still can't able to figure it out that how and from where actually does the value for selectOneMenu comming from? -
5. Re: unable to update selectOneMenu in datatable
ilya_shaikovsky May 5, 2009 10:50 AM (in response to waq)you could freelly check out the demo sources . follow the link in my signature.
-
6. Re: unable to update selectOneMenu in datatable
waq May 6, 2009 6:27 AM (in response to waq)can you refer me some example(link) for rich:datatable?
-
7. Re: unable to update selectOneMenu in datatable
ilya_shaikovsky May 6, 2009 6:38 AM (in response to waq)dataTable is fully based on a4j:repeat (just provides table structure markup).. So nothing different for this case implementation with dataTable required.
-
8. Re: unable to update selectOneMenu in datatable
waq May 8, 2009 8:23 AM (in response to waq)ok its work using rich:databale and i tested it using test application but when i implemented it in my original application, its showing me a little confusing behavoiur. Please see the code:
<rich:dataTable value="#{createRegular.empList}" var="emp"> <rich:column> <h:selectBooleanCheckbox value="#{emp.checkStatus}" id="mailCheckBoxes"> </h:selectBooleanCheckbox> </rich:column> <rich:column> <f:facet name="header" > <h:outputText value="Symbol" /> </f:facet> <h:selectOneMenu value="#{emp.symbol}" required="true"> <f:selectItems value="#{PopulateInfo.symbol_list}"/> </h:selectOneMenu> </rich:column> <rich:column> f:facet name="header" > <h:outputText value="Job No" /> </f:facet> <a4j:region selfRendered="true" id="job_text"> <h:selectOneMenu value="#{emp.job_no}" required="true"> <f:selectItems value="#{PopulateInfo.job_no_list}"/> <a4j:support event="onchange" reRender="cost_code_list" action="#{createRegular.isAnySelected}" /> </h:selectOneMenu> </a4j:region> </rich:column> <rich:column> <f:facet name="header" > <h:outputText value="Cost Code" /> </f:facet> <h:selectOneMenu id="cost_code_list" value="#{emp.cost_code}" > <f:selectItems value="#{emp.cost_code_list}"/> </h:selectOneMenu> <h:message id="cost_code_error_msg" for="cost_code_list" showDetail="false" showSummary="true" styleClass="error"></h:message> </rich:column> ....
public boolean isAnySelected() { EmpList obj; int temp = 0; System.out.println(empList.size()); for(int i=0;i <this.empList.size();i++){ obj=(EmpList) empList.get(i); System.out.println(obj.isCheckStatus()); if (obj.isCheckStatus()){ temp++; break; } } if(temp == 0) { return false; } else { return true; } }//end isAnySelected
Now when i change the list it calls isAnySelected() but it shows false for the check box even if it is selected.
Please correct my mistake. -
9. Re: unable to update selectOneMenu in datatable
ilya_shaikovsky May 8, 2009 8:29 AM (in response to waq)you used region... so changes outside the region doesn't get processed.. Works just as designed.
-
10. Re: unable to update selectOneMenu in datatable
waq May 8, 2009 9:46 AM (in response to waq)removing region doesn't solve the problem either
-
11. Re: unable to update selectOneMenu in datatable
waq May 8, 2009 11:37 AM (in response to waq)please can someone help me out its very urgent
thanks -
12. Re: unable to update selectOneMenu in datatable
nbelaevski May 8, 2009 1:21 PM (in response to waq)Is action being called now when you've removed regions?
-
13. Re: unable to update selectOneMenu in datatable
waq May 11, 2009 4:42 AM (in response to waq)Ok it works fine now but now there is another issue.
Suppose there are two rows in the datatable and i have a checkbox for every row. If user selects the checkbox then it updates the corresponding list. Now if i selects both checkbox and change the last list, it update the corresponding list perfectly. But if i changes first then it do not update it's corresponding list. OR
Sometimes it throws an exception: java.util.NoSuchElementException
Here is the code that update lists:public void getList() { if(isAnySelected()) { System.out.println("In if..."); EmpList obj = null; String selectd_job = ""; PopulateInfo pi = new PopulateInfo(); List<SelectItem> temp_cost_code = new ArrayList<SelectItem>(); List<SelectItem> temp_eq_code = new ArrayList<SelectItem>(); for(int i = 0; i<empList.size(); i++) { obj = (EmpList)empList.get(i); if(obj.isCheckStatus()) { selectd_job = obj.getJob_no(); temp_cost_code.clear(); temp_eq_code.clear(); temp_cost_code = pi.getCodeList(selectd_job); temp_eq_code = pi.getEqCodeList(selectd_job); obj.setCost_code_list(temp_cost_code); obj.setEq_code_list(temp_eq_code); }//end if }//end for }//end if else { System.out.println("Select Check box"); }//end else }
-
14. Re: unable to update selectOneMenu in datatable
waq May 11, 2009 9:19 AM (in response to waq)any suggestion