Search Results

Search found 429 results on 18 pages for 'cdata'.

Page 10/18 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • HTTP Basic Authentication with HTTPService Objects in Adobe Flex/AIR

    - by Bob Somers
    I'm trying to request a HTTP resource that requires basic authorization headers from within an Adobe AIR application. I've tried manually adding the headers to the request, as well as using the setRemoteCredentials() method to set them, to no avail. Here's the code: <mx:Script> <![CDATA[ import mx.rpc.events.ResultEvent; import mx.rpc.events.FaultEvent; private function authAndSend(service:HTTPService):void { service.setRemoteCredentials('someusername', 'somepassword'); service.send(); } private function resultHandler(event:ResultEvent):void { apiResult.text = event.result.toString(); } private function resultFailed(event:FaultEvent):void { apiResult.text = event.fault.toString(); } ]]> </mx:Script> <mx:HTTPService id="apiService" url="https://mywebservice.com/someFileThatRequiresBasicAuth.xml" resultFormat="text" result="resultHandler(event)" fault="resultFailed(event)" /> <mx:Button id="apiButton" label="Test API Command" click="authAndSend(apiService)" /> <mx:TextArea id="apiResult" /> However, a standard basic auth dialog box still pops up prompting the user for their username and password. I have a feeling I'm not doing this the right way, but all the info I could find (Flex docs, blogs, Google, etc.) either hasn't worked or was too vague to help. Any black magic, oh Flex gurus? Thanks. EDIT: Changing setRemoteCredentials() to setCredentials() yields the following ActionScript error: [MessagingError message='Authentication not supported on DirectHTTPChannel (no proxy).'] EDIT: Problem solved, after some attention from Adobe. See the posts below for a full explanation. This code will work for HTTP Authentication headers of arbitrary length. import mx.utils.Base64Encoder; private function authAndSend(service:HTTPService):void { var encoder:Base64Encoder = new Base64Encoder(); encoder.insertNewLines = false; // see below for why you need to do this encoder.encode("someusername:somepassword"); service.headers = {Authorization:"Basic " + encoder.toString()}; service.send(); }

    Read the article

  • Flex service in debug

    - by Tom
    Hello everybody, I am trying to learn the new services method in flex 4. but i can´t get it work. A test oparation near the service in flash builder 4 works. But when i run the code i get NetConnection.Call.Failed: HTTP: Failed. Does somebody knows what the problem can be? Tom CODE: PHP <?php class AuthService { public function login($username, $password) { return 'ok'; } public function logout() { return true; } } ?> FLEX <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:authservice="services.authservice.*"> <fx:Script> <![CDATA[ import mx.controls.Alert; protected function button_clickHandler(event:MouseEvent):void { loginResult.token = authService.login(username, password); } ]]> </fx:Script> <fx:Declarations> <s:CallResponder id="loginResult"/> <authservice:AuthService id="authService" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <s:Button x="97" y="193" label="Button" id="button" click="button_clickHandler(event)"/> <s:TextInput x="91" y="87" id="username"/> <s:TextInput x="97" y="117" id="password"/> </s:Application

    Read the article

  • Explicit script end tag always converted to self-closing

    - by Jonas
    I'm using xslt to transform xml to an aspx file. In the xslt, I have a script tag to include a jquery.js file. To get it to work with IE, the script tag must have an explicit closing tag. For some reason, this doesn't work with xslt below. <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" xmlns:asp="remove"> <xsl:output method="html"/> <xsl:template match="/"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>TEST</title> <script type="text/javascript" src="jquery-1.2.6.js"></script> But if I change the script tag as shown below, it works. <script type="text/javascript" src="jquery-1.2.6.js"> // <![CDATA[ // ]]> </script> I thought that the <xsl:output method="html" /> would do the trick, but it doesn't seem to work? /Jonas

    Read the article

  • Conditionally install feature not working in Wix

    - by Damien
    Hi, I have a setup which I need to support on IIS6 and IIS7. For now Im using the built in IIS extensions for IIS6 like so: <Component Id="C_IISApplication" Guid="{9099909C-B770-4df2-BE08-E069A718B938}" > <iis:WebSite Id='TSIWSWebSite' Description='TSWeb' SiteId='*' Directory='INSTALLDIR'> <iis:WebAddress Id='tcpAddress' Port='8081' /> </iis:WebSite> <iis:WebAppPool Id="BlahWSApplicationPool" Name="Blah" /> <iis:WebVirtualDir Id="VirtualDir" Alias="Blah" Directory="INSTALLDIR" WebSite="BlahWSWebSite" DirProperties="WebVirtualDirProperties"> <iis:WebApplication Id="WebApplication" Name="Blah" WebAppPool="BlahWSApplicationPool"/> </iis:WebVirtualDir> </Component> I have tried a condition in the features like so: <Feature Title="IIS6" Id="IIS6" Description="IIS6" ConfigurableDirectory="INSTALLDIR" Level="1" Absent="disallow" Display="hidden"> <ComponentRef Id="C_IISApplication" /> <Condition Level="0"><![CDATA[IISVERSION <> '#6']]></Condition> </Feature> No matter what the value of my condition, the metabase stuff gets executed and I get an error on IIS7 systems. I have also tried putting the condition in the component and that didnt work either. Is there something wrong with my usage?

    Read the article

  • jQuery: loading reCaptcha into a div via ajax

    - by abdullah kahraman
    Hello, I want to create a form that has a div with id "captcha". When the user enters a wrong password, following code is generated in "login.php" $myCaptcha=recaptcha_get_html($publickey, $error); $xml="<captcha><![CDATA[".$myCaptcha ."]]></captcha>"; echo $xml; recaptcha_get_html($publickey, $error); generates this: <script type="text/javascript" src="http://www.google.com/recaptcha/api/challenge?k=xxxx"></script> <noscript> <iframe src="http://www.google.com/recaptcha/api/noscript?k=xxxx" height="300" width="500" frameborder="0"></iframe><br/> <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea> <input type="hidden" name="recaptcha_response_field" value="manual_challenge"/> </noscript> I want to get this code with $.post() and insert it into div "captcha". Doing something like this: $.post("login.php", {requestCaptcha:"yes"}, function(returned){ $("#captcha").html($(returned).text(),"xml"); }); In IE, it does nothing. In Chrome, it clears up whole page and there is only the called reCaptcha script working like a charm. Any ideas?

    Read the article

  • Flex: Double click event propagation on datagrid dependent on component order?

    - by MyMacAndMe
    I'd like to have a double click event on a datagrid in Flex3. The following example only works if the Accordion (id = "mustBeSecond") container comes after the DataGrid. Why is the order of the components important and what can I do to prevent this behavior? (The example does not work. If you change the order of "mustBeSecond" and "gridReportConversions" the example works fine) <mx:Script> <![CDATA[ import mx.controls.Alert; import mx.collections.ArrayCollection; [Bindable] private var dp:ArrayCollection = new ArrayCollection([ {qty:1,referer:'http://google.com'}, {qty:25,referer:'http://cnn.com'}, {qty:4,referer:'http:stackoverflow.com'}]); private function refererRowDoubleClicked(e:Event):void { Alert.show("double click"); } ]]> </mx:Script> <mx:HBox width="100%" height="100%"> <mx:Accordion width="200" height="200" id="mustBeSecond"> <mx:Canvas label="Navigation Box" width="100%" height="100%"> <mx:VBox> <mx:LinkButton label="First Link" /> <mx:LinkButton label="Second Link" /> </mx:VBox> </mx:Canvas> </mx:Accordion> <mx:DataGrid id="gridReportConversions" height="100%" width="100%" dataProvider="{this.dp}" mouseEnabled="true" doubleClickEnabled="true" itemDoubleClick="refererRowDoubleClicked(event)"> <mx:columns> <mx:DataGridColumn width="75" dataField="qty" headerText="Qty" /> <mx:DataGridColumn dataField="referer" headerText="URL" /> </mx:columns> </mx:DataGrid> </mx:HBox>

    Read the article

  • How to pass PHP variable as FlashVars via SWFObject

    - by Matt
    I am trying to take a PHP variable and pass it along to Flash via Flash vars. My end goal is to pass a string formatted as XML to Flash, but because I'm struggling I've stripped everything down to the basics. I'm just trying to pass a simple PHP string variable to Flash via FlashVars with SWFObject but something isn't right. The page won't load when I try to pass the variable inside of php tags, but it will load if I just pass a hard coded string. The basic structure of my page is that I have some PHP declared at the top like so: PHP <?php $test = "WTF"; ?> Some HTML (excluded here for simplicity sake) and then the JavaScript SWFObject Embed within my HTML: <script type="text/javascript" src="js/swfobject2.js"></script> <script type="text/javascript"> // <![CDATA[ var swfURL = "swfs/Init-Flash-PHP.swf"; var flashvars = {}; flashvars.theXML = <?php print $test ?>; var params = {}; //params.menu = "false"; params.scale = "showAll"; params.bgcolor = "#000000"; params.salign = "TL"; //params.wmode = "transparent"; params.allowFullScreen = "true"; params.allowScriptAccess = "always"; var attributes = {}; attributes.id = "container"; attributes.name = "container"; swfobject.embedSWF(swfURL, "container", '100%', '100%', "9.0.246", "elements/swfs/expressinstall.swf", flashvars, params, attributes); // ]]> </script> And the bare essentials of the ActionScript 3 Code: _paramObj = LoaderInfo(stage.loaderInfo).parameters; theText_txt.text = _paramObj['theXML']; How do I pass a PHP variable using SWFObject and FlashVars? Thanks.

    Read the article

  • AMF data is incomplete with Flex Service

    - by Tom
    Hello everybody. I am bussy with a Flex Project with a data services. Flash builder installed Zend Framework with Zend_Amf. When i run the project i get the error NetConnection.Call.Failed: HTTP: Failed. With chalers i say that Zend_Amf give the error: AMF data is incomplete (0 bytes of 0 bytes). Please check the recording limits in the Recording Settings. I don't know what the problem means. I have searched on google, but i haven't found a good result. The Flex project code is: <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:authservice="services.authservice.*"> <fx:Script> <![CDATA[ import mx.controls.Alert; protected function click_me_clickHandler(event:MouseEvent):void { text.text += "Test started"; testmeResult.token = authService.testme(); text.text += testmeResult.lastResult text.text += "Test ended"; } ]]> </fx:Script> <fx:Declarations> <s:CallResponder id="testmeResult"/> <authservice:AuthService id="authService" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <s:Button x="124" y="85" label="Click Me!" id="click_me" click="click_me_clickHandler(event)"/> <s:RichText x="58" y="114" width="238" height="182" id="text"/> </s:Application> The php code is: <?php class AuthService { public function testme() { return 'ik ben getest op'+date('d-m-Y H:i:s', time()); } }?> Please, help me!

    Read the article

  • XML parse node value as string

    - by bharathi
    My xml file is look like this . I want to get the value node text content as like this . <property regex=".*" xpath=".*"> <value> 127.0.0.1 </value> <property regex=".*" xpath=".*"> <value> val <![CDATA[ <Valve className="org.tomcat.AccessLogValve" exclude="PASSWORD,pwd,pWord,ticket" enabled="true" serviceName="zohocrm" logDir="../logs" fileName="access" format="URI,&quot;PARAM&quot;,&quot;REFERRER&quot;,TIME_TAKEN,BYTES_OUT,STATUS,TIMESTAMP,METHOD,SESSION_ID,REMOTE_IP,&quot;INTERNAL_IP&quot;,&quot;USER_AGENT&quot;,PROTOCOL,SERVER_NAME,SERVER_PORT,BYTES_IN,ZUID,TICKET_DIGEST,THREAD_ID,REQ_ID"/> ]]> test </value> </property> I want to get text as order they specified in a file . Here is my java code . Document doc = parseDocument("properties.xml"); NodeList properties = doc.getElementsByTagName("property"); for( int i = 0 , len = properties.getLength() ; i < len ; i++) { Element property = (Element)properties.item(i); //How can i proceed further . } Output Expected : Node 1 : 127.0.0.1 Node 2 : val <Valve className="org.tomcat.AccessLogValve" exclude="PASSWORD,pwd,pWord,ticket" enabled="true" serviceName="zohocrm" logDir="../logs" fileName="access" format="URI,&quot;PARAM&quot;,&quot;REFERRER&quot;,TIME_TAKEN,BYTES_OUT,STATUS,TIMESTAMP,METHOD,SESSION_ID,REMOTE_IP,&quot;INTERNAL_IP&quot;,&quot;USER_AGENT&quot;,PROTOCOL,SERVER_NAME,SERVER_PORT,BYTES_IN,ZUID,TICKET_DIGEST,THREAD_ID,REQ_ID"/> test Please suggest your views .

    Read the article

  • Prefix for element not bound

    - by Tim
    Hello! I am a newbie in Flex development and using Flash Builder 4 with SDK 4. Now I get the error that "the prefix "fx" for element "fx:Style" is not bound" in line number 4. I searched for it, and it has sth. to do with namespaces, but I can not solve it by myelf. I have the file called "UserStory.mxml" in the directory "components" to place it via the main.mxml onto the screen: <fx:Script> <![CDATA[ import components.UserStory; private function init():void { var userStory1:UserStory = new UserStory(); userStory1.x = 100; userStory1.y = 100; userStory1.userStoryText = "test"; this.addChild(userStory1); } ]]> </fx:Script> The file in which the error occurs in line no. 4: <?xml version="1.0" encoding="utf-8"?> <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="300" height="150" styleName="userstory"> <fx:Style source="styles/styles.css"/> <fx:Text x="5" y="5" width="275" height="135" text="{userStoryText}" fontFamily="notes" fontSize="18"/> <mx:Script> ... </mx:Script> </mx:Canvas> Can someone tell me what's wrong? Thanks a lot in advance & Best Regards.

    Read the article

  • jquery slideToggle() and unknown height?

    - by GaVrA
    Hello! Im using jquery 1.3.2 and this is the code: <script type="text/javascript"> //<![CDATA[ jQuery(function(){ jQuery('.news_bullet a.show_preview').click(function() { jQuery(this).siblings('div').slideToggle('slow'); return false; }).toggle( function() { jQuery(this).css({ 'background-position' : '0 -18px' }); }, function() { jQuery(this).css({ 'background-position' : '0 0' }); }); }); //]]> </script> If you see here i have bunch of small green + which when you click some text is revealed and background-position is changed for that link so then it shows the other part of image, red -. So the problem i am having is that i dont know the height for those hidden elements, because it depends on how much text there is, so when i click on + and show them, animation is 'jumping'. One workaround that i found is to put fixed height and overflow:hidden to those hidden elements. You can see how much smoother animation is running in top left block(the one with 'Vesti iz sveta crtanog filma' at the top). All other blocks dont have fixed height, and animation there is 'jumping'. Atm that fixed height in top left block is 30px, but ofc some elements require more height and some require less, so that is not a good solution... :) So how to stop this animation from 'jumping' when there is no fixed height?

    Read the article

  • Flex: View Stack Navigator

    - by Deena
    Hi, I have a component mxml file in which i have a view stack, on click of a button i navigate to the first child, now i need to navigate to the second child during onclick of a button present in the second child. All the childs are component files included within the view stack. How could this be done, Sample code is present below, --------------------Application.mxml--------------------- <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" > <mx:Script> <![CDATA[ private function loadScreen():void { navigationViewStack.selectedChild=id_offering; } ]]> </mx:Script> <mx:Button label="Save" click="loadScreen();"/> </mx:Canvas> <mx:ViewStack id="navigationViewStack" width="100%" height="100%"> <components:dashboard id="id_dashboard" label="Dashboard" /> <components:offering id="id_offering" label="Offering" /> <components:IssueSec id="id_issueSec" label = "Issues"/> </mx:ViewStack> -------------------------Ends-------------------------------------- Now in my offering.mxml file if i try to access navigationViewStack i am getting an error stating 'Access of undefined property navigationViewStack. Help me on how to access the view stack from my component mxml file. Thanks! Cheers, Deena

    Read the article

  • web browser become slow or no response after several ajax calls

    - by Patrick
    I'm totally newbie to jquery and ajax, my recently project is to help the representatives (reps) to manage customer quotations online. I have a page which displays all the quotations in a big table. I've managed to use ajax to fetch and display the quotations which associate to a particular rep after i click that rep's name. But the only problem is the speed of response. The first few clicks are ok and very smooth. But after several tries, the response become slow and I cant even scroll down the webpage, and later on the web browser craches.... Please have a look at my ajax code. here it is: <!-- AJAX FETCH QUOTES DATA + Tablesorter + FIXED TABLE HEADER--> <script type="text/javascript"> //<![CDATA[ $(function(){ $("a.repID").click(function(){ $('div#loader').append("<p align='center'><img src='images/loadingbar2.gif' id='loading' /></p>"); var repID = $(this).attr("title"); $.ajax({ type:'POST', url:'quote_info.php', data:'repID=' + repID, cache: false, success:function(data) { $("#container").html('<div id="content">' + data + '</div>'); $("#loading").fadeOut(500, function() {$(this).remove();}); $("#sortme").tablesorter(); $('.tbl').fixedtableheader(); } }); return false; }); }); </script> <!-- AJAX FETCH QUOTES DATA + Tablesorter + FIXED TABLE HEADER-->

    Read the article

  • Positioning / Scrolling problem with Flex popup.

    - by user284163
    Hi all, I'm trying to work out a specific problem I'm having with positioning in Flex using the PopUpManager. Basically I'm wanting to create a popup which will scroll with the parent container - this is necessary because the parent container is large and if the user's browser window isn't large enough (this will be the case the majority of the time) - they will have to use the scrollbar of the container to scroll down. The problem is that the popup is positioned relative to another component, and it needs to stay by that component. <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Script> <![CDATA[ import mx.core.UITextField; import mx.containers.TitleWindow; import mx.managers.PopUpManager; private function clickeroo(event:MouseEvent):void { var popup:TitleWindow = new TitleWindow(); popup.width = 250; popup.height = 300; popup.title = "Example"; var tf:UITextField = new UITextField(); tf.wordWrap = true; tf.width = popup.width - 30; tf.text = "This window stays put and doesn't scroll when the hbox is scrolled (even with using the hbox as parent in the addPopUp method), I need the popup to be local to the HBox."; popup.addChild(tf); PopUpManager.addPopUp(popup, hbox, false); PopUpManager.centerPopUp(popup); } ]]> </mx:Script> <mx:HBox width="100%" height="2000" id="hbox"> <mx:Button label="Click Me" click="clickeroo(event)"/> </mx:HBox> </mx:Application> Could anyone give me any pointers in the right direction? Thanks.

    Read the article

  • How to run an external SWF inside a Flex Application?

    - by lk
    I want to run an Action Script 3.0 Application into a Flex Application. To do this I've done the following: <?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication windowComplete="loadSwfApplication()" xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> <![CDATA[ private function loadSwfApplication() { var urlRequest:URLRequest = new URLRequest("path/to/the/application.swf"); swfLoader.addEventListener(Event.COMPLETE, loadComplete); swfLoader.load(urlRequest); } private function loadComplete(completeEvent:Event) { var swfApplication:* = completeEvent.target.content; swfApplication.init(); // this is a Function that I made it in the Root class of swfApplication } ]]> </mx:Script> <mx:SWFLoader id="sfwLoader"/> </mx:WindowedApplication> The problem is that in the calling of swfApplication.init(); the AIR Player throws me an exception: Security sandbox violation: caller file:///path/to/the/application.swf cannot access Stage owned by app:/SWFApplicationLoader.swf. This is because somewhere in application.swf I use the stage like this: if (root.stage != null) root.stage.addEventListener(Event.REMOVED, someFunction); root.stage.stageFocusRect = false; How can I load this swf application and USE the stage without any problems?

    Read the article

  • how to close popup using javascript with xml formatting

    - by Michael Robinson
    I bought this program that created a pretty nice imageuploader flash script however I can't get the Javascript function close window to close the popup and redirect the original page. here is the XML piece that defines the url's: <urls urlToUpload="upload.php?" urlOnUploadSuccess="http://www.home.com/purchase.html" urlOnUploadFail="http://www.home.com/tryagain.html" urlUpdateFlashPlayer="http://www.home.com/flashalternative.html" jsFunctionNameOnUpload=""/> This last line calls a javascript function on upload. The problem is I don't know what to call and where to put it. Here is the HTML file that is the popup: <HEAD> <title>Baublet Uploader</title> <script type="text/javascript" src="swfobject.js"></script> </HEAD> <BODY> <!-- Q-ImageUploader www.quadroland.com --> <div id="QImageUploader"> Flash Player stuff here </div> <script type="text/javascript"> // <![CDATA[ var so = new SWFObject("q_image_uploader.swf", "imageuploader", "650", "430", "9", "#FFFFFF"); so.addParam("scale", "noscale"); so.addParam("salign", "TL"); so.addVariable("AdditionalStringVariable","pass additional data here"); so.write("QImageUploader"); // ]]> </script> I found this Closing script I thought might work: <script language="javascript"> function close_window(page) { window.opener.location.href=page setTimeout(function(){window.close()},10); } </script> Does this go into the Popup HTML page above or would it be a separate close.js file in the root? Thanks, I'm really confused.

    Read the article

  • MXML composite canvas component initialization error

    - by mkorpela
    I'm getting an odd error from my composite canvas component: An ActionScript error has occurred: Error: null at mx.core::Container/initialize()[C:\autobuild\galaga\frameworks\projects\framework\src\mx\core\Container.as:2560] at -REMOVED THIS FOR STACK OVERFLOW-.view::EditableCanvas/initialize()[.../view/EditableCanvas .... It seems to be related to the fact that my composite component has a child and I'm trying to add one in the place I'm using the component. So how can I do this correctly? Component code looks like this (EditableCanvas.mxml): <?xml version="1.0" encoding="utf-8"?> <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="{init()}"> <mx:Script> <![CDATA[ private var _editable:Boolean; public function set editable(edit:Boolean):void { _editable = edit; } private function init():void { if(_editable){ addEventListener(MouseEvent.MOUSE_OVER, showEdit); addEventListener(MouseEvent.MOUSE_OUT, hideEdit); } } private function showEdit(event:Event):void { editTextImage.visible = true; } private function hideEdit(event:Event):void { editTextImage.visible = false; } ]]> </mx:Script> <mx:Image id="editTextImage" source="@Embed('/../assets/icons/small/process.png')" click="{dispatchEvent(EditPoiEvent.text())}" visible="false"/> </mx:Canvas> The code that is using the code looks like this: <view:EditableCanvas width="290" height="120" backgroundColor="#FFFFFF" horizontalScrollPolicy="off" borderStyle="solid" cornerRadius="3" editable="{_editable}"> <mx:Text id="textContentBox" width="270" fontFamily="nautics" fontSize="12" text="{_text}"/> </view:EditableCanvas>

    Read the article

  • SyntaxHighlighter and Line Break Tags

    - by azamsharp
    I am using the following syntax highligher: http://alexgorbatchev.com/wiki/SyntaxHighlighter For some reason when it encounter <br> it simply prints out <br> tags. I cannot replace the whole thing with System.Environment.NewLine since it will mess up the complete description. Here is my code: public static string GetDescription(string description) { string codeStartPattern = "&lt;code&gt;"; string codeEndPattern = "&lt;/code&gt;"; Regex reg = new Regex(codeStartPattern); description = reg.Replace(description, ReplaceWithStartDiv); reg = new Regex(codeEndPattern); description = reg.Replace(description, ReplaceWithEndDiv); return description; } private static string ReplaceWithStartDiv(Match m) { return "<script type='syntaxhighlighter' class='brush: csharp'><![CDATA["; } private static string ReplaceWithEndDiv(Match m) { return "]]></script>"; } I guess I only need to replace <br> with System.Environment.Newline with the code that is between the <code> snippet here </code> Thanks!

    Read the article

  • Unable to display Google Map through API in Flex SDK

    - by Spero.ShiroPetto
    Hello, I am using the mxmlc to compile the examples from google to get started in using Google Maps API in Flex 4. But after compiling the swf file the map does not load. I've registered for an API key Downloaded and included the Maps SDK in the xml config file used at compile time C:\sdk\flex4\frameworks\flex-config.xml <external-library-path> <path-element>libs/google/maps/lib/map_flex_1_18.swc</path-element> </external-library-path> Foo.mxml <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <maps:Map xmlns:maps="com.google.maps.*" id="map" mapevent_mapready="onMapReady(event)" width="100%" height="100%" key="{KEY}"/> <mx:Script> <![CDATA[ import com.google.maps.LatLng; import com.google.maps.Map; import com.google.maps.MapEvent; import com.google.maps.MapType; private function onMapReady(event:Event):void { this.map.setCenter(new LatLng(40.736072,-73.992062), 14, MapType.NORMAL_MAP_TYPE); } ]]> </mx:Script> </mx:Application> Any tips on where to go from here? I can compile a basic flex project without problem and displays the components I put in so i'd imagine it's something to do with the API Key? Thanks for the help

    Read the article

  • Xpages conditional validation: make a field required only if report is being submitted as final

    - by Randal Oulton
    Doing server-side Xpages conditional validation.... I want the follow validation to kick in only if the Report.Status field = 'Final'. (The users are allowed to submit the report as draft and come back and finish it later, when they submit as draft we don't want to make the fields required.) How would I go about this? <xp:inputTextarea style="width:75%" value="#{Report.Agenda}" id="Agenda"> <xp:this.validators> <xp:validateRequired message="Question 1 can't be blank"> </xp:validateRequired><!-- (1) --> </xp:this.validators> </xp:inputTextarea> Tried this, didn't work, was still required even if Status field not set to final :{ <xp:inputTextarea style="width:75%" value="#{Report.Agenda}" id="Agenda" defaultValue="5 year agenda"> <xp:this.validators> <xp:validateRequired message="Question 1 can't be blank"></xp:validateRequired><!-- (1) --> <xp:validateExpression message="Question 1 can't be blank"> <xp:this.expression><![CDATA[#{javascript: if (Report.getItemValueString('Status')!='Final') { return true; } else { return false; } }]]></xp:this.expression> </xp:validateExpression> </xp:this.validators> </xp:inputTextarea>

    Read the article

  • Auto-resize custom horizontal scrollbar/slider?

    I'm working on a site that scrolls horizontally. I know very little about jQuery and prototype and I got this slider script working as the page scrollbar. When the window is resized smaller, the custom horizontal slider/scrollbar won't resize to the viewport's width. I have the page and js files here http://keanetix.co.cc/scrollpage/ Try to resize the browser and you'll notice the custom scrollbar extending to the right. The custom scrollbar wont fit on the viewport, unless you refresh the page when it's been resized. Can somebody help me with this? Thanks. This is the code in the HTML page: <script type="text/javascript" language="javascript"> // <![CDATA[ // horizontal slider control var slider2 = new Control.Slider('handle', 'track', { onSlide: function(v) { scrollHorizontal(v, $('scrollable'), slider2); }, onChange: function(v) { scrollHorizontal(v, $('scrollable'), slider2); } }); // scroll the element horizontally based on its width and the slider maximum value function scrollHorizontal(value, element, slider) { element.scrollLeft = Math.round(value/slider.maximum*(element.scrollWidth-element.offsetWidth)); } // disable horizontal scrolling if text doesn't overflow the div if ($('scrollable').scrollWidth <= $('scrollable').offsetWidth) { slider2.setDisabled(); $('track').hide(); } // ]]> </script>

    Read the article

  • Initialize webservice WSDL at runtime using Flex and Mate framework

    - by GroovyB
    I am developing a Flex application on top of Mate framework. In this application, I am using a webservice to retrieve data. As this webservice as not a fix location URL (depending on where customers installed it), I define this URL in a config file. When the Flex application starts, it first reads this config file, then I would like to use the value I found to initialize the webservice. But currently, I have no idea how to this. Here is my EventMap.mxml <EventMap> <services:Services id="services" /> <EventHandlers type="{FlexEvent.PREINITIALIZE}"> <HTTPServiceInvoker instance="{services.configService}"> <resultHandlers> <MethodInvoker generator="{ConfigManager}" method="loadFromXml" arguments="{resultObject}" /> </resultHandlers> <faultHandlers> <InlineInvoker method="Alert.show" arguments="ERROR: Unable to load config.xml !" /> </faultHandlers> </HTTPServiceInvoker> In this part, the ConfigManager parse the config file and intitialize a bindable property called webServiceWsdl Here is my Services.mxml <mx:Object> <mx:Script> <![CDATA[ [Bindable] public var webservice:String; ]]> </mx:Script> <mx:HTTPService id="configService" url="config.xml" useProxy="false" /> <mx:WebService id="dataService" wsdl="{webservice}" useProxy="false"/> </mx:Object> How can I initialize this webservice property ?

    Read the article

  • Flex List ItemRenderer with image looses BitmapData when scrolling

    - by Dominik
    Hi i have a mx:List with a DataProvider. This data Provider is a ArrayCollection if FotoItems public class FotoItem extends EventDispatcher { [Bindable] public var data:Bitmap; [Bindable] public var id:int; [Bindable] public var duration:Number; public function FotoItem(data:Bitmap, id:int, duration:Number, target:IEventDispatcher=null) { super(target); this.data = data; this.id = id; this.duration = duration; } } my itemRenderer looks like this: <?xml version="1.0" encoding="utf-8"?> <mx:VBox xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" > <fx:Script> <![CDATA[ import mx.collections.ArrayCollection; ]]> </fx:Script> <s:Label text="index"/> <mx:Image source="{data.data}" maxHeight="100" maxWidth="100"/> <s:Label text="Duration: {data.duration}ms"/> <s:Label text="ID: {data.id}"/> </mx:VBox> Now when i am scrolling then all images that leave the screen disappear :( When i take a look at the arrayCollection every item's BitmapData is null. Why is this the case?

    Read the article

  • Java remove HTML from String without regular expressions

    - by behrk2
    Hello, I am trying to remove all HTML elements from a String. Unfortunately, I cannot use regular expressions because I am developing on the Blackberry platform and regular expressions are not yet supported. Is there any other way that I can remove HTML from a string? I read somewhere that you can use a DOM Parser, but I couldn't find much on it. Text with HTML: <![CDATA[As a massive asteroid hurtles toward Earth, NASA head honcho Dan Truman (<a href="http://www.netflix.com/RoleDisplay/Billy_Bob_Thornton/20000303">Billy Bob Thornton</a>) hatches a plan to split the deadly rock in two before it annihilates the entire planet, calling on Harry Stamper (<a href="http://www.netflix.com/RoleDisplay/Bruce_Willis/99786">Bruce Willis</a>) -- the world's finest oil driller -- to head up the mission. With time rapidly running out, Stamper assembles a crack team and blasts off into space to attempt the treacherous task. <a href="http://www.netflix.com/RoleDisplay/Ben_Affleck/20000016">Ben Affleck</a> and <a href="http://www.netflix.com/RoleDisplay/Liv_Tyler/162745">Liv Tyler</a> co-star.]]> Text without HTML: As a massive asteroid hurtles toward Earth, NASA head honcho Dan Truman (Billy Bob Thornton) hatches a plan to split the deadly rock in two before it annihilates the entire planet, calling on Harry Stamper (Bruce Willis) -- the world's finest oil driller -- to head up the mission. With time rapidly running out, Stamper assembles a crack team and blasts off into space to attempt the treacherous task.Ben Affleck and Liv Tyler co-star. Thanks!

    Read the article

  • asp.net doesn't render Sys.WebForms.PageRequestManager._initialize code

    - by ajitatif
    i'm using the ASP.NET 2.0 Ajax Extensions on a web site. as always, everything is fine on local but the remote web site does not use ajax calls. my local server has the ASP.NET Ajax extensions installed but the remote one doesn't. i know that i should be able to use the Ajax extensions without installing them. so in turn, i added the extensions' .dll among the web site's references but still no luck. after my further investigation, i found out that local and remote pages have exactly the same HTML code rendered, except that the local (working) one has these lines //<![CDATA[ Sys.WebForms.PageRequestManager._initialize('ctl00$ContentPlaceHolder1$ScriptManager1', document.getElementById('aspnetForm')); Sys.WebForms.PageRequestManager.getInstance()._updateControls(['tctl00$ContentPlaceHolder1$updReportArgs','tctl00$ContentPlaceHolder1$updReport'], ['ctl00$ContentPlaceHolder1$chkTumu','ctl00$ContentPlaceHolder1$btnGetir'], [], 90); //]]> obviously, these are the lines of code that make callbacks possible. the question is why doesn't asp.net render these lines? what could be missing? by the way, the ScriptResource.axd and WebResource.axd doesn't give a 404 or anything, i can see through their js codes via Firebug. and one more thing: i'm unsure if it is related or not, but there are client-side asp.net validators on the page whose js code are not rendered either. again, those work fine locally. for further investigation you can see the remote site here : http://www.ajitatif.com/subdomains/nazer/Raporlar/danismanbasarim.aspx

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >