Ok, let me describe my problem in a bit more detail via an analogy.

Let's say I have a html table, called ComputerPartTable, in a file -
ComputerPart. This table
has the following columns : partID, partName,partDesc. Now the user
can click on the partID column and that will forward them to another page,
ComputerPartDetails, that displays the details of the selected computer
part.

Now, each part has different attributes. CPU has clockspeed, fsb speed, etc.

RAM has size, speed, etc.

Ok, so I have created a custom component, called CPUComponentPart.jwc that
lists the relevant details of a CPU component. But what I want to do is, I
want to pass
the partID to the CPUComponentPart.java so that I can lookup the correct
details of
the selected part.

So in my ComputerPart I have

@Parameter
public abstract CPUComponentPart getCPUComponentPart();

public void onFormAction(Integer partID) {
  getCPUComponentPart().setPartID(partID); // this is the line where i am
getting an exception
}

Hope that helps,

-- Izak










On 2/12/06, Alan Chandler <[EMAIL PROTECTED]> wrote:
>
> On Sunday 12 February 2006 16:10, Izak Wessels wrote:
> > Hello all,
> >
> > I was wondering, how do one inject a component into a page?
> > For example, when the user clicks on a link, I want to pass the
> > id of the link that they clicked to my custom component.
>
> I am not sure I fully understand what you are doing.
>
> If you use the @DirectLink component, you can specify some parameters
> which
> get passed to the listener when he clicks on the link.  Pass the ID (or
> the
> object if its not too big) of the right object.
>
> <a jwcid="@DirectLink" listener="listener:doSomthing" parameters="ognl:
> {supplierProduct.id, any other parameters ...}"> ...
>
>
> If on the other hand you are trying to use a component
>
> <span jwcid="@MyComponent" product="ognl:supplierProduct" >
>
> inside your java class for the component
>
> @Parameter
> public abstract CementSupplierProductSpecificationComponent getProduct();
>
> or maybe its a combination of the two?
>
> --
> Alan Chandler
> http://www.chandlerfamily.org.uk
> Open Source. It's the difference between trust and antitrust.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to