Oups, sorry,

I have set a breakpoints in the 'close' function and firebug give the
following informations :
this = "div.dialogcontainer"
this.innerhtml (with all whitepsaces and newlines) = "








                <meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">

                <title>SICS | Inscription effectuée</title>




























                <link rel="stylesheet" type="text/css" 
href="/SicsWeb/css/menu.css">


                <link rel="stylesheet" type="text/css" 
href="/SicsWeb/css/themes/
smoothness/jquery-ui-1.7.1.custom.css">
                <link rel="stylesheet" type="text/css" 
href="/SicsWeb/css/themes/
smoothness/jquery.autocomplete.css">

                <link rel="stylesheet" type="text/css" href="/SicsWeb/css/
default.css">

                <style type="text/css">
                        .ui-widget-content { font-size: .8em };
                        .ui-dialog-content iframe, .dialogcontainer iframe { 
border:
none };
                        .ui-datepicker-trigger, .hasDatepicker { cursor: 
pointer };
                </style>







                <div id="framecontent">

                <h1>Inscription effectuée</h1>

<form>

    <fieldset>
        <legend>
                <img src="/SicsWeb/img/student.general.png">
                Informations générales
        </legend>

        <table>
            <tbody><tr>
                <td><label for="">Nom</label></td>
                <td colspan="2">
                        <span class="field text">sdqsd</span>
                </td>
                <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
                <td><label for="">Prénom</label></td>
                <td colspan="2">
                    <span class="field">sqdsqsd</span>
                </td>
                <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
                <td valign="top">
                        <label for="">Né(e) le</label>
                </td>
                <td>
                        <span class="field">1999-01-05</span>
                </td>

                                <td valign="top">
                        <label style="display: inline;" for="">à         </
label>&nbsp;
                        <span class="field">Ath</span>
                </td>

                <td valign="top"><label>Sexe</label></td>
                <td valign="top">
                        <span class="field">Homme</span>
                </td>
            </tr>
            <tr>
                <td><label>Nationalité</label></td>
                <td colspan="2">
                        Belge
                </td>
                <td colspan="2">&nbsp;</td>
            </tr>
        </tbody></table>
    </fieldset>

    <fieldset>
        <legend><img src="img/student.contact.png">Contact</legend>
        <table>
            <tbody><tr>
                <td><label style="display: inline;">Type :</label></
td>
                <td></td>
            </tr>
            <tr>
                <td><label style="display: inline;">Adresse</label> :</
td>
                <td>
                    <span class="field">Chemin du pré,</span>
                    <span class="field">5 </span>
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td>
                    <span class="field"></span>&nbsp;
                    <span class="field">Ath</span>
                </td>
            </tr>
            <tr>
                <td><label>Téléphone/GSM</label></td>
                <td><span class="field"></span></td>
            </tr>
            <tr>
                <td><label>E-mail</label></td>
                <td><span class="field"></span></td>
            </tr>
        </tbody></table>
    </fieldset>

    <fieldset>
        <legend>Inscription</legend>
        <table>
            <tbody><tr>
                <td><label>Section</label></td>
                <td>
                        <span class="field"></span>
                </td>
                <td rowspan="5"></td>
                        </tr>
                        <tr>
                <td><label>Année</label></td>
                <td>
                        <span class="field"></span>
                </td>
                        </tr>
                        <tr><td colspan="2">&nbsp;</td></tr>



                </tbody></table>
    </fieldset>

</form>

                </div>
        "

