Re: modalWindow Plugin

great plugin m[e]ntor!! thanks a lot!!

52 (edited by @lex 2008-10-20 9:45:08 PM)

Re: modalWindow Plugin

Hi guys,

I am struggling to have this plugin work, here is my code:

require('./xajax/xajax_core/xajax.inc.php');
    $xajax = new xajax();
    //$xajax->configure('debug',true);
    require_once( './xajax/xajax_core/xajaxPlugin.inc.php' ); //
    require_once( './xajax/xajax_core/xajaxPluginManager.inc.php' ); //
    require_once('./xajax/xajax_plugins/response/modalWindow/modalWindow.inc.php5');
    $xajax->configure('JavaScript URI','/xajax');

Then

$objResponse = new myXajaxResponse();
        $windowcontent="test"; //
        $objResponse->plugin( 'clsmodalWindow', 'addWindow', $windowcontent); //

Then

$objResponse->CreateOptions($selectId, $LoanList);
        $objResponse->plugin( 'clsmodalWindow', 'closeWindow'); //
        return $objResponse;

Nothing happens: my page still behaves the same way as before.

Any clue what is wrong ?

Thanks !

@lex

Re: modalWindow Plugin

Hi @lex,

please enable the xajax debug and/or use firebug to see whats going wrong

"test" is btw not a good window-content because there are no html tags. The plugin needs to center the window at minimum one tag to get the size of the content.
Do you use the open and close call in one function?

Kind Regards

Oliver

Re: modalWindow Plugin

Hi Oliver,

Thanks for your reply.

Yes, I do use the open & close call in the same function.  Is it a problem ?  I've even put a sleep between both to be sure it was not the speed the problem.

