Topic: Bug with xajaxResponse

There is a bug updatung a blank input field with replace.

html:
<input type="text" size="20" name="modernnews_kategorie" id="modernnews_kategorie_id" value="" />

function:

$objResponse = new xajaxResponse();
$objResponse->replace("modernnews_kategorie_id","value",$params['modernnews_kategorie'],$params['modernnews_kategorie_options']);
return $objResponse;

You must have a claue (like a space) and than it works:

<input type="text" size="20" name="modernnews_kategorie" id="modernnews_kategorie_id" value=" " />

Re: Bug with xajaxResponse

Hm, I don't think this is a bug. If the target string is empty, there's nothing that could be replaced.

Re: Bug with xajaxResponse

He ?

From nothing to a value !

4 (edited by Mairu 2008-10-22 7:24:46 AM)

Re: Bug with xajaxResponse

Examples:
------------------------------------
<div id="test">replace the word xajax</div>

|
V

$objResponse->replace('test','innerHTML','xajax','replaced');

|
V

<div id="test">replace the word replaced</div>

------------------------------------

<div id="test">replace the word xajax</div>

|
V

$objResponse->assign('test','innerHTML','replaced');

|
V

<div id="test">replaced</div>

------------------------------------

And to replace nothing is a bit sensless, how you want to replace nothing in "A long sentence ...", between all chars or what?

Re: Bug with xajaxResponse

hello Mairo

take a look at the api-reference:

http://api.xajaxproject.org/files/xajax … se.replace

"Replace a specified value with another value within the given element

6 (edited by Mairu 2008-10-22 8:27:46 AM)

Re: Bug with xajaxResponse

Ehm, yes i wrote an example for czarnowski wink

Re: Bug with xajaxResponse

ahhhhhh sorry, i thought thats from the same person, sorry mairu wink

8 (edited by czarnowski 2008-10-22 12:11:04 PM)

Re: Bug with xajaxResponse

" And to replace nothing is a bit sensless,"

No that is not sensless.

If you have an empty input field and can type anything you want as (example) a categorie or you can choose it from an optionfield and replace the empty value with this and can edit it to what you want or you can use it so and save it to mysql and add in this way a new categorie than it is a great feature and very comfortable.


So it is in use in my cms system powercms with news and calendar and some other parts that using categories.

It was working in the 0.2 releases, in the 0.5 beta but not in in 0.5 rc 1 and now it works with 0.5 rc2.

A turnaround is to set the value with php to " ".

Thank you for the examples but i dont need it.

Re: Bug with xajaxResponse

Then please tell me how you want to replace "" in a non empty context?

I dont see why you cant use assign instead of replace?

Re: Bug with xajaxResponse

czarnowski wrote:

It was working in the 0.2 releases, in the 0.5 beta but not in in 0.5 rc 1 and now it works with 0.5 rc2.

You say that replacing 'nothing' with a value works in rc2 and in rc1 not? Can't believe it..

Have you ever tried the same in PHP ?

$foo = '';        
print str_replace('','bla',$foo);

This code snipped won't print anything. It simply does not work. Feel free to drop me an email if you think we'r all wrong wink

Re: Bug with xajaxResponse

Your example with str_replace is nonsens because with ajax we change a value of a dom id and not a php value dircetly.

Correction:

With rc2 my turnarround works and not rc2.
rc1 works in this case better than rc2.  rc2 hangs - Rc1 do nothing

http://powercms.org/dl/rc2.jpg

Re: Bug with xajaxResponse

ok mal auf deutsch ^^

egal in welcher programmiersprache du versuchst in einem string nach "nichts" zu suchen und dieses "nichts" mit irgendwelchem inhalt zu ersetzen wird es knallen

ob das nun javascript-seitig oder php-seitig ist es geht schlicht nicht

die javascript seitige function von xajax sucht

Re: Bug with xajaxResponse

Also ich muss mich doch sehr wundern, hier geht es nicht um die Ersetzung eines String nichts mit etwas anderem a la einer Programmiersprache sondern um die Ersetzung eines leeren Wertes einer ID aus dem DOM und das ist grunds

14 (edited by czarnowski 2008-10-23 9:16:33 AM)

Re: Bug with xajaxResponse

n beiden f

Re: Bug with xajaxResponse

und eben... und das geht sicher nicht nur mir so... habe ich verstanden halbwegs verstanden um was es eigenltich geht... big_smile

Re: Bug with xajaxResponse

Hallo,

ich hab grade mal bissel in der api von protoytpe gew

Re: Bug with xajaxResponse

Das Thema ist f

Re: Bug with xajaxResponse

tja dann viel erfolg mit prototype & scriptaculous.
mich w

Re: Bug with xajaxResponse

czarnowski wrote:

Wir k

Re: Bug with xajaxResponse

Schritt halten mit was?

Offenbar hast du nicht alles gelesen.

Xajax ist f

Re: Bug with xajaxResponse

das war keine antwort auf meine frage...

und auf meine andere frage hast du gar nicht geantwortet.

aber scheinbar scheinst du dich pers

Re: Bug with xajaxResponse

Ich werde das jetzt nicht weiter kommentieren. Czarnowski, wenn du eine Demo mit einer

Posts: 22

Pages 1

You must login or register to post a reply

xajax Forums → Release Testing → Bug with xajaxResponse



Currently installed 2 official extensions. Copyright © 2003–2009 PunBB.