• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 514
  • Last Modified:

Form webpart connections

Hi,

I have a HTML form webpart that is customized so that it has a dropdown with list of values dynamically generated from a SharePoint list using Javascript client object model.

Attached (test.text)is my javascript that is loaded into a content editor webpart.

I have now created a 'HTML Form webpart' and customized so that the "option" elements are dynamically generated.

HTML form webpart code:

<div onkeydown="javascript:if (event.keyCode == 13) _SFSUBMIT_">
  <select id='pmsdiv' name='PM'>
  <option selected='selected'></option>
</select>  
  <input type="button" value="Go" onclick="javascript:_SFSUBMIT_"/></div>



AS you can see the javascript code in test.txt will add option elements dynamically in the Form webpart.

However, when i set up a webpart connection from HTML form webpart to another webpart on the same page, the data is not being sent to the consumer webpart.

Am not sure what I am doing wrong.

Anyhelp is appreciated., it is urgent
0
Techsavy
Asked:
Techsavy
  • 9
  • 5
1 Solution
 
Rainer JeschorCommented:
Hi,
could you please add the attachment? Thanks.

KR
Rainer
0
 
TechsavyAuthor Commented:
Hi Rainer,

I have attached the code: and the corresponding form webpart code is below.

<div onkeydown="javascript:if (event.keyCode == 13) _SFSUBMIT_">
  <select id='mydiv' name='myField'>
  <option selected='selected'></option>
</select>  
  <input type="button" value="Go" onclick="javascript:_SFSUBMIT_"/></div>
Test.txt
0
 
Rainer JeschorCommented:
Hi,

this is the code of the forms web part
<div id="pmsdiv" onkeydown="javascript:if (event.keyCode == 13) _SFSUBMIT_">
<select name="pmsselect" id="pmsselect">
	<option value="">Please select</option>
</select><input type="button" value="Go" onclick="javascript:_SFSUBMIT_"/></div>

Open in new window


Attached the script file (for the content editor web part).
You may remove the reference to jQuery if you have it already in your page.

Please remember that you have to set the connection from the form web part to your target web part again.

HTH
Rainer

P.S.: If it works please accept the other (first) question as well - thanks a lot.
formsdrop.txt
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
TechsavyAuthor Commented:
Hi Rainer,
0
 
TechsavyAuthor Commented:
Hi Rainer,

It looks like your code has lot of unused variables. Can you please check one more time
0
 
Rainer JeschorCommented:
Hi,

attached the streamlined version - sorry have been really busy yesterday.

Comment on your initial script:
The form web part will modify the content during rendering by injecting some scripting stuff. Therefore your "mistake" has been that you replaced the complete content of the surrounding div and not only the select element.

HTH
Rainer
formsdrop.txt
0
 
TechsavyAuthor Commented:
Hi Rainer,

I dont think i was replcaing the "div" i was adding html for select element. As i mentioned with what i had i was able to get the values into dropdown. it is only when i select the value it is not being passed to the connected webpart.

Thank you for your detailed help,
0
 
TechsavyAuthor Commented:
The new issue i am seeing is ..the connection  is always sending first value in the dropdown.

so If i have item 1, item 2 in my dropdown, after I hit "Go", the dropdown is reverting to Item 1 , eventhough I selected "Item 2"
0
 
TechsavyAuthor Commented:
Well ..ultimately  I realized that if you have values populating into dropdown dynamically, the form webpart is unable to send values to the connected webpart.
0
 
Rainer JeschorCommented:
Hi,
this is not true. I have simulated your code and in my case the form web part DOES send the filter to a connected list web part.
What is your target web part / filter consumer web part?

I have two lists, one with single select entries (like iRise, TTP, VS2010, TFS2010) and one other list which has these options as a choice column.

What field type is
- your select source list (text, user,...)
- your target column
?
Thanks

The more information about source list / target list/object you can provide the easier is the problem solving.

I am on the road - please be patient for responses.

HTH
Rainer
0
 
TechsavyAuthor Commented:
Hi Rainer,

The list i am binding the dropdown throu client object model is an external list.

and the data am sending to is also an external list view webpart.


So  I wonder this approach will not work with external lists?
0
 
Rainer JeschorCommented:
Hi,
I am not sure, but imho it should work.
I would have to create also two external list in my dev environment, so please give me some time.

KR
Rainer
0
 
TechsavyAuthor Commented:
sure..i am also trying one more time with different external lists
0
 
TechsavyAuthor Commented:
Hi Rainer,

I tried and i was not able to send values on another external list. as well.

I think the webparts are communicating but an empty string is being sent to the consumer webpart.
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

  • 9
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now