2 Inputs for the Same Node

classic Classic list List threaded Threaded
23 messages Options
12
Reply | Threaded
Open this post in threaded view
|

2 Inputs for the Same Node

maalej
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

RE: 2 Inputs for the Same Node

Stian Sigvartsen
RE: [ops-users] 2 Inputs for the Same Node

Hi Maalej
I suspect you should take another approach. If you elaborate on why you would like to do this then maybe I or others can offer a solution.

-Stian


-----Original Message-----
From: maalej [[hidden email]]
Sent: Tue 3/5/2013 07:28
To: [hidden email]
Subject: [ops-users] 2 Inputs for the Same Node

Hi,

it is possible to define 2 XForms:Input for the same Node but with different
Typs? Workaround? any Idea ?

example (doesn't work!):

 <xforms:bind nodeset="/x/y" type="xs:boolean" id="bbb"/>
 <xforms:bind nodeset="/x/y" type="xs:integer" id="aaa"/>
.....
<xforms:case id="xs:boolean">
    <xforms:input bind="bbb">
</xforms:case>
<xforms:case id="xs:int">
        <xforms:input bind="aaa"/>
 </xforms:case>

Thanks :-)
Maalej



--
View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/2-Inputs-for-the-Same-Node-tp4656305.html
Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: 2 Inputs for the Same Node

maalej
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: 2 Inputs for the Same Node

Hank Ratzesberger-3

Hi,

Just a guess ... 

I have seen situations previously that  it was not possible to match the form and schema, and I had to create a model/instance to handle this.

Anyway, your model could have both types, and youhave conditional or bindings to display the appropriate contrrol.

This presumes that the user doesn't want to switch in the process, that you know when the page loads which label/input to show.

Likely, there is a better way...

--Hank

On Tuesday, March 5, 2013, maalej wrote:
Hi,

i have one Node that can have different typs, somthing like Union on
XML-Schema ...
i look for a solution, to define different input with different typs for the
same xml-node

thanks



--
View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/2-Inputs-for-the-Same-Node-tp4656305p4656315.html
Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: 2 Inputs for the Same Node

maalej
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: 2 Inputs for the Same Node

Hank Ratzesberger-3
In reply to this post by maalej

Hi,

Just a guess ... 

I have seen situations previously that  it was not possible to match the form and schema, and I had to create a model/instance to handle this.

Anyway, your model could have both types, and youhave conditional or bindings to display the appropriate contrrol.

This presumes that the user doesn't want to switch in the process.

Likely, there is a better way.

Cheers,
Hank

On Tuesday, March 5, 2013, maalej wrote:
Hi,

i have one Node that can have different typs, somthing like Union on
XML-Schema ...
i look for a solution, to define different input with different typs for the
same xml-node

thanks



--
View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/2-Inputs-for-the-Same-Node-tp4656305p4656315.html
Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.


--
Hank Ratzesberger
XMLWerks.com



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: RE: 2 Inputs for the Same Node

Alessandro  Vernet
Administrator
In reply to this post by maalej
Hi Maalej,

A node can only have one type at a given point in time. But that type
can change. For instance, if a node can contain either a date or a
boolean, and you want show either a date picker or checkbox, then:

1. In the view, use just a <xf:input> bound to that node.
2. In the model, have two binds, using a predicate on the ref to
determine which one is "active":

<xf:bind ref="your-node[@type='date']" type="xs:date"/>
<xf:bind ref="your-node[@type='boolean']" type="xs:boolean"/>

Would that work in your case?

Alex

On Tue, Mar 5, 2013 at 3:50 PM, maalej <[hidden email]> wrote:

> Hi,
>
> i have one Node that can have different typs, somthing like Union on
> XML-Schema ...
> i look for a solution, to define different input with different typs for the
> same xml-node
>
> thanks
>
>
>
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/2-Inputs-for-the-Same-Node-tp4656305p4656315.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>


--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: RE: 2 Inputs for the Same Node

maalej
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: RE: 2 Inputs for the Same Node

Alessandro  Vernet
Administrator
Hi Maalej,

Yes, this should work. If it doesn't for you, could you create a minimal test case that we can run here to reproduce the issue?

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: 2 Inputs for the Same Node

