PDA

View Full Version : Is runtime configuration of the setuptypes possible?



goahead
04-18-2003, 04:01 PM
I have already created a custom bean that prompts the user for a key and verifies this key.
What I would like to do after the key has been verified is to set the "Setup Type" based on the key they entered and not even allow the customer the option of selecting the Setup Types.

Any suggestions or ideas for having my Bean set the Setup Type and then set the Setup Type Active field to false?

The following code snippet is one things I've tried so far:

ProductService service;
try {
service = (ProductService) getService(ProductService.NAME);
} catch (ServiceException se) {
getWizard().getUI().displayUserMessage(
resolveString(getWizard().getTitle()), se.getMessage(),
UserInputRequest.ERROR);
return false;
}
String beanId = new String("setupTypes");
String beanPropertyName = new String("Active");
String beanPropertyNewValue = new String("false");
try {
service.setProductBeanProperty(ProductService.DEFAULT_PRODUCT_SOURCE,
beanId, beanPropertyName, beanPropertyNewValue);
} catch (ServiceException se) {
getWizard().getUI().displayUserMessage(
resolveString(getWizard().getTitle()), se.getMessage(),
UserInputRequest.ERROR);
}

TIA for any ideas.

RobertDickau
04-22-2003, 12:45 PM
Perhaps try capitalizing the property name "Active" as "active"? Or perhaps try using the Set Product Bean Property action, at least for testing?

hbarakat
05-20-2003, 07:39 AM
Hi,

maybe I'm wrong, but it seems to me that Setup Type panel is a Wizard bean, not a product bean, so trying to use a Product service to set a Wizard Bean property will not work.

I would try this:

getWizard().getWizardTree().findWizardBean("setupTypes")

and then cast the WizardBean object as a SetupTypePanel object
and use the SetupTypePanel api to set the selected setup type

of course I don't think you can call getWizard() from a ProductBean, so you may have to do this inside a wizard action instead of a product action.

I would be interested to know if you get this working.

./H.B.

jmysak
05-31-2005, 05:01 PM
Hello, did you find a working solution to this problem? I need to do the same thing and am wondering if you tried implementing the suggestion from the prior post.