cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jcjets
Level 3

Disable a feature within the destination dialog

Depending on the path the user chooses in the destination dialog I would like to disable and/or hide certain features on the next feature dialog.

I have tried:

ProductService productservice = (ProductService)wizard.getServices().getService(ProductService.NAME);
productservice.setProductBeanProperty(ProductService.DEFAULT_PRODUCT_SOURCE,"mybeanId", "Active","False");

as well as

wizard.getServices().setValue(wizard.getServices().resolveString("$P(mybeanId.active)"),"False");

Neither one seems to work. Has anyone been able to do this?
Labels (1)
0 Kudos
(4) Replies
enanrum
Level 9

Try not using the capitols in Active and False => use "active" and "false"

Another way I've done it in the past is I set some variable in the Events for the Dest Dialog depending on the path:

arg0.getServices().getISDatabase().setVariableValue("PATH", "ok" );

Then in the Sequences insert a Sub Sequence -> Wizard sequence after the Dest Dialog and put in the Conditions => string comparison:
Compare Text => $V(PATH)
Equals
Source => ok

Then insert 2 'Set Product Bean Prop' Wizard Actions for the Features BeanID you want to update: one action for the active property and one for the visible property!

Obviously - it's easier to just use the code!

Hope this helps!
Tom
0 Kudos
jcjets
Level 3

Thank you so much. Doing this within the dialog code just isn't working even with lowercase active and false values.

The subsequence way is working perfectly though.

Thanks,
Joe
0 Kudos
bjfrary
Level 4

I think you have to use an immutable condition on the features. Then they will not show. Be aware though that since they are immutable you want the user from being prevented from moving back and change the condition.
0 Kudos
enanrum
Level 9

Yes - I forgot to mention that - you need to basically add both scnenarios - one to make 'active' true and one to make 'active' false for the reasons BJFRARY brings up! If the user goes back and fixes or goes into the right directory - you need to set the actives to true!!!

Regards,
Tom
0 Kudos