dhtmlxwindow and content Id

Hi,



I would like to change the window content with prototype and symfony framework.



But if i look with firebug i cannot find any content ID.



I need to give an div id to prototype and i cannot add a div in my template because the submit form is itself.



If I add a div container after the submit i will have a div container in the div container.



How can i do ?



thanx

Olivier


Hi,


How did you attach the content to the window ?


If you used attachObject method, you passed the object id as a parameter:


w.attachObject(some_id);


So, this id is the id of the window content.

I use mywindow.attachURL(myurl);

this url give me a form and i want to update the content of the window by clicking on the submit button ( form validation with symfony framework)

I use prototype for that on my form but i have to give it a div id.

Best regards,

Olivier Giovanelli

Try this:

// attached form

<form …>
    <input type=“hidden” id=“divId” value="">


// main script

if (_isIE) {
    dhxWins.window(id)._frame.contentWindow.document.getElementById(“divId”).value = …

} else {
    dhxWins.window(id)._frame.contentDocument.getElementById(“divId”).value = …

}

It’s difficult to use what you just gave me because I use a php framework and I have some ajax function inside it.

Example :

<?php echo form_remote_tag(array(
'update' => 'WINDOW_CONTENT_DIV',
'url' => 'item/add',
)) ?>
<label for=“item”>Item:
<?php echo input_tag('item') ?>
<?php echo submit_tag('Add') ?>
It would be great if the content div in a window could have an ID (for example the window name)
.
Maybe it s possible to add it in the code easily ?

Best regards,
Olivier Giovanelli


What about passing div id to attachURL() as a param and extract it in php using $_GET[]?

main script >>
var divId = …;
dhxWins.window(id).attachURL(“phpscript.php?divId=”+divId);

phpscript.php >>
$divId = $_GET[“divId”];

Yes, but the problem is that I need an ID in the content div of the window because prototype.js need a div (id) for ajax and now i cannot give it one.

I think the best way would be to be able to add an ID on the content div of a dhtmlxwindow component because the php framework is very difficult to modify…

Do you think it s possible to add an ID ?

Olivier




In case of using attachURL() windows does not use divs.
Could you please provide completed demo with some comments like with from id whould be passed to?
You can sent it directly to support@dhtmlx.com

ok but i use attachURL with ajax

Your sample. I looked with firebug

<div class=“dhtmlxWindowMainContent style=“overflow: hidden; position: absolute; top: 0px; bottom: 0px; left: 0px; right: 0px;>

</div>

When i click on the “attach url” button , this div seems updated.

So i would need an ID on this div I guess like that:

<div class=“dhtmlxWindowMainContent id=“MY_ID” style=“overflow: hidden; position: absolute; top: 0px; bottom: 0px; left: 0px; right: 0px;>
</div>

maybe i am making a mistake , but i think that AttachURL with ajax (true) use this div.

No ?

Right, ajax-load use div.
To set any id value to <div class=“dhtmlxWindowMainContent”> you can use following codeline:
dhxWins.window(id)._content.childNodes[2].id = “MY_ID”;


Thank you very much …i am going to try


But I think that it’s what I need


Best regards,
Olivier