-
1. Re: s:selectItems + s:convertEntity not pre-selecting
emiakoup Oct 2, 2008 8:40 PM (in response to monkeyden)Hello Kyle,
is your #{donors} annotated with @DataModel? Also is #{donationManager.editableDonation.donor} annotated as @DataModelSelection?
maybe it'll help. -
2. Re: s:selectItems + s:convertEntity not pre-selecting
vladimir.kovalyuk Oct 3, 2008 12:31 AM (in response to monkeyden)Make sure you implemented equals() for your
donors
-
3. Re: s:selectItems + s:convertEntity not pre-selecting
monkeyden Oct 3, 2008 4:34 AM (in response to monkeyden)
Vladimir Kovalyuk wrote on Oct 03, 2008 00:31:
Make sure you implemented equals() for yourdonors
Yes, I have both equals and hashCode. I have gotten it to the point where the initial response does match it correctly, and the correct SelectItem is selected, but the setDonor() method always receives null on the post.
-
4. Re: s:selectItems + s:convertEntity not pre-selecting
monkeyden Oct 3, 2008 5:31 AM (in response to monkeyden)Incidentally, I dropped a breakpoint in org.jboss.seam.ui.converter.EntityConverter.getAsObject() and it's never called on the submit of the form. I also have the following code to make an AJAX request:
<a4j:commandLink action="#{donationManager.setEditableDonation(donation)}" reRender="modalPanelContainer" oncomplete="#{rich:component('donationEditor')}.show() "> #{donation.name} </a4j:commandLink>
This sets the donation to be edited in the backing bean and reRenders the s:div containing a rich:modalPanel. Could this be the cause?
-
5. Re: s:selectItems + s:convertEntity not pre-selecting
damianharvey.damianharvey.gmail.com Oct 3, 2008 10:35 AM (in response to monkeyden)This is often because the scope of your backing bean is not broad enough - eg. is sent to EVENT. Have you tried changing it to CONVERSATION?
Cheers,
Damian.
-
6. Re: s:selectItems + s:convertEntity not pre-selecting
monkeyden Oct 3, 2008 2:34 PM (in response to monkeyden)
Damian Harvey wrote on Oct 03, 2008 10:35:
This is often because the scope of your backing bean is not broad enough - eg. is sent to EVENT. Have you tried changing it to CONVERSATION?
Cheers,
Damian.It's a long running conversation, so there is no way it's going out of scope. s:convertEntity likely needs the JSF lifecycle to work properly. An a4j reRender is called on the containing div of this combobox.
-
7. Re: s:selectItems + s:convertEntity not pre-selecting
damianharvey.damianharvey.gmail.com Oct 3, 2008 3:57 PM (in response to monkeyden)Sorry to be pedantic, but it's not quite clear from your answer if you have your DonationManager annotated with @Scope(ScopeType.CONVERSATION) ??
Also what does this mean:
One interesting behavior I noticed on the client is that it simply prints the index value for the select tagDo you mean that the value (label) on the Drop down is the index or do you mean when you look at the HTML source the value of the OPTION is the index?
Cheers,
Damian.
-
8. Re: s:selectItems + s:convertEntity not pre-selecting
monkeyden Oct 3, 2008 4:13 PM (in response to monkeyden)Yes, it's annotated as CONVO. I've used Seam conversations pretty extensively for nearly two years, so this is likely not the issue.
Yes, the value of the option is the index of the loop. On second thought however, resolving the selected OPTION to an entity is one of the responsibilities of convertEntity, so this probably functions as designed.
-
9. Re: s:selectItems + s:convertEntity not pre-selecting
pmuir Oct 3, 2008 11:06 PM (in response to monkeyden)Remove the ajax stuff, and check if it works ;-)