Sorry, I should have been more explicit.

The UnprefixedAttribute is your "onclick" attribute. The first parameter 
(a string) is "onclick." The third parambers (MetaData) is null. What 
you are passing is the second parameter, which can be a) an Option 
containing a Seq of scala.xml.Nodes, b) another String, or c) a Seq of 
scala.xml.Nodes.

The ajaxCall method you are providing as the middle parameter to 
UnprefixedAttribute returns (String, JsExp). This is a tuple, not an 
Option, a String, or a Seq of Nodes. Therefore, you are setting this up 
incorrectly.

So you need to look at ajaxCall and see how it is properly used.

Chas.

glenn wrote:
> Charles,
> 
> Actually, no, it doesn't help.
> 
> The error appears to refer to the third parameter to bind:
> "button1" -> <button onclick={SHtml.ajaxCall(Str("Button1"),ajaxFunc
> _)}>Press me</button>
> 
> I suspect the compiler doesn't like this construct
>   {SHtml.ajaxCall(Str ("Button1"),ajaxFunc _)} for the onclick
> handler.
> 
> even though the call to SHtml.ajaxCall in the construct is correct -
> at least
> alone it doesn't generate any compiler errors.
> 
> If instead, I use onclick={"alert('This is a test')"}, everything
> works fine.
> 
> Glenn...
> 
> 
> On Apr 20, 3:40 pm, "Charles F. Munat" <c...@munat.com> wrote:
>> There are three constructors for UnprefixedAttribute (used to add
>> unprefixed attributes to XML elements).
>>
>> All three return an instance of scala.xml.MetaData (attributes are a
>> subclass of MetaData).
>>
>> The first takes:
>>
>> a String,
>> an Option containing a Seq of scala.xml.Nodes,
>> and another piece of MetaData (you can string them together)
>>
>> The second constructor takes:
>>
>> a String,
>> another String,
>> and the MetaData
>>
>> The final option takes:
>>
>> A string,
>> a Seq of scala.xml.Nodes,
>> and the MetaData.
>>
>> What you are providing is:
>>
>> a java.lang.String,
>> a tuple: (String, net.liftweb.http.js.JsExp),
>> and the MetaData
>>
>> So you need to look at the ajaxCall method and figure out what you are
>> doing wrong.
>>
>> Does this help?
>>
>> Chas.
>>
>> glenn wrote:
>>> When I try to compile the following code:
>>> bind("ex", xhtml, "button1" -> <button onclick={SHtml.ajaxCall(Str
>>> ("Button1"),ajaxFunc _)}>Press me</button>
>>>     )
>>>  I get this error message:
>>> overloaded method constructor UnprefixedAttribute with alternatives
>>> (String,Option[Seq[scala.xml.Node]],scala.xml.MetaData)
>>> scala.xml.UnprefixedAttribute <and>
>>>  (String,String,scala.xml.MetaData)scala.xml.UnprefixedAttribute <and>
>>> (String,Seq[scala.xml.Node],scala.xml.MetaData)
>>> scala.xml.UnprefixedAttribute cannot be applied to (java.lang.String,
>>> (String,
>>>  net.liftweb.http.js.JsExp),scala.xml.MetaData)
>>> Can anyone decipher for me?
> 
> > 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to