Here is the output of the xajax debug (I've added html tags around my "test", I suppose it is ok ?).

Thanks !

@lex

xajax debug output
Wed Oct 22 20:55:51 UTC+0200 2008
DONE [1281ms]
Wed Oct 22 20:55:51 UTC+0200 2008
ERROR: ExecuteCommand (#2, "*unknown*"):
Invalid response command: Malformed response command received.
Wed Oct 22 20:55:51 UTC+0200 2008
ERROR: xajax.dom.assign: TypeError: 'undefined' is null or not an object
Eval: element. = data;
Wed Oct 22 20:55:51 UTC+0200 2008
WARNING: $:Element with ID [{data}] not found in the document.
Wed Oct 22 20:55:51 UTC+0200 2008
ERROR: ExecuteCommand (#0, "*unknown*"):
Invalid response command: Malformed response command received.
Wed Oct 22 20:55:51 UTC+0200 2008
RECEIVED [status: 200, size: 445 bytes, time: 1234ms]:
<?xml version="1.0" encoding="utf-8" ?>
<xjx>
<cmd cmd="mw:aw" plg="clsmodalWindow">
<xjxobj>
<e><k>0</k><v><![CDATA[<html>test</html>]]></v></e>
<e><k>1</k><v></v></e>
<e><k>2</k><v></v></e>
<e><k>3</k><v></v></e>
<e><k>4</k><v>parent</v></e>
<e><k>5</k><v>100</v></e>
</xjxobj>
</cmd>
<cmd n="as" t="FieldLoanAmountRemaining30" p="innerHTML"></cmd>
<cmd cmd="mw:cw" plg="clsmodalWindow">
<xjxobj>
<e><k>0</k><v></v></e>
</xjxobj>
</cmd>
</xjx>
Wed Oct 22 20:55:50 UTC+0200 2008
SENT [135 bytes]
Wed Oct 22 20:55:50 UTC+0200 2008
SENDING REQUEST
Wed Oct 22 20:55:50 UTC+0200 2008
CALLING: 
xjxfun: DisplayLoanAmount
URI: 
http://www.xxxxxxxxxxxxxxxxxxxxxxxxxx
Wed Oct 22 20:55:50 UTC+0200 2008
POST: xjxfun=DisplayLoanAmount
&xjxr=1224701750171
&xjxargs[]=1001010001
&xjxargs[]=<![CDATA[loan2]]>
Wed Oct 22 20:55:50 UTC+0200 2008
INITIALIZING REQUEST OBJECT
Wed Oct 22 20:55:50 UTC+0200 2008
PREPARING REQUEST
Wed Oct 22 20:55:50 UTC+0200 2008
PROCESSING PARAMETERS [2]
Wed Oct 22 20:55:50 UTC+0200 2008
INITIALIZING REQUEST
Wed Oct 22 20:55:50 UTC+0200 2008
STARTING XAJAX REQUEST

55 (edited by m[e]ntor 2008-10-22 9:13:31 PM)

Re: modalWindow Plugin

hi @alex

<html> is not a good tag for modalWindows as parent-html-tag

choose something like <div>

but i don

Re: modalWindow Plugin

Yep, that's the point. Xajax puts all response commands into an internal queue until the response is returned (as XML). Afterwards the clientside script parses the response at once and processes all commands from the queue. That's the reason why the modal window doesn't seem to appear, though it does (like mentor already said...for a split second)

57 (edited by @lex 2008-10-22 9:25:04 PM)

Re: modalWindow Plugin

Hi Oliver,

I think I did not understand well the way your plugin should be used.  I'm just trying to get a grey modal window during the processing of my xajax request.
I've changed the tags to div, but I still get the same problem.
Should I use the closewindow in another xajax call ?

Thanks in advance for your help !

@lex

Re: modalWindow Plugin

@lex, sounds like your lookijg for a loading message. You don't have to fire another xajax request to let the modal window disappear. Take a look at the xajax callbacks You have to open the modal window before the requests starts and close it when the request is done. Look in our wiki or search in the forums for 'loading message' smile

Re: modalWindow Plugin

Hi,
we have detect another problem with the size of the greylayer, but i have found a solution for that.
So i will release 0.0.6 as soon as possible (this week).

and here is a short roadmap for the future (until end of the year):

- moveable windows
- a config setting to disable the greylayer ( for direct interact with the document )

Re: modalWindow Plugin

Hi, already something new about the announced release?

Re: modalWindow Plugin

there will be no 0.0.6 wink

i

Re: modalWindow Plugin

Would be very cool if you could provide me a patch for the greylayer issue then...
my time is running out sad

Re: modalWindow Plugin

hi ben,

have released a 0.9.0_b1 release

note the are some things experimental and not ready for live systems
but if you use it in the way like 0.0.5 you should have no problems

Re: modalWindow Plugin

Works, but the greylayer is still not filling the whole window in IE.

Re: modalWindow Plugin

Thanks for your support in the IRC channel!

Re: modalWindow Plugin

I'm currently using xajax.ext.SWFupload 0.2.1, for which I downloaded the full swfupload package form this site and extracted the xajax_core and xajax_js from this package. Everything is working fine.
Now I tried to use the modalWindow plugin, but I always get the error:
      ERROR: ExecuteCommand (#0, ): TypeError: e.style is undefined.
Then I downloaded the updated xajax files (xajax_core and xajax_js folders) and overwritten them to the current folders. Now modalWindow is working perfectly fine, but SwfUpload is giving the error:
      ERROR: ExecuteCommand (#0, ): Invalid response command: Malformed response command received.
Please tell me how can I make use them both at the same time without any erros?

Re: modalWindow Plugin

hi smughal

i have do this 2 days ago and it works here

could you please post more informations

Re: modalWindow Plugin

So m[e]ntor I just grabbed the latest version, since I see that you cleaned up the code and made it far more object oriented in the javascript part. It really is nice, but there was just one thing that was bugging me. Why have you never implemented an option to allow for if the overlay is up to click on the overlay to close the window?

Therefore, I took the opportunity to implement this into the newest version ;].

The zip I am posting contains the new files. However, the modalWindow.js is not compressed. I am going to leave that up to who ever wants to compress it.

You can grab the new files at:
http://www.gfx-null.com/MW/modalWindow.zip

By default the new option is set to false. So even if you put the new version in, you will not have to change your code unless you want to be able to click the overlay to close the window.

Here is an example of how to enable it:

   

$Response->clsmodalWindow->addWindow($window, array('color' => '#000000', 
                                                                        'opacity' => 50,
                                                                        'frame' => 'parent',
                                                                        'bOverlay' => true,
                                                                        'bOverlayClick' => true));

Do note that $Response is the xajax response, and $window is just a variable containing the window content etc.

Basically to enable it just add 'bOverlayClick' => true in the array after 'bOverlay' => true. Otherwise if you do not want to be able to click to close just do not include 'bOverlayClick' => true or set it to 'bOverlayClick' => false. Either it doesn't matter, because it is defaulted to FALSE if it isn't included in the array.

Enjoy the new feature.

Thanks m[e]ntor for the great plugin. I just felt it could be a little more user friendly for the end user instead of having to search directly for a close button in the window. Most sites with popups these days just allow you to close the window by clicking off of it.

Re: modalWindow Plugin

Hello,

i hope you read this post although the last one is not uptodate.

Like other people described, I have still the same problem with an unknown error.

I invested many hours but I still havent any clou.

XAJAX generates the following output:

xajax debug output
Tue Mar 31 2009 12:20:16 GMT+0200

DONE [158ms]

Tue Mar 31 2009 12:20:16 GMT+0200

ERROR: ExecuteCommand (#0, "*unknown*"):
Invalid response command: Malformed response command received.

Tue Mar 31 2009 12:20:16 GMT+0200

RECEIVED [status: 200, size: 209 bytes, time: 156ms]:
<?xml version="1.0" encoding="utf-8" ?>
<xjx>
<cmd color="#000000" opacity="50" frame="parent" bOverlay="1" bOverlayClick="1" cmd="mw:aw" plg="clsmodalWindow"><![CDATA[<div>just a content</div>]]></cmd>
</xjx>

Tue Mar 31 2009 12:20:16 GMT+0200

SENT [43 bytes]

Tue Mar 31 2009 12:20:16 GMT+0200

SENDING REQUEST

Tue Mar 31 2009 12:20:16 GMT+0200

CALLING: 
xjxfun: test_modal_window
URI: 
http://localhost/Schichtdienstplaner/prototyp/index.php?action=plan_monat_auswahl

Tue Mar 31 2009 12:20:16 GMT+0200

POST: xjxfun=test_modal_window
&xjxr=1238494816450

Tue Mar 31 2009 12:20:16 GMT+0200

INITIALIZING REQUEST OBJECT

Tue Mar 31 2009 12:20:16 GMT+0200

PREPARING REQUEST

Tue Mar 31 2009 12:20:16 GMT+0200

PROCESSING PARAMETERS [0]

Tue Mar 31 2009 12:20:16 GMT+0200

INITIALIZING REQUEST

Tue Mar 31 2009 12:20:16 GMT+0200

STARTING XAJAX REQUEST

Thanks for any idea in advance

Alexander

Re: modalWindow Plugin

SOLVED!

You have to use the standard installation version not the minimal one!!!!!!

Bye

And thanks for your good work

Re: modalWindow Plugin

hi! :-)

i've updated xajax to 0.5 final (standard) and to the actual modal window plugin (modalWindow_0.9.0_b1).
unfortunately, the code "$objResponse->clsmodalWindow->closeWindow();" doesn't work anymore.

the modal window plugin script comes with an example (index.php). when i select "close window" and submit the form, i get the following error:

xajax debug output
Fri Apr 10 2009 10:36:09 GMT+0200

DONE [1049ms]

Fri Apr 10 2009 10:36:09 GMT+0200

ERROR: ExecuteCommand (#0, ):
TypeError: parent.frames[args] is undefined

Fri Apr 10 2009 10:36:09 GMT+0200

RECEIVED [status: 200, size: 142 bytes, time: 1043ms]:
<?xml version="1.0" encoding="utf-8" ?>
<xjx>
<cmd cmd="mw:cw" plg="clsmodalWindow">
<xjxobj>
<e><k>N0</k><v>*</v></e>
</xjxobj>
</cmd>
</xjx>

Fri Apr 10 2009 10:36:08 GMT+0200

SENT [201 bytes]

Fri Apr 10 2009 10:36:08 GMT+0200

SENDING REQUEST

Fri Apr 10 2009 10:36:08 GMT+0200

CALLING:
xjxfun: actionClose
URI:
http://localhost/Web/modalWindow/

Fri Apr 10 2009 10:36:08 GMT+0200

POST: xjxfun=actionClose
&xjxr=1239352568549
&xjxargs[]=
<xjxobj>
<e><k>windowoption</k><v>S2</v></e>
<e><k>testinput</k><v>S</v></e>
</xjxobj>

Fri Apr 10 2009 10:36:08 GMT+0200

PREPARING REQUEST

Fri Apr 10 2009 10:36:08 GMT+0200

OBJECT TO XML: size = 2

Fri Apr 10 2009 10:36:08 GMT+0200

OBJECT TO XML: maxDepth = 20, maxSize = 2000

Fri Apr 10 2009 10:36:08 GMT+0200

PROCESSING PARAMETERS [1]

Fri Apr 10 2009 10:36:08 GMT+0200

INITIALIZING REQUEST

Fri Apr 10 2009 10:36:08 GMT+0200

STARTING XAJAX REQUEST


many thanks in advance for your help and best regards from switzerland smile
bambi

Re: modalWindow Plugin

Got the same problem as Bambi, anyone any solution ?

Re: modalWindow Plugin

did you have any online-example for your problem?

Re: modalWindow Plugin

hi mentor

here we go: http://www.zunzun.ch/xajax_test/

this is the unchanged modal window plugin example with xajax 0.5.

to reproduce the error:
- click on "Open in Document with Document function."
- select "close window" from the dropdown
- click on "submit formdata"

-> nothing happens!

many thanks for your help :-)

bambi

Re: modalWindow Plugin

i´m not really sure, but i think this want work in this beta version

i got my laptop back today, hope that i can spend time on that problem in the next few days