[JBoss Seam] - Re: Parameters not sent when using s:selectItems
by marius.oancea
In plain words what i have is:
MRPList.xhtml (snap)
====================
<s:decorate template="layout/display.xhtml">
| <ui:define name="label">Committee</ui:define>
| <h:selectOneMenu id="cmtid" value="#{markupRepresentationList.criteria.committee}">
| <s:selectItems value="#{committeeList.resultList}"
| var="committee"
| label="#{committee.title}" />
| </h:selectOneMenu>
|
| </s:decorate>
|
MRPList.page.xml
================
<?xml version="1.0" encoding="UTF-8"?>
| <page xmlns="http://jboss.com/products/seam/pages"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.0.xsd">
|
| <param name="firstResult" value="#{markupRepresentationList.firstResult}"/>
| <param name="order" value="#{markupRepresentationList.order}"/>
| <param name="from"/>
| <param name="fulltext" value="#{markupRepresentationList.criteria.fulltext}"/>
| <param name="cmtid" value="#{markupRepresentationList.criteria.committee}"/>
| </page>
|
|
| @Name("markupRepresentationList")
| public class MarkupRepresentationList extends EntityQuery {
|
| private static final String[] RESTRICTIONS = {
| "term.name like concat(#{markupRepresentationList.criteria.fulltext},'%')",
| "concept.sourceReference.ownerComittee.id=#{markupRepresentationList.criteria.committee}",
| };
|
| private MarkupSearchCriteria criteria = new MarkupSearchCriteria();
|
| @Override
| public String getEjbql() {
| return "select term from Markup term, IN (term.concepts) concept";
| }
|
| @Override
| public Integer getMaxResults() {
| return 5;
| }
|
|
| public MarkupSearchCriteria getCriteria() {
| return criteria;
| }
|
| @Override
| public List<String> getRestrictions() {
| return Arrays.asList(RESTRICTIONS);
| }
|
| }
|
|
|
|
| public class MarkupSearchCriteria {
| private String fulltext;
| private Integer committee;
|
| public String getFulltext() {
| return fulltext;
| }
|
| public void setFulltext(String fulltext) {
| this.fulltext = fulltext;
| }
|
| public Integer getCommittee() {
| return committee;
| }
|
| public void setCommittee(Integer committee) {
| this.committee = committee;
| }
|
| }
|
I also tried to create a convertor for Committee:
@Name("committeeConvertor")
| @org.jboss.seam.annotations.faces.Converter(forClass=Committee.class)
| public class CommitteeConvertor implements Converter, Serializable{
|
| @In
| private EntityManager entityManager;
|
| @Transactional
| public Object getAsObject(FacesContext context, UIComponent component, String value)
| {
| if (value != null)
| {
| try
| {
| Integer id = Integer.parseInt(value);
| if (id != null)
| {
| return entityManager.find(Committee.class, id);
| }
| }
| catch (NumberFormatException e) {
| }
| }
| return null;
| }
|
| public String getAsString(FacesContext context, UIComponent component, Object value)
| {
| if (value instanceof Committee)
| {
| Committee c = (Committee) value;
| return "" + c.getId();
| }
| else
| {
| return null;
| }
| }
|
| }
|
What i want id to have cmtid synchronised with #{markupRepresentationList.criteria.committee}, so that query can use it.
I've tried to explicitelly use the convertor but nothing works.
Any clue ? Is there any limits by using the combination: event component, "param" in pages and s:selectItems? Any howto?
I was able to make the application working when parameter is specified :
MRPList.seam?cmtid=1
But combo was not updated.
Please help :((
[/img]
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4105546#4105546
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4105546
18 years, 8 months
[JBoss Seam] - Re: Difference between session timeout and not logged in yet
by xshuang
Good morning Jacob,
Thanks a lot for the suggestion again. It is nice to have a work-around before a clean solution is implemented by the Seam development team. And I have learned a lot about JSF phases and Seam messages/facesMessages with your code.
Now I have the message displayed correctly when a user's session is expired. However, it seems that the PhaseListener also raises the session expiry event when a user logout. My goal is to differ these two scenarios. Is there a way to raise two different events with the PhaseListener?
By the way, my implementation is as follows:
Code:
1. AuthenticatorAction
public void sessionExpired() {
user.setMessage("user.session.timeout");
}
Where user is a session scope variable. This serves as the appropriately scoped message component you mentioned.
2. pages.xml
<page view-id="/security/login.xhtml">
....
3. AuthenticatorAction
public void displaySessionExpiredMessage() {
if (user != null){
if (user.getMessage() != null) {
FacesMessages.instance().addFromResourceBundle(user.getMessage());
}
user.setMessage(null);
}
}
Thank you very much for your help and have a nice day.
Best regards,
Sheng
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4105542#4105542
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4105542
18 years, 8 months
[JBossWS] - Re: JBoss, JXB and NetBeans
by alessio.soldano@jboss.com
"aroppone" wrote : Hi!
|
| I'm using Netbeans 5.5 and JBoss 4.0. I'd like to make a web service and I've written XML Schemas (or it was already made) that descripes message contents (GetMatadataRequest and GetMetadataResponse).
|
| I know that there is a tool , XJC, that can "convert" those Schemas to Java classes. How can this be done in Netbeans 5.5 (I know that 6.0 has tutorial on it)? And can those classes be used in a web service running on JBoss 4.0?
|
| Could it be wise to manually convert those Schemas to WSDLs and then generate Java classes and web services automatically? Which is to best way?
|
| Waht comes to the security I read about that JBossWS and it security guidelines, but how are those done using Netbeans?
Curently no netbeans specific tooling is available. Speaking of your issue with the given schema, I would link it to a simple manually-created wsdl and then consume this wsdl with wsconsume. See the top-down approach in the wiki documentation.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4105538#4105538
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4105538
18 years, 8 months