Re: [Help] Struts/JSP -- easy way associate an "ID" to a "Value"?

From: Ryan Stewart (zzanNOtozz_at_gSPAMo.com)
Date: 06/25/04

  • Next message: Dave Monroe: "Re: Advice Java or something else"
    Date: Fri, 25 Jun 2004 06:37:22 -0500
    
    

    "Russ Perry Jr" <slapdash@rcn.com> wrote in message
    news:c630de0a.0406241446.77724ad7@posting.google.com...
    > I'm using "ID" and "Value" in the generic sense here...
    >
    > Let's say one page I had a <html:select> with a collection like this:
    >
    > <html:options collection="items" property="key" labelProperty="value"/>
    >
    > In this case "key" is what I mean by "ID", and "value" is what I mean
    > by "Value" -- the "Value" is shown to the user, but the "ID" is what
    > I plan to keep, to be saved to a database (as a reference in a table
    > to a common table as a part of normalization). Oh, and "items" is
    > just a vector of a simple object with key, value & extraValue fields,
    > and extraValue isn't always used.
    >
    > Now, what I'm running into is that they want a confirmation screen
    > (let's call that "Page X") -- print out the values the user has input
    > (on what we'll call "Page 1" and "Page 2" since we're combining two
    > screens for confirmation (our business model requires this as two
    > separate steps) and confirm before processing (i.e. saving to the
    > database and started business flow on it) all the data.
    >
    > Now, I have easy access to the "ID" on the Page2ActionForm, but I
    > want to show the "Value" instead. Obviously, I can read through the
    > original "items" object, compare the "key" values and return the
    > "value" value (ugh, sorry) when found, but that seems tedious.
    >
    > Is there an easy/better way to do this? Some way I can easily do
    > this with JSP tags? It seems <logic:iterate> is going output
    > everything (as I don't think I can put a <bean:write> of the
    > Page2ActionForm property "ID" as a value in a <logic:equal> inside
    > the <logic:iterate> as, from experience, it seems struts doesn't
    > like nesting tags :-), and I don't see any other logic or bean tag
    > examples that do what I'm looking for.
    >
    > On the off chance the above makes sense to anyone, does anyone have
    > a quick & easy way, or I should I get around to writing my find
    > routines?

    Store selected ID/value pairs in a Map in the session for display and then
    use after confirmation? You'd be better off posting to
    comp.lang.java.programmer. This group is not supposed to exist.


  • Next message: Dave Monroe: "Re: Advice Java or something else"

    Relevant Pages

    • Re: Can a Confimration Field Value be used is asp coding?
      ... FrontPage Resources, WebCircle, MS KB Quick Links, etc. ... >> The drop down is populated from a database CLASSES which contains ClassID ... >> The problem is the confirmation page. ...
      (microsoft.public.frontpage.client)
    • Re: Can a Confimration Field Value be used is asp coding?
      ... "Dave" wrote in message ... >> flexibility and thereby eliminate most of the FP database component ... >> ClassID is a unique number which I am using to drive other pages ... >> The problem is the confirmation page. ...
      (microsoft.public.frontpage.client)
    • Re: Can a Confimration Field Value be used is asp coding?
      ... The drop down is populated from a database CLASSES which contains ClassID Class Date ... ClassID is a unique number which I am using to drive other pages including the confirmation page. ... I have tried the DRW wizards to show the results, I have tried converting ClassID into usable asp ...
      (microsoft.public.frontpage.client)
    • Re: Can a Confimration Field Value be used is asp coding?
      ... > The drop down is populated from a database CLASSES which contains ClassID ... > The problem is the confirmation page. ... ClassID into usable asp ...
      (microsoft.public.frontpage.client)
    • Re: Can a Confimration Field Value be used is asp coding?
      ... You can do anything with ASP. ... The drop down is populated from a database CLASSES which contains ClassID ... The problem is the confirmation page. ...
      (microsoft.public.frontpage.client)