Thanks Rick!

The model class I am using doesn’t contain a field called ID as the key.  I 
wish it did.

Here is a snippet from the model :


@Entity
public class FreeShippings implements Serializable {

    private static final long serialVersionUID = 1L;
  
   @EmbeddedId
    protected FreeShippingsPK freeShippingsPK;
    ……
}
 

Where FreeShippingsPK is defined as:

@Embeddable
public class FreeShippingsPK implements Serializable {

    @Basic(optional = false)
    @NotNull
    @Column(name = "StartDate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date startDate;

    @Basic(optional = false)
    @NotNull
    @Column(name = "EndDate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date endDate;

   // getters and setters...
}

How would I reference this type of Primary key in the hiddent INPUT tag?

Thanks!

Joaquin Valdez
joaquinfval...@gmail.com

> On Apr 16, 2016, at 11:55 AM, Rick Grashel <rgras...@gmail.com> wrote:
> 
> Hi Joaquin,
> 
> If the ID of the user (being edited?) is already known, you can just use a 
> regular <INPUT> tag.  No need to use a <s:hidden> tag.  So like this:
> 
> <input type="hidden" name="user" value="${actionBean.user.id 
> <http://actionbean.user.id/>}"/>
> 
> This presumes that you have a type converter you are using which will load 
> the user object when the parameters.  My experience with <s:input> tags has 
> been varied.  Sometimes it seems to work and in other situations it does not 
> behave as expected.  So in situations like the one you described, I will 
> generally stick with a regular <input> tag.
> 
> -- Rick
> 
> On Sat, Apr 16, 2016 at 12:49 PM, Joaquin Valdez <joaquinfval...@gmail.com 
> <mailto:joaquinfval...@gmail.com>> wrote:
> Hello!
> 
> I am trying to build a form for a table containing records that has an 
> embedded Primary Key.  How is that done?  Typically I just do this in the 
> form tag:
> 
> <s:form beanclass=“….”>
>       <s:hidden name=“user”/>
>       ….
> </s:form>
> 
> Currently I have it set up as I mentioned and when I try to retrieve the user 
> record, it comes back NULL.
> 
> Thanks!
> Joaquin Valdez
> joaquinfval...@gmail.com <mailto:joaquinfval...@gmail.com>
> 
> 
> ------------------------------------------------------------------------------
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z 
> <https://ad.doubleclick.net/ddm/clk/302982198;130105516;z>
> _______________________________________________
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net 
> <mailto:Stripes-users@lists.sourceforge.net>
> https://lists.sourceforge.net/lists/listinfo/stripes-users 
> <https://lists.sourceforge.net/lists/listinfo/stripes-users>
> 
> 
> ------------------------------------------------------------------------------
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z_______________________________________________
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to