Re: [flexcoders] carriage return via web service

2005-04-18 Thread John Daharsh

Caught one error in my previous post:

"For time's sake I am going with a hack, replacing the "\r"...

(I have to replace "\r", not "\n")


On 4/18/05, John Daharsh <[EMAIL PROTECTED]> wrote:
> Yeah still no dice...
> 
> Thanks for the suggestion. One minor note is that replacing "\n" does
> nothing, but replacing "\r" at least replaces the line feed with
> something else. However, replacing "\r" with either "\n" or "\r\n"
> yields the same result.
> 
> It seems apparent that the problem lies between FLEX and .NET, the
> soap packet in the Network monitor [in Flexbuilder] clearly shows
> carriage returns of some sort. (both before I did the replace test you
> mentioned previously and after, and both with "\n" and "'\r\n")
> 
> I pared down the .NET webservice test so it just takes the incoming
> request and returns the entire input text as the response, and the
> Network monitor shows my response string without carriage returns in
> every case.
> 
> For time's sake I am going with a hack, replacing the "\n" with
> something silly like "|WHEREISMYCARRIAGERETURN|" in FLEX, then
> replacing "|WHEREISMYCARRIAGERETURN|" with "\n" in the webservice.
> 
> This works just fine (I tested it), with the exception of the shame
> heaped upon me like so many burning coals.
> 
> I do want to know if anyone else has encountered this, and what they
> have done to get around it.
> 
> 
> On 4/18/05, Matt Chotin <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > I think that the carriage return that we send from a TextArea is just \n and
> > Windows expects it to be \r\n.  What if you try iterating through the string
> > and replacing any \n with \r\n and then executing the web service.
> >
> >
> >
> > Var newStr : String = "";
> >
> > Var sourceStr : String = myTextArea.text;
> >
> > For (var c : Number = 0; c < sourceStr.length; c++)
> >
> > {
> >
> >   Var ch : String = sourceStr.getCharAt(c);
> >
> >   if (ch == '\n')
> >
> >newStr += '\r';
> >
> >   newStr += ch;
> >
> > }
> >
> > myService.myOp(newStr);
> >
> >
> >
> > Actually, a more efficient implementation might be:
> >
> >
> >
> > var arr : Array = myTextArea.text.split('\n');
> >
> > var newStr : String = arr.join("\r\n");
> >
> > myService.myOp(newStr);
> >
> >
> >
> > Let us know if that helps,
> >
> >
> >
> > Matt
> >
> >
> >
> >  
> >
> >
> > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
> >  Sent: Monday, April 18, 2005 12:49 PM
> >  To: flexcoders@yahoogroups.com
> >  Subject: [flexcoders] carriage return via web service
> >
> >
> >
> > Well I'm stumped.
> >
> >  I am calling a .NET web service that inserts text from a TextArea into
> >  the database. When I try the Webservice from a .NET  HTML form, if I
> >  have carriage returns in the text it saves them to the database just
> >  fine.
> >
> >  When I call the webservice from FLEX and I have carriage returns in
> >  the text, the character gets dropped. I confirmed the Keycode is
> >  correct (ASCII 13), and when I run the Application in flexbuilder and
> >  view the network monitor, the SOAP packet seems to have the carriage
> >  returns in place.
> >
> >  The carriage return seems to be getting lost before the SOAP packet
> >  reaches the  web service. I'm wondering if there is something in the
> >  underlying JRun application that is removing the character.
> >
> >  Has anyone else run into this? I've searched the groups for anything
> >  related to "carriage return" or "line feed" and have come up empty.
> >
> >  Thanks for any help.
> >
> >
> >  
> >  Yahoo! Groups Links
> >
> >
> > To visit your group on the web, go to:
> > http://groups.yahoo.com/group/flexcoders/
> >
> > To unsubscribe from this group, send an email to:
> > [EMAIL PROTECTED]
> >
> > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





Re: [flexcoders] carriage return via web service

2005-04-18 Thread John Daharsh

Yeah still no dice...

Thanks for the suggestion. One minor note is that replacing "\n" does
nothing, but replacing "\r" at least replaces the line feed with
something else. However, replacing "\r" with either "\n" or "\r\n"
yields the same result.

It seems apparent that the problem lies between FLEX and .NET, the
soap packet in the Network monitor [in Flexbuilder] clearly shows
carriage returns of some sort. (both before I did the replace test you
mentioned previously and after, and both with "\n" and "'\r\n")

I pared down the .NET webservice test so it just takes the incoming
request and returns the entire input text as the response, and the
Network monitor shows my response string without carriage returns in
every case.

For time's sake I am going with a hack, replacing the "\n" with
something silly like "|WHEREISMYCARRIAGERETURN|" in FLEX, then
replacing "|WHEREISMYCARRIAGERETURN|" with "\n" in the webservice.

This works just fine (I tested it), with the exception of the shame
heaped upon me like so many burning coals.

I do want to know if anyone else has encountered this, and what they
have done to get around it.