On May 19, 5:24 am, thaianhduc <[email protected]> wrote:
> I have tried to make a test as your script. However, there is no
> problem with it.
>
> what i have done is:
> a function like this:
> function test_from_g(data) {
>           $("<div class=\"dialogcontainer\"></div>").append
> (data).dialog({
>              modal: true,
>              width: 300,
>              height: 400,
>              bgiframe: true,
>              buttons: {
>                 '<fmt:message key="label.Terminate" />': function() {
>                    $(this).dialog("close");
>                 },
>                 '<fmt:message key="label.Modify" />': function() {
>                    window.location = window.location;
>                 },
>                 '<fmt:message key="label.Print" />': function() {
>                    $.wait('<fmt:message key="label.Printing" />');
>                 }
>              },
>              title: 'Done'
>           });
>        }
>
> and a button in html to call it:
> <button id="test" onclick="test_from_g('<p>Testing from google</p>');
> return false;">Test from google</button>
>
> And it works! Therefore, please check your data variable appended to
> the div. There might be something you can look at. Another way is
> setting the debug inside the handler for close and see what it
> actually does.
>
> Whenever something go wrong with JS i usually use firebug and it
> helps. Please try.
>
> On May 18, 5:03 pm, GervaisB <[email protected]> wrote:
>
> > Nobody can, help me ?
> > What are you doing for closing a dialog from a button in itself ?
>
> > On May 15, 12:41 pm, GervaisB <[email protected]> wrote:
>
> > > Hi,
>
> > > Well, I have used "this" because the jquery api has an example who us
> > > "this" (http://docs.jquery.com/UI/API/1.7/Dialog#option-buttons). But
> > > with a var moh refer to the ccontent or "this", the result is the
> > > same : the dialog never close...
>
> > > On May 15, 4:20 am, thaianhduc <[email protected]> wrote:
>
> > > > Wow, "this" inside the function prefer to the button itself not the
> > > > div dialog.
> > > > A proposed solution:
>
> > > > function(data) {
> > > > var _dlg = $("<div class=\"dialogcontainer\"></div>").append(data);
> > > >                 _dlg.dialog({
> > > >                         modal: true,
> > > >                         width: width,
> > > >                         height: height,
> > > >                         bgiframe: true,
> > > >                         buttons : {
> > > >                                 '<fmt:message key="label.Terminate" />' 
> > > > : function(){
>
> > > >                                     $(_dlg).dialog("close");
> > > >                                 },
> > > >                                 '<fmt:message key="label.Modify" />' :
> > > > function(){
>
> > > > window.location=window.location;
> > > >                                 },
> > > >                                 '<fmt:message key="label.Print" />' :
> > > > function(){
> > > >                                         $.wait('<fmt:message
> > > > key="label.Printing" />');
> > > >                                 }
> > > >                         },
> > > >                         title: 'Done'
> > > >                 });
>
> > > > Hope it help.
>
> > > > On May 14, 4:22 am, GervaisB <[email protected]> wrote:
>
> > > > > Hi everybody,
>
> > > > > I have a dialog who is built like this :
> > > > > --- 8<
> > > > > -----------------------------------------------------------------------------------------------------
> > > > > var width = 500;
> > > > > var height = 500;
> > > > > if (navigator.appName.indexOf("Microsoft")!=-1) {
> > > > >         width = document.body.offsetWidth*0.6;
> > > > >         height = document.body.offsetHeight*0.75;} else {
>
> > > > >         width = window.innerWidth*0.6;
> > > > >         height = window.innerHeight*0.75;
>
> > > > > }
>
> > > > > $.get('<cor:url value="/frames/studentfolder/resume.html?folder=$
> > > > > {folder}" />',
> > > > >         function(data) {
> > > > >                 $("<div 
> > > > > class=\"dialogcontainer\"></div>").append(data).dialog({
> > > > >                         modal: true,
> > > > >                         width: width,
> > > > >                         height: height,
> > > > >                         bgiframe: true,
> > > > >                         buttons : {
> > > > >                                 '<fmt:message key="label.Terminate" 
> > > > > />' : function(){
> > > > >                                     $(this).dialog("close");
> > > > >                                 },
> > > > >                                 '<fmt:message key="label.Modify" />' 
> > > > > : function(){
> > > > >                                         
> > > > > window.location=window.location;
> > > > >                                 },
> > > > >                                 '<fmt:message key="label.Print" />' : 
> > > > > function(){
> > > > >                                         $.wait('<fmt:message 
> > > > > key="label.Printing" />');
> > > > >                                 }
> > > > >                         },
> > > > >                         title: 'Done'
> > > > >                 });});
>
> > > > > --- 8<
> > > > > -----------------------------------------------------------------------------------------------------
>
> > > > > With the first button "<fmt:message key="label.Terminate" />" I want
> > > > > to close the dialog but the line "$(this).dialog('close');" doesn't
> > > > > seems to work.
> > > > > I am under Firefox with Firebug and no errors occur..
>
> > > > > How can I close a dialog from itself ?
>
> > > > > Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to