弹出页面插入地址薄

主要想实现的效果是:

主页面需要点击“地址薄”,弹出地址薄选择页面,然后选择完地址,又回到主页面并插入了所选的地址。

主页面需要写的javascript类似于:
[javascript]
<script language=”javascript”>
function AddressWindow()
{
try {
var url= “/pages/addressbook/selectaddressbook.faces”;
var AWnd=window.open(url,”地址簿”,”width=620,height=600,top=100,left=100, location=no,resizable=yes,toolbar=no,menubar=no,scrollbars=yes”);
if ((document.forms[0].window != null) && (!AWnd.opener)) AWnd.opener = document.forms[0].window;
AWnd.focus();
} catch(e) {
show_exception(e);
}
}
</script>
[/javascript]
地址薄选择页面需要写的javascript类似于:
[javascript]
<script language=”javascript”>
var openerid = “addressbookForm”;
var addresss = window.opener.document.getElementById(openerid+”:addresslist”).value;
function selectAll(formid,inode) {
var tableNode = document.getElementById(formid+”:addressbookClassItem”);
var tableNode2 = document.getElementById(formid+”:addressbookItem”);
var il = tableNode.getElementsByTagName(“input”);
var il2 = tableNode2.getElementsByTagName(“input”);
if(inode.checked) {
for(var i=0;i<il.length;i++) {
if(il[i].type == ‘checkbox’) {
il[i].checked = true;
}
}
for(var i=0;i<il2.length;i++) {
if(il2[i].type == ‘checkbox’) {
il2[i].checked = true;
}
}
}else {
for(var i=0;i<il.length;i++) {
if(il[i].type == ‘checkbox’) {
il[i].checked = false;
}
}
for(var i=0;i<il2.length;i++) {
if(il2[i].type == ‘checkbox’) {
il2[i].checked = false;
}
}
}
}
function selectClass(formid,inode) {
var classid = inode.parentNode.getElementsByTagName(“input”)[1].value;
var tableNode = document.getElementById(formid+”:addressbookItem”);
var il = tableNode.getElementsByTagName(“input”);
if(inode.checked) {
for(var i=0;i<il.length;i+=3) {
if(il[i+2].value == classid) {
il[i].checked = true;
}
}
}else {
for(var i=0;i<il.length;i+=3) {
if(il[i+2].value == classid) {
il[i].checked = false;
}
}
}
}
function fill_address(formid)
{
var tableNode = document.getElementById(formid+”:addressbookItem”);
var il = tableNode.getElementsByTagName(“input”);
for(var i=0;i<il.length;i++) {
if(il[i].checked) {
var email = il[i].parentNode.getElementsByTagName(“input”)[1].value;
addresss = addresss + email + “,”;
}
}
window.opener.document.getElementById(openerid+”:addresslist”).value = addresss;
window.close();
}
</script>
[/javascript]

1,917人评论了“弹出页面插入地址薄”

  1. My wife and i have been absolutely ecstatic John managed to finish up his studies through the entire precious recommendations he obtained while using the web site. It’s not at all simplistic just to happen to be freely giving solutions that many other folks may have been making money from. We really take into account we have got the blog owner to appreciate for this. The main illustrations you have made, the straightforward website navigation, the friendships you will assist to foster – it’s mostly astounding, and it is facilitating our son and the family feel that this theme is pleasurable, which is extremely essential. Many thanks for the whole thing!

  2. An outstanding share! I have just forwarded this onto a colleague who was doing a little homework on this. And he actually bought me lunch simply because I discovered it for him… lol. So let me reword this…. Thank YOU for the meal!! But yeah, thanx for spending some time to talk about this issue here on your website.|

  3. Hi there! This is my first visit to your blog! We are a collection of volunteers and starting a new initiative in a community in the same niche. Your blog provided us valuable information to work on. You have done a wonderful job!|

  4. I precisely wished to say thanks all over again. I’m not certain what I might have handled without those aspects documented by you regarding that subject. It was an absolute daunting circumstance in my circumstances, nevertheless taking a look at the well-written tactic you solved it made me to weep over joy. I am thankful for your assistance and thus trust you really know what an amazing job that you’re doing training men and women all through your websites. Most probably you have never got to know all of us.

  5. I happen to be commenting to make you be aware of what a fabulous experience my child obtained reading your blog. She figured out numerous pieces, including what it’s like to have an ideal helping spirit to make many others effortlessly fully grasp several multifaceted subject matter. You truly exceeded her expectations. Thanks for presenting the informative, trusted, explanatory and even unique guidance on that topic to Janet.

  6. Howdy just wanted to give you a quick heads up. The words in your content seem to be running off the screen in Internet explorer. I’m not sure if this is a format issue or something to do with browser compatibility but I figured I’d post to let you know. The design and style look great though! Hope you get the problem solved soon. Cheers|

  7. I am also commenting to let you understand what a brilliant encounter my wife’s girl went through checking your web site. She noticed too many things, including what it’s like to have a very effective giving nature to make other people easily learn about chosen extremely tough issues. You actually exceeded our own expected results. I appreciate you for giving the invaluable, healthy, revealing and in addition fun thoughts on your topic to Kate.

  8. I simply needed to appreciate you all over again. I’m not certain what I could possibly have worked on in the absence of the type of thoughts discussed by you directly on such problem. It actually was a very challenging dilemma in my view, nevertheless witnessing the very professional manner you resolved the issue forced me to leap for contentment. Now i’m grateful for the advice and pray you really know what an amazing job that you are doing teaching the others using your websites. Most likely you’ve never met any of us.

  9. Have you ever thought about creating an e-book or guest authoring on other sites? I have a blog based upon on the same subjects you discuss and would really like to have you share some stories/information. I know my audience would enjoy your work. If you are even remotely interested, feel free to send me an e-mail.|

  10. Hmm it appears like your site ate my first comment (it was extremely long) so I guess I’ll just sum it up what I wrote and say, I’m thoroughly enjoying your blog. I too am an aspiring blog blogger but I’m still new to everything. Do you have any tips for inexperienced blog writers? I’d really appreciate it.|

发表评论

电子邮件地址不会被公开。 必填项已用*标注