On 4/18/05, Matt Chotin <[EMAIL PROTECTED]> wrote:
>  
>  
> 
> I think that the carriage return that we send from a TextArea is just \n and
> Windows expects it to be \r\n.  What if you try iterating through the string
> and replacing any \n with \r\n and then executing the web service. 
> 
>   
> 
> Var newStr : String = ""; 
> 
> Var sourceStr : String = myTextArea.text; 
> 
> For (var c : Number = 0; c < sourceStr.length; c++) 
> 
> { 
> 
>   Var ch : String = sourceStr.getCharAt(c); 
> 
>   if (ch == '\n') 
> 
>newStr += '\r'; 
> 
>   newStr += ch; 
> 
> } 
> 
> myService.myOp(newStr); 
> 
>   
> 
> Actually, a more efficient implementation might be: 
> 
>   
> 
> var arr : Array = myTextArea.text.split('\n'); 
> 
> var newStr : String = arr.join("\r\n"); 
> 
> myService.myOp(newStr); 
> 
>   
> 
> Let us know if that helps, 
> 
>   
> 
> Matt 
> 
>   
>  
>  
>  
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
>  Sent: Monday, April 18, 2005 12:49 PM
>  To: flexcoders@yahoogroups.com
>  Subject: [flexcoders] carriage return via web service 
> 
>   
> 
> Well I'm stumped. 
>  
>  I am calling a .NET web service that inserts text from a TextArea into
>  the database. When I try the Webservice from a .NET  HTML form, if I
>  have carriage returns in the text it saves them to the database just
>  fine.
>  
>  When I call the webservice from FLEX and I have carriage returns in
>  the text, the character gets dropped. I confirmed the Keycode is
>  correct (ASCII 13), and when I run the Application in flexbuilder and
>  view the network monitor, the SOAP packet seems to have the carriage
>  returns in place.
>  
>  The carriage return seems to be getting lost before the SOAP packet
>  reaches the  web service. I'm wondering if there is something in the
>  underlying JRun application that is removing the character.
>  
>  Has anyone else run into this? I've searched the groups for anything
>  related to "carriage return" or "line feed" and have come up empty.
>  
>  Thanks for any help.
>  
>  
>  
>  Yahoo! Groups Links
>  
>  
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/flexcoders/
>   
> To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
>   
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] carriage return via web service

2005-04-18 Thread John Daharsh

Well I'm stumped. 

I am calling a .NET web service that inserts text from a TextArea into
the database. When I try the Webservice from a .NET  HTML form, if I
have carriage returns in the text it saves them to the database just
fine.

When I call the webservice from FLEX and I have carriage returns in
the text, the character gets dropped. I confirmed the Keycode is
correct (ASCII 13), and when I run the Application in flexbuilder and
view the network monitor, the SOAP packet seems to have the carriage
returns in place.

The carriage return seems to be getting lost before the SOAP packet
reaches the  web service. I'm wondering if there is something in the
underlying JRun application that is removing the character.

Has anyone else run into this? I've searched the groups for anything
related to "carriage return" or "line feed" and have come up empty.

Thanks for any help.


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





Re: [flexcoders] datagrid with a single-node dataprovider

2005-04-05 Thread John Daharsh

Jeff,

That worked like a charm and saved me from some ugly code. Thanks!

On Apr 5, 2005 6:02 PM, Jeff Tapper <[EMAIL PROTECTED]> wrote:
> 
> Try wrapping it with mx.utils.ArrayUtil.toArray()
> 
> A single node in XML isnt neccessarily interpretted as an array, while
> multiple nodes of the same name are.  However, you can use the static
> toArray method to treat the node as a 1 element array:
> 
> > >dataProvider="{mx.utils.ArrayUtil.toArray(testModel.message)}" />
> 
> At 07:37 PM 4/5/2005, you wrote:
> >1) I have searched the flexcoders group for an answer
> >2) I don't find this documented anywhere, but every example of a
> >datagrid has 2 or more nodes of data
> >
> >I have a datagrid with a dynamic datasource that contains from 0 to N
> >elements (they are XML nodes)
> >
> >It works fine as long as there is more than one node. If there is one
> >node I can't access the values in that node.
> >
> >I tested it with a static XML file with the same results. Here is the test:
> >
> >
> >
> >
> >Here is the XML that works:
> >
> >
> > 
> > test date
> > 
> > 
> > test date 2
> > 
> >
> >
> >but if I modify the XML as follows, I cannot access the data in the
> >message node:
> >
> >
> > 
> > test date
> > 
> >
> >
> >I am looking for an elegant way to display data in the datagrid and
> >wonder if anyone else has come across this
> >
> >
> >--
> >Yahoo! Groups Links
> >* To visit your group on the web, go to:
> >*
> > http://groups.yahoo.com/group/flexcoders/
> >
> >*
> >* To unsubscribe from this group, send an email to:
> >*
> > [EMAIL PROTECTED]
> >
> >*
> >* Your use of Yahoo! Groups is subject to the
> > Yahoo! Terms of Service.
> 
> Yahoo! Groups Links
> 
> 
> 
> 
>


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[flexcoders] datagrid with a single-node dataprovider

2005-04-05 Thread John Daharsh

1) I have searched the flexcoders group for an answer
2) I don't find this documented anywhere, but every example of a
datagrid has 2 or more nodes of data

I have a datagrid with a dynamic datasource that contains from 0 to N
elements (they are XML nodes)

It works fine as long as there is more than one node. If there is one
node I can't access the values in that node.

I tested it with a static XML file with the same results. Here is the test:




Here is the XML that works:



test date


test date 2



but if I modify the XML as follows, I cannot access the data in the
message node:



test date



I am looking for an elegant way to display data in the datagrid and
wonder if anyone else has come across this


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





Re: [flexcoders] How do you do this in flex

2005-04-04 Thread John Daharsh

This seems like a simple enough question...

Scenario 1, 1 condition:

if(condition1)
{
   execute code;
}

Scenario 2, 2 conditions:

if(condition1 && condition 2)
{
   execute code;
}

You do that in Actionscript -- this is a very basic idea in
programming. Did I misread your question?



On Apr 4, 2005 9:49 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>  
> Make an if statement that will run based on two conditions rather than just
> one. Is this possible to do in Flex? 
>  
>  Yahoo! Groups Links
>  
>  
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/flexcoders/
>   
> To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
>   
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/