[jboss-user] [JBoss Seam] - Using DataModelSelection and @Out for an "are you sure" page

SmokingAPipe do-not-reply at jboss.com
Fri Dec 15 02:18:14 EST 2006


Here's the scenario:

I use a DataModel in my SFSB to present a table to a user.  Let's say it's a table of important things that you wouldn't normally delete, like a table of Customers.  I display this table, using the DataModel, and next to each Customer there is a "delete" button.  Clicking "delete" will take the user to another page where the details of the customer are shown, and it says, "are you sure you want to delete this customer?"  Then there is a "yes really delete" button there.

Obviously I can know which entry was clicked with a @DataModelSelection, and I can use an <s:link> to get to the "are you sure" page.  I put an @Out along with the @DataModelSelection.  When I do this, the DataModelSelection is being set and outjected, but it is being outjected after the "are you sure" page is rendered, so the details can't be displayed on that page.

As a hack, I have used a <h:commandButton> instaed of an <s:link>, and for the action I have used a method call that looks like this:

public String doIt() { 
  |     return "/are-you-sure.jsp";
  | }

What this does is it gets the value outjected before it needs to render the are-you-sure.jsp page.

So, that works, but it involves writing a method that doesn't do anything more than returning a string, and seems hackish.

Is there some nicer way to do this?  This is important to me because I do this kind of thing all the time in my application.

Thanks


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994129#3994129

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994129



More information about the jboss-user mailing list