-
1. Re: comboBox is not fetching data from my table
ilya40umov Jan 20, 2011 10:16 AM (in response to olasamuel)Accordingly to this link:
http://download.oracle.com/javaee/5/javaserverfaces/1.2/docs/tlddocs/f/selectItems.html
value false false javax.el.ValueExpression
(must evaluate tojava.lang.Object
)Value binding expression pointing at a List or array of SelectItem instances containing the information for these options. So you should create a list of SelectItem elements in your bean.
Look at the link for the details:
-
2. Re: comboBox is not fetching data from my table
olasamuel Jan 20, 2011 10:22 AM (in response to ilya40umov)So does that mean that there is no way that I can make my comboBox to fetch the data from my table? What I want to do is for comboBox to fetch the data of a row from my table and that is why I linked it with that particular role in my bean which is an enity. Any help on populating rich:comboBox from the database table based on the data that is present in the table without any need to create a list of selectItem manually?
-
3. Re: comboBox is not fetching data from my table
ilya40umov Jan 20, 2011 10:27 AM (in response to olasamuel)I'm afraid that there is no standard ways to do it. You can only try some "magic" with JavaScript and DOM on the client side. But I don't think that this is a good way.
-
4. Re: comboBox is not fetching data from my table
olasamuel Jan 20, 2011 10:51 AM (in response to ilya40umov)I found it strange that one cannot dynamically load or populate comboBox with the value of data in a table inside a database. Now lets say for example my value changes does that mean I will have to go back to my code and modify it every time the value changes?
-
5. comboBox is not fetching data from my table
ilya40umov Jan 20, 2011 11:10 AM (in response to olasamuel)I looks like we are talking about two different components. =)
1) Please, provide your code and describe what do you think rich:comboBox should do.
2) rich:comboBox shows to a user the list of options and the user can pick on of this option. Then this value will be submited immitiatly or when form is submited. The list of options can be static(f:selectItem) or dinamically obtained (f:selectItems with a list of SelectItem elements). The list of SelectItem elements can always depend on some value in your bean. So I don't understand where's your problem.
-
6. comboBox is not fetching data from my table
olasamuel Jan 20, 2011 12:34 PM (in response to ilya40umov)This is my simple code
<s:decorate id="selectUserDecoration" template="layout/edit.xhtml">
<ui:define name="label">Select User:</ui:define>
<rich:comboBox id="selectOneCb" value="" >
<f:selectItem itemLabel="Select subscriber" var="subscriber" itemValue="#{user.userName}"/>
</rich:comboBox>
</s:decorate>
userName is a property in my table entity bean. What I want the comboBox to do is to fetch the data that are store in this table and populate it and from there a user can select the vlaue from the list that the combo box presents.
if I used <f:selectItems var="subscriber" itemValue="#{selectSub.options}"/>, I get Value of tag <selectItems> attribute is incorrect error
-
7. comboBox is not fetching data from my table
ilya40umov Jan 20, 2011 1:00 PM (in response to olasamuel)Hm. I think the only problem that I haven't ever used Seam. That's why I wasn't able to answer you correctly immediately.
So definetly you should try some Seam tags which can help you to solve this task.
Look at the following link:
http://docs.jboss.org/seam/1.2.0.PATCH1/reference/en/html/controls.html
http://seamframework.org/Community/ComboboxSettingValue
http://www.coderanch.com/t/447746/JSF/java/Configuring-seam-convertEntity
If it won't help I think you should better wait for a answer from seam-guys =)
-
8. comboBox is not fetching data from my table
olasamuel Jan 20, 2011 1:33 PM (in response to ilya40umov)Thanks for the answer but they are not helping in any way. One is therefore confused where to post question when you have problem because no one seems to answer even in the seamframework community. I have tried the exact implementation of all the examples provided even in the richfaces page exadellive demo. Anyone with this experience should please help me
-
9. Re: comboBox is not fetching data from my table
ilya40umov Jan 20, 2011 1:51 PM (in response to olasamuel)IMHO You should try with simpler examples and then add some additional functions. For example you can try to find and implement some simple page with h:selectOneMenu and s:selectItems. Then add some more complecated things and so on. I will help you to anderstand all the components better and you will not need to wait for any help.