how to set default in CAF

Hi,

Please check the attached snapshot of my UI.
There I want to make ALL as default. That means if the user doesn’t select anything and click on the search button, the ALL option should get selected automatically.

Can somebody please suggest how to implement this.

Regards
jyoti

Hi Jyoti,

I assume that the component you are using is a “Select Many Listbox”.

One thing that I think will work would be to have in the choices area 2 entry:

  • one simple option that has the Item Label = “ALL” and the value binded to the following in the backing bean

  public SelectItem getEmptyItem(){
    return new SelectItem("");
  }

I think this will get the focus automatically and will be your default.

  • one option group with the rest of the choices.

I have attached 2 images.

Please let me know if it works.

Cheers,
Vlad Turian
item_label.jpg
two_choices.jpg

Hi Turian,

Could you please help me on Shell creation(the steps) or can you tell me which guide to refer for this.

Regards
Jyoti

Hi Jyoti,

The documentation is rather scarce on this topic, but you can find information in 8-2-SP1_CAF_Development_Help.pdf (Chapter 10 - MWS Runtime Assets)

As for the steps for creating a shell:

  1. Login to MWS using the sysadmin user.
  2. Go to Administration > Administration Dashboard > User Interface > Shell Administration
  3. Click on “Create New Shell”
  4. Set Name, Description and Parent Shell.
  5. Hit “Create” button

After the Shell is created you can edit it, update the shell header or footer and in general you can play around with the shell.

Now regarding the deployment of the Shells (and other assets) I have found till now 3 ways to do it.

  1. No deployment :slight_smile:

This means that you create the shell in every environment your application will be deployed.
This is the least desired solution as it double/triples… the work you have to do depending on the number of environments you have

  1. Add it to the deployment package

In the Deployer on your build environment add this asset to the deployment package - Please let me know if you have questions on this.

  1. Reference it in the xmlImport file.
    Steps:
  • create your shell locally
  • download it from the MWS portal
  • extract the xmlImport file from the package you downloaded
  • save it in your project
  • import it in the xmlImport file you have in your project
  • deploy the application

This is my preferred approach as this way the shell ends up also in the SCM system (CVS, SVN, Git, etc…).

Please let me know if this helps as the shell question was on a different topic then the initial question from this thread.

Best regards,
Vlad Turian

Hi Vlad

I’m hitting this problem now - one day before a demo!

I’ve received an exported shell as a zip file, within which is the following:

resources/
WEB-INF/config/xmlImport.xml

I assume that xmlImport.xml is what you’re saying I should put in some sort of project? Is it a CAF project or a Deployer project, or something else? When it’s in, you say to refer to it from a different xmlImport.xml file? Where’s that?

Thanks!

Rob

Hi Robert,

What you can do is to either:

  1. CAF project
    Take the xmlImport.xml file and put in in your task application (CAF) project
    What I usually do is that I rename this to myshell.xml and then import it in the xmlImport.xml file of the project

it is something like this:


<include include="/WEB-INF/myshell.xml"></include>

or

  1. Deployer project
    Install the shell on your build server (source server).
    Go to the Solutions/Deployer
    Go to your deployer project
    click Define
    Select the deployment set and then from the right-hand side select your shell.

Please let me know if this helps you.

Best regards,
Vlad Turian