[jboss-user] [JBoss Seam] - Re: How can I pass parameters to action methods
FWIW, I should have mentioned that passEdit.selectPass(pass) was getting called but that the pass parameter was null. In any event, I switched over to using a page parameter for the pass id. It seems like this is probably better anyway (bookmarkable). View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4089887#4089887 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4089887 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: How can I pass parameters to action methods
[EMAIL PROTECTED] wrote : So you need to find another way to pass an object from request to request. One way is to pass its identifier and to load it from the database in the second request. Another is to stick it into the session an retrieve it from there by identifier. But the booking app does pass the object as a parameter [from main.xhtml]: h:dataTable id=hotels value=#{hotels} var=hot rendered=#{hotels.rowCount0} | ... | s:link id=viewHotel value=View Hotel action=#{hotelBooking.selectHotel(hot)}/ The only reason I can guess why this works is that the hotels DataModel property is outjected from a session-scoped SFSB. However, I read in one of Dan Allen's articles on IBM that anonymous wrote : Outjected variables are placed directly into the variable context, independent of their backing bean. So this suggests that it shouldn't matter. Continuing... [EMAIL PROTECTED] wrote : And the last and best way is to put it into the conversation context in the first request, name the context variable in the action method as a parameter, and let Seam look it up from the conversation context in the second request. This is really what Seam is about. Doesn't it depend on what the bounds of the conversation are? According to the Yuan/Heute book, anonymous wrote : The default conversation scope spans only two pages However, I find this statement a bit misleading. If you read further, it suggests that is really a single request/response cycle. And wouldn't this then explain why trying to pass the object using default conversation scope doesn't work? But then how does it work in the booking app, unless the scope of the component outjecting the property has some influence on the lifecycle of the outjected property. Clearly I'm missing something I need to know about how all this works. Please someone explain. TIA, Clark View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4088861#4088861 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4088861 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: How can I pass parameters to action methods
Apologies to Yuan/Heute, there's really nothing misleading about their statement. They spelled it out pretty clearly when I reread section 7.1. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4088871#4088871 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4088871 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: How can I pass parameters to action methods
anonymous wrote : The default conversation scope spans only two pages This is incorrect, if it is not further narrowed down after ...pages. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4088879#4088879 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4088879 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: How can I pass parameters to action methods
anonymous wrote : But the booking app does pass the object as a parameter [from main.xhtml]: No, it's magic. http://jira.jboss.com/jira/browse/JBSEAM-1734 View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4088878#4088878 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4088878 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: How can I pass parameters to action methods
Ok, so I'm not insane (at least not due to this ;-) ) But I'm doing it just like it's done (famous last words) in the booking demo. That is: | @Stateful | @Name(passSearch) | public class PassSearchAction implements PassSearchFacade { |... | @DataModel | private ListPass passList; | | | | rich:dataTable id=passList | var=pass | value=#{passList} |rendered=#{not empty(passList)} | ... | h:column | f:facet name=headerAction/f:facet | s:link view=/passEdit.xhtml |value=Select | id=pass | action=#{passEdit.selectPass(pass)} | /s:link | /h:column | /rich:dataTable And the magic ain't happening. Maybe this is no longer a recommended way to do it, but I'd like to know why it's not working for me. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=407#407 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=407 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: How can I pass parameters to action methods
Can you define variable argument EL functions in tld files, as in: | function-signature | java.lang.String concat(java.lang.String...) | /function-signature public static String concat(String... strings) { | StringBuilder sb = new StringBuilder(); | for (int j = 0; j strings.length; j++) | sb.append(strings[j]); | return sb.toString(); | } View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4026638#4026638 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4026638 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: How can I pass parameters to action methods
No, its not supported by EL. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4026805#4026805 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4026805 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: How can I pass parameters to action methods
You need to understand the JSF request lifecycle. In the request in which your page is rendered, page.globalListingsId can be successfully resolved in some context. Apparently it can't be resolved in any context (session, conversation, event, etc.) when you do the next request and execute the action. The callThisAction(parameter) syntax in the EL is really just a shortcut for a lookup/injection of that parameter contextual variable that happens when the action is executed. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4025532#4025532 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4025532 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: How can I pass parameters to action methods
My requirement is to get an identifier in which link I have clicked in the backing bean. I am able to find a solution for this. In XHTML File - c:forEach items=#{listingSearch.pagesLinks} var=page s:link action=#{listingSearch.next()} value=#{page.globalListingId} f:param name=linkId value=#{page.globalListingId} / /s:link /c:forEach In Backing bean --- @RequestParameter private String linkId; public void next() { System.out.println(You Clicked on link Id : + this.linkId); return; } or FacesContext facesContext = FacesContext.getCurrentInstance(); HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest(); String linkIdFromCtx = ((String[])request.getParameterMap() .get(linkId))[0]; System.out.println(Ctx: You Clicked on link Id : + linkIdFromCtx); View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4025588#4025588 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4025588 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: How can I pass parameters to action methods
You need to look at the Seam example applications, or really, any JSF example application. I often had the same reflex when I started learning JSF and tried the same approach as you. You can not pass objects between requests by putting them into a link. Check the booking demo app and how it uses @DataModel and @DataModelSelection, this is what you probably want. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4025595#4025595 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4025595 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: How can I pass parameters to action methods
I can't use DataModel and DataModelSelection because I can't use DataTable. I need to render the links horizontally. Is there anyway I can render DataTable horizontally? View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4025597#4025597 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4025597 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: How can I pass parameters to action methods
So you need to find another way to pass an object from request to request. One way is to pass its identifier and to load it from the database in the second request. Another is to stick it into the session an retrieve it from there by identifier. And the last and best way is to put it into the conversation context in the first request, name the context variable in the action method as a parameter, and let Seam look it up from the conversation context in the second request. This is really what Seam is about. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4025607#4025607 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4025607 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: How can I pass parameters to action methods
Btw, don't use JSTL with JSF, it's a bad combination. You are already using Facelets, so add xmlns:ui=http://java.sun.com/jsf/facelets; and work with ui:repeat instead. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4025625#4025625 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4025625 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: How can I pass parameters to action methods
Sorry to jump in here but I actually had the same problem! [EMAIL PROTECTED] wrote : ...And the last and best way is to put it into the conversation context in the first request, name the context variable in the action method as a parameter, and let Seam look it up from the conversation context in the second request. This is really what Seam is about. As far as I understood it he has a list as a context variable and wants to pass the id of an object contained in the list as action method parameter. So the list is within conversation context but JSF doesn't resolve the id to some string that is therefore null but it would work if he would write listingSearch.next(3) - in case page.globalListingId would be 3. So is there any way to force JSF to resolve page.globalListingId to a string (assuming it is an Integer, String, ... - anything that can be cast to string without problems)? I would greatly appreciate any hints / 2 line examples because this has been some pain for me too. Thanks a lot in advance! View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4025630#4025630 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4025630 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: How can I pass parameters to action methods
No, JSF is dumb. You could create a Facelets function and call it like this: #{myFunctions:myToString(o)} View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4025632#4025632 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4025632 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: How can I pass parameters to action methods
Ahh, I see. Thank you very much! View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4025633#4025633 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4025633 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user