Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have made a Custom WebPart, with some Custom EditorParts in it.

My Custom EditorPart consists of a simple TextBox and a Validator.

My only problem is that I'd like my TextBox to have that "..." button which default custom property fields have that you can click on and get a popupwindow where you can enter your text.

I have tried InputFormTextBox but haven't been able to customize it to resemble the SharePoint default-behaviour.

I suppose I could roll my own using jQuery but I have a feeling that I could use an existing SharePoint-control to achieve this.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

In your webpart project you can add an Application Page which will the user can enter text or whatever you'd like. Then in your web part add:

<a style="color: #08184a; text-decoration: underline;" href="" 
            onclick=" javascript:SP.UI.ModalDialog.showModalDialog({ url: '~/_layouts/yourcustomapplicationpagehere.aspx', title: 'My custom popup', height: 500, width: 700 }); return false; ">

This will allow you to use the SharePoint Modal Dialog popup.

share|improve this answer
    
Sounds like quite a good solution. Even though I was hoping for a out of the box control which I could use I think I will try this solution and if noone comes with a better solution soon I will accept yours. Thanks! –  Mohag519 Oct 8 '12 at 14:59
    
I ended up adding a CSS-class to my textbox inside the EditorPart. Then I made a jQueryplugin which applied the functionality to all textboxes which have this cssclass. And it worked well. –  Mohag519 Oct 9 '12 at 14:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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