PDA

View Full Version : Setting variable from custom bean



fneudert
10-08-2004, 08:45 AM
Hello,

I'm reading a property File after start of Installer. The Values are held in a custom bean. In the wizard sequence I need to access some of the values,
for example to show them in a dialog.

I have thougth about a $W(bean.property) solution but that doesn't work.

Another solution would be, to set a Variable out of ymy bean, but I can't find a method to do this.

Any Ideas?

Thany you in advance
with regards

Frank

crehbein
10-08-2004, 09:50 AM
From my custom beans I usually use the WizardServices API to maintain properties. From a WizardBeanEvent parameter, you can do

event.getWizard().getServices().setValue("name", "value");

Then, from wherever you have access to a WizardServices object, you can retrieve the property.

If you need to resolve the property someplace where you can't use code (ie, in a Rgy import action attached to a component), look into the product services API to set a property on the product bean. Something like this would work:



ProductService prodService = (ProductService)arg0.getService(ProductService.NAME);
prodService.setProductBeanProperty(ProductService.DEFAULT_PRODUCT_SOURCE, "productBeanName", "propName", "propValue");


Then you can use $P("productBeanName"."propName") to resolve the property value.

fneudert
10-19-2004, 03:37 AM
Thank you for the provided solution.

Frank

Ryan Cradick
02-02-2005, 02:31 PM
I am trying to create a Custom Control for my installation wizard. I want the Control to display information that I have stored in a Product Bean. Is there a way to access an object stored in a Product Bean from a Custom Control?