I have developed a ClientWebPart and now I want to change the title dynamically. Is it possible?


How, dynamically?

I want to show users a friendly title instead of a name of the App.

I prefer to do something like this:

target.postMessage('resize(' + ($(document).width()) + ',' + ($(document).height()) + ')', '*');

But instead of resize I want to do rename.

  • How, dynamically? Are we talking language-wise or what? – user2536 Aug 1 '13 at 7:09

Since these values are written in the ClientWebPart XML node I would say no, it is not possible.

What you could possibly do is update the title of the webpart with javascript in a similiar fashion as in this blog post: http://blah.winsmarts.com/2013-6-Resizing_the_AppPart_-_ClientWebPart.aspx (but here he is changing the size of the webpart. I have not tried it but it should be possible)

| improve this answer | |
  • I need something like this. I have noticed, that SP2013 know about the resize keyword in the postMessage. I want to do something like this: target.postMessage('<message senderId=' + getParameterByName("SenderId") + '>rename(' + Title + ')</message>', '*'); – Warlock Aug 1 '13 at 8:28

Could you not override the Title Property within your ClientWebPart class, putting the logic in there to change the returned string dynamically.

See ClientWebPart.Title in http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webpartpages.clientwebpart_members.aspx

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.