SharePoint Study Notes-exercise series-70-573 exercise analysis-(Q15-Q18)

Source: Internet
Author: User
Tags xml example

Question15

You are creating an application page that will open a dialog box.

The dialog box uses a custom master page. You write the following code segment. (line numbers are supported for reference only .)

01 <SCRIPT type = "text/JavaScript">

02 function dialogcallback (dialogresult, returnvalue)

03 {

04}

05 function openeditdialog (ID)

06 {

07 var Options = {

08 URL: "http: // intranet/_ layouts/msgtoshow. aspx,

09 width: 300,

10 Height: 300,

11 dialogreturnvaluecallback: dialogcallback

12 };

13 sp. UI. modaldialog. showmodaldialog (options );

14}

15 </SCRIPT>

You need to ensure that the Code opens the dialog box.

What should you do?

A. Add a script link that references sp. js.

B. Add a script link that referencesSharepoint. Dialog. js.

C. At line 13, change showmodaldialog to opendialog.

D. At line 13, change showmodaldialog to commonmodaldialogopen.

 

Resolution:

This question is inCodeThe modaldialog window must be correctly displayed. For more information, see question 13.

 

Question16

You plan to add a custom tab to the ribbon in a Sharepoint web application.

You create a custom feature that contains an elements. xml file.

You need to ensure that the custom tab only appears in the document libraries of the Web application.

Which code segment shocould you add to the Custom Action node of the elements. xml file?

A. Location = "documentlibrary"

B. registrationid = "101"

C. registrationtype = "list"

D. showinlists = "false"

 

Resolution:

You need to set the display time of the tab container you added. That is, it is only associated with document libraries for display.

First, let's take a look at the ribbon element. xml example.

 <? XML version = "1.0" encoding = "UTF-8"  ?>  <  Elements  Xmlns  = "Http://schemas.microsoft.com/sharepoint"  >  <  Customaction  ID  = "Demohelloworldbutton"  Registrationtype  = "List"  Registrationid  = "101" Location  = "Commandui. Ribbon"  >      <  Commanduiextension  >        <  Commanduidefinitions  >          <  Commanduidefinition  Location  = "Ribbon. Documents. New. Controls. _ Children"  >            < Button  ID  = "Ribbon. Documents. New. Controls. demohelloworldbutton"  ALT  = "Hello World ribbon button"  Sequence  = "10"  Image32by32  = "/_ Layouts/images/ppeople. GIF"  Command  = "Demo_helloworld"  Labeltext  = "Hello World Demo" Templatealias  = "O2"  />          </  Commanduidefinition  >        </  Commanduidefinitions  >        <  Commanduihandlers  >          <  Commanduihandler  Command  = "Demo_helloworld" Commandaction  = "Javascript: Alert ('Hello world! ');"   />        </  Commanduihandlers  >      </  Commanduiextension  >    </  Customaction  >  </  Elements  > 

 

Option A. Location = "documentlibrary" is incorrect.

The location attribute of the customaction element tells customaction where to apply a custom item (that is, all the custom content in this element ). The following table lists the values and descriptions of options related to this attribute:

value

description

commandui. ribbon

for the specified registrationid, the custom item appears anywhere.

commandui. ribbon. listview

A custom item is displayed when a list view Web Part exists.

commandui. ribbon. editform

the custom item appears in the editing form.

commandui. ribbon. newform

the custom item appears on the new form.

commandui. ribbon. displayform

the custom item appears on the display form.

Option B. registrationid = "101". Used to specify the list or item content type identifier associated with this operation (customaction), or the file type or programming identifier (progid ). For their meanings, see SharePoint Study Notes-ribbon series -- reference: List definitions type and basetype, this setting is 101, that is, our custom macmaction is associated with the document library // document library. That is to say, when we select a documentlibrary list of the SharePoint website, the custom macmaction tab will appear, that is, in the customaction attribute settings, we solved the "Timing" problem.

Option C. registrationtype = "list", registrationtype attribute: used to specify the attachment registration for each operation. Possible values include none, contenttype, filetype, list, And progid.

Option D. showinlists = "false" This attribute has been deprecated and should not be used again. Optional attribute; Type: Boolean. This parameter is true if you only display custom actions on the list on the page used to manage content types. The default value is false.

Therefore, the correct option for this question should be B.

Refer:

Http://techtrainingnotes.blogspot.com/2008/01/sharepoint-registrationid-list-template.html

Http://msdn.microsoft.com/en-us/library/ff630938.aspx

Http://msdn.microsoft.com/en-us/library/ms460194.aspx

 

Question 17

You have one web application that contains several SharePoint site collections.

You need to create a feature that adds a Custom button to the orders tab on the ribbon of one site collection only.

What should you do?

A. Create a new feature. In a new <commanduidefinition> node, specify the location of ribbon. Tabs. _ children.

B. Create a new feature. In a new <commanduidefinition> node, specify the location of ribbon. Documents. Manage. Controls. _ children.

C. Modify the cmdui. xml file. In a new <commanduidefinition> node, specify the location of ribbon. Tabs. _ children.

D. Modify the cmdui. xml file. In a new <commanduidefinition> node, specify the location of ribbon. Documents. Manage. Controls. _ children.

 Resolution:

In this case, add a Custom button on the document tab of ribbonr in the site collection. So it is about the implementation of ribbon. According to requirements, 1. This button is not "generic", that is, it applies to all site collections. 2. This button will appear in the document tab.

With clear requirements, we can first exclude c.d, because cmdui. all the ribbon elements defined in XML are out-of-box, and the changes made here are displayed in all related site collections, which are "generic. Does not meet the requirements only for a site collection.

Then there is the location requirement for the document tab. The location requirement for this question should be ribbon. documents. That is, option B meets the requirements.

As for option A, there is no location definition such as ribbon. tabs.

Therefore, the correct option for this question should be B.

Refer:

Http://msdn.microsoft.com/zh-cn/library/ee537543 (V = office.14). aspx

Http://www.cnblogs.com/wsdj-ITtech/tag/Ribbon/

Http://howtosharepoint.blogspot.com/2010/06/ribbon-basics.html

 

Question 18

You have a Sharepoint site that contains 10 lists.

You need to prevent a list named list1 from appearing on the Quick Launch navigation bar.

What shoshould you configure?

A. the hidden property of list1

B. The navigation. quicklaunch. Parent. isvisible property of the site

C. The onquicklaunch property of list1

D. The quicklaunchenabled property of the site

 Resolution:

Option. the hidden property of list is used to set whether the list is displayed on the published ents page, lists page, quick launch bar, modify site content page, or add column page. note that it not only controls whether the display is on the Quick Launch bar.

Option B. You can see that the expression does not control the list, but the elements of the quickllaunch object. I have not verified whether this property exists.

Option C. This attribute is used to set whether the specified list appears on the Quick Launch of the homepage. This is exactly what we need.

Option D. Used to set whether the quick launch area can be used (displayed or not) on the web site ).

Therefore, the correct option for this question should be B.

Reference

Http://msdn.microsoft.com/zh-cn/library/microsoft.sharepoint.splist.onquicklaunch.aspx

Http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splist.onquicklaunch.aspx

Http://msdn.microsoft.com/zh-cn/library/microsoft.sharepoint.spweb.quicklaunchenabled (V = office.12). aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.