[JBoss Seam] - Re: javax.el.ELException , unable to localize the error
by dkane
The bean (quite similar to "HotelSearchAction in booking example"):
import java.util.List;
| import javax.ejb.Remove;
| import javax.ejb.Stateful;
| import javax.persistence.EntityManager;
| import javax.persistence.PersistenceContext;
| import org.jboss.seam.ScopeType;
| import org.jboss.seam.annotations.Destroy;
| import org.jboss.seam.annotations.Factory;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Scope;
| import org.jboss.seam.annotations.datamodel.DataModel;
| import org.jboss.seam.annotations.security.Restrict;
|
| @Stateful
| @Name("partSearch")
| @Scope(ScopeType.SESSION)
| //@Restrict("#{identity.loggedIn}")
| public class PartSearchAction implements PartSearch
| {
|
| @PersistenceContext
| private EntityManager em;
|
| private String searchString;
| private int pageSize = 10;
| private int page;
|
| @DataModel
| private List<PartCMP> parts;
|
| //-------------------------------------------------------------------------------------
| //
|
| private void doSearch()
| {
| parts = em.createQuery("select p from PartCMP p where partnumber like #{pattern}")
| .setMaxResults(pageSize)
| .setFirstResult( page * pageSize )
| .getResultList();
| }
|
| //-------------------------------------------------------------------------------------
| //
| public void findParts()
| {
| page = 0;
| doSearch();
| //return("main");
| }
|
| //-------------------------------------------------------------------------------------
| //
| public int getPageSize()
| {
| return(pageSize);
| }
|
| //-------------------------------------------------------------------------------------
| //
| public String getSearchString()
| {
| return(searchString);
| }
|
| //-------------------------------------------------------------------------------------
| //
| public boolean isNextPageAvailable()
| {
| return(parts!=null && parts.size()==pageSize);
| }
| //-------------------------------------------------------------------------------------
| //
| public void nextPage()
| {
| page++;
| doSearch();
| }
| //-------------------------------------------------------------------------------------
| //
| public void setPageSize(int pageSize)
| {
| this.pageSize = pageSize;
| }
|
| //-------------------------------------------------------------------------------------
| //
| public void setSearchString(String searchString)
| {
| this.searchString = searchString;
| }
|
| //-------------------------------------------------------------------------------------
| //
| @Factory(value="pattern", scope=ScopeType.EVENT)
| public String getSearchPattern()
| {
| return(searchString==null ? "%" : '%' + searchString.toLowerCase().replace('*', '%') + '%');
| }
|
| //-------------------------------------------------------------------------------------
| //
| @Destroy @Remove
| public void destroy()
| {}
|
| }
|
xhtml form :
<h:form id="searchCriteria">
| <fieldset>
| <h:inputText id="searchString" value="#{partSearch.searchString}" style="width: 165px;">
| </h:inputText>
|
| <a:commandButton id="findPartsBtn" value="Find part" action="#{partSearch.findParts}" reRender="searchResults"/>
| <a:status>
| <f:facet name="start">
| <h:graphicImage value="/img/spinner.gif"/>
| </f:facet>
| </a:status>
| <br/>
| <h:outputLabel for="pageSize">Maximum results:</h:outputLabel>
| <h:selectOneMenu value="#{partSearch.pageSize}" id="pageSize">
| <f:selectItem itemLabel="5" itemValue="5"/>
| <f:selectItem itemLabel="10" itemValue="10"/>
| <f:selectItem itemLabel="20" itemValue="20"/>
| </h:selectOneMenu>
| </fieldset>
| </h:form>
|
When I comment the link to #{partSearch.findParts} (command button code), page is displayed fine , although calls to other partSearch methods exist in this page.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4055700#4055700
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4055700
18Â years, 10Â months
[JBoss Seam] - Re: s:link does not work in rich:tree
by deved
Here is the html output for one rich:treeNode
| <table border="0" cellpadding="0" cellspacing="0" id="j_id2:j_id5:Link 2:j_id8" style="width: 100%;" rich:nodeId="j_id8">
| <tbody>
| <tr id="j_id2:j_id5:Link 2:j_id8:mainRow" onclick=" return false;">
| <td class="dr-tree-h-ic dr-tree-h-ic-line-node">
| <div>
| <img class="dr-tree-h-ic-img" id="j_id2:j_id5:Link 2:j_id8:handle:img" src="/helloseam/a4j.res/images/spacer.gif.seam" />
| </div>
| </td>
| <td class="dr-tree-h-ic dr-tree-h-ic-line-clp" id="j_id2:j_id5:Link 2:j_id8:icon" rich:draggableoptions="{'parameters':{'dragSourceId':'j_id2:j_id5:Link 2:j_id8','j_id2:j_id5:Link 2:j_id8':'j_id2:j_id5:Link 2:j_id8'} } " rich:dropzoneoptions="{'parameters':{} } ">
| <img class="dr-tree-h-ic-img" src="/helloseam/a4j.res/images/iconLeaf.gif.seam" />
| </td>
| <td class="dr-tree-h-text rich-tree-node " id="j_id2:j_id5:Link 2:j_id8:text" nowrap="nowrap" rich:highlightedclass="dr-tree-i-hl rich-tree-node-highlighted" rich:selectedclass="dr-tree-i-sel rich-tree-node-selected">
| <a id="j_id2:j_id5:Link 2:j_id9" href="/helloseam/node2.seam?cid=9">Link 2</a>
| </td>
| </tr>
| </tbody>
| </table>
|
do you need the full html output?
thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4055695#4055695
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4055695
18Â years, 10Â months
[JBoss Seam] - Re: seam app + another app using SSO
by koenhandekyn
i don't know if this is going to help you but i sovled a related issue for single sign on as described below to log in to my seam application from a URL.
usage : https://host:port/appdomain/SingleSignOn.seam?login=aaa&password=bbb
for your problem, i guess a similar approach could be taken, while also consuming an extra parameter being the url parameter.
at the end of the flow you than can redirect to the original URL with
@In("#{facesContext.externalContext}")
| private ExternalContext externalContext;
and
externalContext.redirect(documentURL);
a quick and dirty approach I use:
from pages.xml
<page view-id="/singleSignOn.xhtml"
| action="#{identity.login}">
| <navigation from-action="#{identity.login}">
| <rule if="#{identity.loggedIn}">
| <redirect view-id="/home.xhtml"/>
| </rule>
| </navigation>
| </page>
with an empty singleSignOn.xhtml page
while reading two request parameters within my AuthenticationAction bean
@Stateless
| @Name("authenticator")
| public class AuthenticatorAction implements AuthenticatorI {
|
| @Logger
| Log log;
|
| @RequestParameter
| String login;
|
| @RequestParameter
| String password;
|
| ...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4055685#4055685
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4055685
18Â years, 10Â months