maalej
In reply to this post by maalej
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: 2 Inputs for the Same Node

Alessandro  Vernet
Administrator
Hi Maalej,

- You're missing closing elements for the body and xhtml elements.
- The root element should be <html>, not <xhtml>.
- You're missing the xmlns:ev="http://www.w3.org/2001/xml-events" namespace declaration.
- Since you declared a default namespace xmlns="http://www.w3.org/1999/xhtml", you need to reset it on the instance by adding xmlns="". (I highly recommend you never declare default namespaces, and instead always use prefixes.)
- Your top-level group referencing "x" won't work because the current node is already "x", so nothing in the group will show.

If you allow me, I will stop there, let you integrate those fixes, and try to get this work, since all of this is unrelated to the issue at hand.

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: 2 Inputs for the Same Node

maalej
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: 2 Inputs for the Same Node

Alessandro  Vernet
Administrator
Hi Maalej,

The xforms:select1 isn't bound to anything, and so doesn't show. And the bind's nodeset points to /x but the root is now /template, so that will have no effect. I updated your example to make it simpler, and thing that the issue you're having is that after you change the type, you need to run an xforms:rebuild, since setvalue doesn't set the rebuild flag (in general the bind's ref/nodeset don't need to be updated on setvalue).

http://www.w3.org/TR/xforms/#action-setvalue

Here is the updated example: view.xhtml

The example shows:



And you can click on the "Switch type" link to switch between the type xs:string (text field) and xs:boolean (check box). While doing this, I noticed that if you use xs:date and switch back and forth, when the date input field is recreated, the text field doesn't show; I created a bug for this:

https://github.com/orbeon/orbeon-forms/issues/873

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: 2 Inputs for the Same Node

maalej
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: 2 Inputs for the Same Node

Alessandro  Vernet
Administrator
Hi Maalej,

You're saying it has no effect in the example I attached? Are you running this on Orbeon Forms 4.0? (I am asking, as obviously, this is working for me here.)

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: 2 Inputs for the Same Node

maalej
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Re: 2 Inputs for the Same Node

Hank Ratzesberger-3
Maalej,

I don't think there is anything specific to 4.0, but here it is running in 4.0:

http://rose.entic.net:8080/tests/test01

And you want to decide when the form is displayed which control to
display.  You could do that with the switch control and the relevant
attribute,

http://www.w3.org/TR/xforms11/#ui-switch-module

http://wiki.orbeon.com/forms/doc/contributor-guide/xforms-switch-case

And both controls would initially be relevant="false" so they don't
show, but you can add an event to the model, the xforms-ready so that
when "everything is ready" you evaluate the data to determine what
control to show.

I might be able to give that a try this evening.

--Hank


On Wed, Mar 13, 2013 at 11:32 AM, maalej <[hidden email]> wrote:

> hi,
>
> i m running orbeon 3.9.0.201105152046 CE
>
> Thanks :-)
>
>
>
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/2-Inputs-for-the-Same-Node-tp4656305p4656388.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>


--
Hank Ratzesberger
XMLWerks.com


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: 2 Inputs for the Same Node

Alessandro  Vernet
Administrator
In reply to this post by maalej
Hi Maalej,

Then I would recommend to upgrade to 4.0. If you can't, and it turns out to be a bug in 3.9, if it hasn't been taken care in 3.9.1 PE, then this is something that we might be able to help with through a PE subscription (http://www.orbeon.com/pricing).

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: 2 Inputs for the Same Node

Hank Ratzesberger-3


On Thursday, March 14, 2013, Alessandro Vernet wrote:
Hi Maalej,

Then I would recommend to upgrade to 4.0. If you can't, and it turns out to
be a bug in 3.9, if it hasn't been taken care in 3.9.1 PE, then this is
something that we might be able to help with through a PE subscription
(http://www.orbeon.com/pricing).

Alex



--
View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/2-Inputs-for-the-Same-Node-tp4656305p4656398.html
Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.


--
Hank Ratzesberger
XMLWerks.com



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: 2 Inputs for the Same Node

Alessandro  Vernet
Administrator
Hi Hank,

I'm not sure if you intended to add something to this thread, but your last message is empty (that is, besides quoting from a previous message).

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
12