Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
INLINE issue. Please suggest
Raj1502
Hello Everybody,
I want your suggestion in the issue i am facing in teamsite templating requirement.
Scenario: In the DCT, i have many multiselect dropdowns such as (Access Super Region, Access Region, Country etc) where values comes from database using inline command. These values are deployed to the databse using data-deploy plugin and by creating deployment xml which has the dbSchema which maps the DCT fields to the table columns.
Requirement: Users want to have default values selected for these above dropdowns based on the frequent selections they normally do. So they will not to individually select all the boxes. Requirement is to have a check box in the DCT which says, Default Regional Access. If the check box is selected, in the DCT, only default values selected be shown and if it is unchecked, user will see all the values which comes from database, like before. When the DCT loads, check box must be already selected so uers will see only default values.
Solution: By using Form APIs, We can hard-code default values for the drop-down select boxes and can make it to show the values if check box is selected.
Issue: As i had mentioned that right now values come from databse using inline and inline is executed at the time of form init only. and if i make function using form api on check-box's onItemChange event, it works fine when the check box is selected but it doesnt work if check box is not selected as it doesn't populate the values from database as inline works only at the time of DCT load.
Can you please throw some light on how alternatively i can do this. Or is there any way inline could be called on item change.
Teamsite 6.7.2/WINDOWS
Thanks,
Raj
Find more posts tagged with
Comments
Adam Stoller
Verify if I have this right:
)
shameem
Have the business user to redefine the requirement slightly without any impact on content author/user experience. I would suggest the following if possible.
Process 1:
1. If you have previliges to add a column (IsDefault) on the region table, make the frequently used region set as True.
When you are retrieving the columns make the form to show the default value and checkbox is checked. Store the default option/value to use it in Step 1.b.
1.a. If user unchecks the box make the pulldown to go to the first option "Select Any"
1.b. If user checks the box change the selected option to default.
2. If you dont have previlige to amend DB, use a temporary DCR to record these default values and read this XML once you get all the DB values to set the default selectd option.
Assumption: Pulldown contains other options when showing up default option.
Hope this helps.
nipper
A couple comments
If you must use this approach, you can use the inline to populate hidden fields and have FormAPI populate the real fields from that source.
Why use the DB if the data starts in a DCR, then just read the DCR, you can also use a callserver to read the DCR as the entries change.
Raj1502
Thanks Ghoti, Nipper and Shameem for your valuable advice.
I could select the default options using formapi setValue method which will pre select the options if the check box is selected. It served the purpose.
Thanks for support, Guys. Cheerss!!