[JBoss Seam] - how to do indexed/map-backed fields in seam?
by mwkohout
I've got a datatable that iterates over the results of a fairly expensive search.
For each row, the user can perform an action on the entity for that row of the table depending on the value of a selectOneMenu.
Since each row needs to have it's own "operation" field, I've tried to implement this using a Map-backed field(with the user's id as the key). For some reason this isn't working. On selection, nothing is placed in the Map and no exceptions are being thrown.
here's the bit of facelet:
| <rich:dataTable id="memberSelectList" value="#{viewStudyAction.userSearchList}" >
| <rich:column>
| <h:selectOneMenu value="#{viewStudyAction.userRole[possibleMember.umnDID]}">
| <s:selectItems value="#{viewStudyAction.getAllStudyRoles()}" var="role" label="#{role.name}"/>
| <a4j:support event="onchange" reRender="memberGrid" ajaxSingle="true"/>
| </h:selectOneMenu>
| </rich:column>
| </rich:dataTable>
|
here's the bit of the named component:
| @Name(value = "viewStudyAction")
| @Scope(value = ScopeType.CONVERSATION)
| @AutoCreate
| public class ViewStudyAction {
| HashMap userRole =new HashMap();
| public List<StudyRole> getAllStudyRoles()
| {
| return studyRoleHome.getAllRoles();
| }
|
any suggestions, explicitives, or rants would be welcome
Mike Kohout
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4105206#4105206
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4105206
18 years, 8 months
[JBoss Seam] - Re: Difference between session timeout and not logged in yet
by xshuang
Good afternoon Jacob,
Thanks a lot for the reply. I followed your suggestion but still have a problem. That is, I cannot add a message to be displayed on the logon page.
In my components.xml,
In my AuthenticatorAction, I have
public void sessionExpired() {
FacesMessages.instance().add("Your session is expired, please login again");
}
I got an warning and the message is not displayed. I also tried to inject facesMessages
@In(create=true)
FacesMessages facesMessages;
Then use
facesMessages.add("Your session is expired, please login again");
Then I got another warning saying facesMessages cannot be null. I checked the forum and one user says facesMessages is not available at the RESTORE_VIEW phase.
Could you give me more information regarding how to make this work or there is a possible workaround? Thank you very much for your help.
Have a nice day!
Best regards,
Sheng
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4105202#4105202
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4105202
18 years, 8 months
[JBoss Seam] - Dynamic widgets?
by whafrog
What is the best way to deal with dynamic ajax creation of new widgets?
I have a page where I need to track, say, lender benefits. One lender might offer 0.5% interest rate reduction after 12 on-time payments, another might offer 0.3% after the first 12 payments, and another 0.5% after 24. Ideally the lender could click a "+" button to add as many of that type of benefit as they like.
I know how to do this in normal DHTML. In the old days I'd use javascript to dynamically generate the widget to display and a unique name on the form, and then process the request parameters on the server side, parsing the parameter names for the benefit type.
But how do I do this in Seam? Any good tutorials out there that go beyond the basic one-to-one widget-datafield examples?
TIA, Jon
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4105196#4105196
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4105196
18 years, 8 months