Thread: [Xsltforms-support] Display two inputs for one field; one readonly the other editable
Brought to you by:
alain-couthures
|
From: Mark v. d. B. <ko...@gm...> - 2010-05-26 10:11:26
|
Given the following XML:
<root>
<item>
<value>1</value>
</item>
<item>
<value>2</value>
</item>
<item>
<value>3</value>
</item>
</root>
The items are displayed in a table using xforms:repeat containing the
editable inputs. Under the table is a xforms:input which should be
disabled. If an user sets focus to one of the editable inputs then the
input under the table should show the value of the selected input in
the table.
The problem is when using a xforms:bind to set the value to readonly
it will set both inputs readonly. Is there a way to set the readonly
independent for the inputs?
Thanks,
Mark
|
|
From: Kostis A. <ank...@gm...> - 2010-05-26 10:30:30
|
Maybe this is a good "excuse" to start heading for MIPs on UI controls: See xforms future features: http://www.w3.org/MarkUp/Forms/wiki/Add_model_item_properties_to_UI_level Regards, Kostis Anagnostopoulos On Wed, May 26, 2010 at 1:11 PM, Mark van den Boomen <ko...@gm...> wrote: > Given the following XML: > > <root> > <item> > <value>1</value> > </item> > <item> > <value>2</value> > </item> > <item> > <value>3</value> > </item> > </root> > > The items are displayed in a table using xforms:repeat containing the > editable inputs. Under the table is a xforms:input which should be > disabled. If an user sets focus to one of the editable inputs then the > input under the table should show the value of the selected input in > the table. > > The problem is when using a xforms:bind to set the value to readonly > it will set both inputs readonly. Is there a way to set the readonly > independent for the inputs? > > Thanks, > > Mark > > ------------------------------------------------------------------------------ > > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > |
|
From: Mark v. d. B. <ko...@gm...> - 2010-05-26 10:38:32
|
Look promissing but pitty it's not ready jet. 2010/5/26 Kostis Anagnostopoulos <ank...@gm...>: > Maybe this is a good "excuse" to start heading for MIPs on UI controls: > See xforms future features: > http://www.w3.org/MarkUp/Forms/wiki/Add_model_item_properties_to_UI_level > > Regards, > Kostis Anagnostopoulos > |
|
From: Steven P. <Ste...@cw...> - 2010-05-26 10:35:33
|
On Wed, 26 May 2010 12:11:19 +0200, Mark van den Boomen <ko...@gm...> wrote: > Given the following XML: > > <root> > <item> > <value>1</value> > </item> > <item> > <value>2</value> > </item> > <item> > <value>3</value> > </item> > </root> > > The items are displayed in a table using xforms:repeat containing the > editable inputs. Under the table is a xforms:input which should be > disabled. If an user sets focus to one of the editable inputs then the > input under the table should show the value of the selected input in > the table. > > The problem is when using a xforms:bind to set the value to readonly > it will set both inputs readonly. Is there a way to set the readonly > independent for the inputs? I'm not sure if I understand the problem, but why not use an <output> under the table, and an input in the repeat? Best wishes, Steven Pemberton > > Thanks, > > Mark > > ------------------------------------------------------------------------------ > > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support |
|
From: Mark v. d. B. <ko...@gm...> - 2010-05-26 10:50:37
|
The problem is that the client wants to hold on to the look of an old (oracle forms) application, and those applications show readonly data with a disabled inputfield. 2010/5/26 Steven Pemberton <Ste...@cw...>: > On Wed, 26 May 2010 12:11:19 +0200, Mark van den Boomen > <ko...@gm...> wrote: > >> Given the following XML: >> >> <root> >> <item> >> <value>1</value> >> </item> >> <item> >> <value>2</value> >> </item> >> <item> >> <value>3</value> >> </item> >> </root> >> >> The items are displayed in a table using xforms:repeat containing the >> editable inputs. Under the table is a xforms:input which should be >> disabled. If an user sets focus to one of the editable inputs then the >> input under the table should show the value of the selected input in >> the table. >> >> The problem is when using a xforms:bind to set the value to readonly >> it will set both inputs readonly. Is there a way to set the readonly >> independent for the inputs? > > I'm not sure if I understand the problem, but why not use an <output> > under the table, and an input in the repeat? > > Best wishes, > > Steven Pemberton > >> >> Thanks, >> >> Mark >> >> ------------------------------------------------------------------------------ >> >> _______________________________________________ >> Xsltforms-support mailing list >> Xsl...@li... >> https://lists.sourceforge.net/lists/listinfo/xsltforms-support > > ------------------------------------------------------------------------------ > > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > |
|
From: Javier D. <jd...@ge...> - 2010-05-26 12:57:56
|
Mark van den Boomen escribió:
> Given the following XML:
>
> <root>
> <item>
> <value>1</value>
> </item>
> <item>
> <value>2</value>
> </item>
> <item>
> <value>3</value>
> </item>
> </root>
>
> The items are displayed in a table using xforms:repeat containing the
> editable inputs. Under the table is a xforms:input which should be
> disabled. If an user sets focus to one of the editable inputs then the
> input under the table should show the value of the selected input in
> the table.
>
> The problem is when using a xforms:bind to set the value to readonly
> it will set both inputs readonly. Is there a way to set the readonly
> independent for the inputs?
>
Do you have the complete example? With inputs, binds, and so on. I think
we did something similar, I'm not sure if may help you.
<xf:bind
nodeset="/ACT_INTERCONEXION_IP/TRAZADO/POLITICA_INTERCONEXION/INTERCONEXION[*]/pPAI_IP[*]/ID_PPAI_IP"
relevant="true()" required="true()"
readonly="not(compare(instance('estado')/ACCION,'BAJA'))"
constraint="*count(../../pPAI_IP[ID_PPAI_IP = current()]) < 2*"
type="xsd:string"/>
We have a xforms with the following binding, and the constraint is
activated only in these elements of the repeat where the xpath assertion
is true. In our case, we get an error message when two elements of the
repeat had the same value.
I don't know if this is similar with focus event, I hope it may help you.
Best Regards,
Javier
> Thanks,
>
> Mark
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Xsltforms-support mailing list
> Xsl...@li...
> https://lists.sourceforge.net/lists/listinfo/xsltforms-support
>
|
|
From: Mark v. d. B. <ko...@gm...> - 2010-05-26 13:02:41
|
Hi Javier, Here is the code illustrating the problem: <?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?> <?xsltforms-options debug="yes"?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ev="http://www.w3.org/2001/xml-events" xml:lang="nl" lang="nl"> <head> <title>Test</title> <xf:model id="overzicht"> <xf:instance id="selectiescherm"> <root> <item> <value>1</value> </item> <item> <value>2</value> </item> <item> <value>3</value> </item> </root> </xf:instance> <xf:bind nodeset="/root/item/value" readonly="false()" /> </xf:model> </head> <body> <table> <xf:repeat nodeset="/root/item" id="items"> <tr> <td> <strong>This field should be editable:</strong> <xf:input ref="value" /> </td> </tr> </xf:repeat> </table> <hr/> <strong>This field should be readonly:</strong> <xf:input ref="/root/item[position() = index('items')]/value" /> </body> </html> I think that your code is solving not the same problem as mine. Thanks Mark 2010/5/26 Javier Díaz <jd...@ge...>: > > Do you have the complete example? With inputs, binds, and so on. I think we > did something similar, I'm not sure if may help you. > > > <xf:bind > nodeset="/ACT_INTERCONEXION_IP/TRAZADO/POLITICA_INTERCONEXION/INTERCONEXION[*]/pPAI_IP[*]/ID_PPAI_IP" > relevant="true()" required="true()" > readonly="not(compare(instance('estado')/ACCION,'BAJA'))" > constraint="count(../../pPAI_IP[ID_PPAI_IP = current()]) < 2" > type="xsd:string"/> > > We have a xforms with the following binding, and the constraint is activated > only in these elements of the repeat where the xpath assertion is true. In > our case, we get an error message when two elements of the repeat had the > same value. > > I don't know if this is similar with focus event, I hope it may help you. > > Best Regards, > Javier > > Thanks, > > Mark > > ------------------------------------------------------------------------------ > > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > |
|
From: Steven P. <Ste...@cw...> - 2010-05-26 13:22:18
|
Clearly the second input should be an output. An output is just an input that is always read-only. Best wishes, Steven Pemberton On Wed, 26 May 2010 15:02:30 +0200, Mark van den Boomen <ko...@gm...> wrote: > Hi Javier, > > Here is the code illustrating the problem: > > <?xml-stylesheet href="xsltforms/xsltforms.xsl" type="text/xsl"?> > <?xsltforms-options debug="yes"?> > <html xmlns="http://www.w3.org/1999/xhtml" > xmlns:xf="http://www.w3.org/2002/xforms" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:ev="http://www.w3.org/2001/xml-events" > xml:lang="nl" lang="nl"> > <head> > > <title>Test</title> > > <xf:model id="overzicht"> > <xf:instance id="selectiescherm"> > <root> > <item> > <value>1</value> > </item> > <item> > <value>2</value> > </item> > <item> > <value>3</value> > </item> > </root> > </xf:instance> > <xf:bind nodeset="/root/item/value" readonly="false()" /> > </xf:model> > > </head> > <body> > <table> > <xf:repeat nodeset="/root/item" id="items"> > <tr> > <td> > <strong>This field should be editable:</strong> > <xf:input ref="value" /> > </td> > </tr> > </xf:repeat> > </table> > <hr/> > <strong>This field should be readonly:</strong> > <xf:input ref="/root/item[position() = index('items')]/value" /> > </body> > </html> > > > I think that your code is solving not the same problem as mine. > > Thanks > > Mark > > 2010/5/26 Javier Díaz <jd...@ge...>: >> >> Do you have the complete example? With inputs, binds, and so on. I >> think we >> did something similar, I'm not sure if may help you. >> >> >> <xf:bind >> nodeset="/ACT_INTERCONEXION_IP/TRAZADO/POLITICA_INTERCONEXION/INTERCONEXION[*]/pPAI_IP[*]/ID_PPAI_IP" >> relevant="true()" required="true()" >> readonly="not(compare(instance('estado')/ACCION,'BAJA'))" >> constraint="count(../../pPAI_IP[ID_PPAI_IP = current()]) < 2" >> type="xsd:string"/> >> >> We have a xforms with the following binding, and the constraint is >> activated >> only in these elements of the repeat where the xpath assertion is true. >> In >> our case, we get an error message when two elements of the repeat had >> the >> same value. >> >> I don't know if this is similar with focus event, I hope it may help >> you. >> >> Best Regards, >> Javier >> >> Thanks, >> >> Mark >> >> ------------------------------------------------------------------------------ >> >> _______________________________________________ >> Xsltforms-support mailing list >> Xsl...@li... >> https://lists.sourceforge.net/lists/listinfo/xsltforms-support >> > > ------------------------------------------------------------------------------ > > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support |
|
From: Steven P. <Ste...@cw...> - 2010-05-26 13:29:03
|
On Wed, 26 May 2010 12:50:30 +0200, Mark van den Boomen <ko...@gm...> wrote: > The problem is that the client wants to hold on to the look of an old > (oracle forms) application, and those applications show readonly data > with a disabled inputfield. That's just a CSS issue. Shouldn't be hard. Best wishes, Steven Pemberton > > 2010/5/26 Steven Pemberton <Ste...@cw...>: >> On Wed, 26 May 2010 12:11:19 +0200, Mark van den Boomen >> <ko...@gm...> wrote: >> >>> Given the following XML: >>> >>> <root> >>> <item> >>> <value>1</value> >>> </item> >>> <item> >>> <value>2</value> >>> </item> >>> <item> >>> <value>3</value> >>> </item> >>> </root> >>> >>> The items are displayed in a table using xforms:repeat containing the >>> editable inputs. Under the table is a xforms:input which should be >>> disabled. If an user sets focus to one of the editable inputs then the >>> input under the table should show the value of the selected input in >>> the table. >>> >>> The problem is when using a xforms:bind to set the value to readonly >>> it will set both inputs readonly. Is there a way to set the readonly >>> independent for the inputs? >> >> I'm not sure if I understand the problem, but why not use an <output> >> under the table, and an input in the repeat? >> >> Best wishes, >> >> Steven Pemberton >> >>> >>> Thanks, >>> >>> Mark >>> >>> ------------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> Xsltforms-support mailing list >>> Xsl...@li... >>> https://lists.sourceforge.net/lists/listinfo/xsltforms-support >> >> ------------------------------------------------------------------------------ >> >> _______________________________________________ >> Xsltforms-support mailing list >> Xsl...@li... >> https://lists.sourceforge.net/lists/listinfo/xsltforms-support |
|
From: Mark v. d. B. <ko...@gm...> - 2010-05-26 16:25:51
|
Done it the CSS way, but only one problem remains: when a value is long it will stretch the field, a inputfield wil allow the user to scroll through the contents of the box. 2010/5/26 Steven Pemberton <Ste...@cw...>: > On Wed, 26 May 2010 12:50:30 +0200, Mark van den Boomen <ko...@gm...> > wrote: > >> The problem is that the client wants to hold on to the look of an old >> (oracle forms) application, and those applications show readonly data >> with a disabled inputfield. > > That's just a CSS issue. Shouldn't be hard. > > Best wishes, > > Steven Pemberton > >> >> 2010/5/26 Steven Pemberton <Ste...@cw...>: >>> >>> On Wed, 26 May 2010 12:11:19 +0200, Mark van den Boomen >>> <ko...@gm...> wrote: >>> >>>> Given the following XML: >>>> >>>> <root> >>>> <item> >>>> <value>1</value> >>>> </item> >>>> <item> >>>> <value>2</value> >>>> </item> >>>> <item> >>>> <value>3</value> >>>> </item> >>>> </root> >>>> >>>> The items are displayed in a table using xforms:repeat containing the >>>> editable inputs. Under the table is a xforms:input which should be >>>> disabled. If an user sets focus to one of the editable inputs then the >>>> input under the table should show the value of the selected input in >>>> the table. >>>> >>>> The problem is when using a xforms:bind to set the value to readonly >>>> it will set both inputs readonly. Is there a way to set the readonly >>>> independent for the inputs? >>> >>> I'm not sure if I understand the problem, but why not use an <output> >>> under the table, and an input in the repeat? >>> >>> Best wishes, >>> >>> Steven Pemberton >>> >>>> >>>> Thanks, >>>> >>>> Mark >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> >>>> _______________________________________________ >>>> Xsltforms-support mailing list >>>> Xsl...@li... >>>> https://lists.sourceforge.net/lists/listinfo/xsltforms-support >>> >>> >>> ------------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> Xsltforms-support mailing list >>> Xsl...@li... >>> https://lists.sourceforge.net/lists/listinfo/xsltforms-support > |
|
From: Steven P. <Ste...@cw...> - 2010-05-27 09:49:38
|
Off the top of my head: height: 3em; /* or whatever */ width: 10em; /* or whatever */ overflow: scroll; On Wed, 26 May 2010 18:12:34 +0200, Mark van den Boomen <ko...@gm...> wrote: > Done it the CSS way, but only one problem remains: when a value is > long it will stretch the field, a inputfield wil allow the user to > scroll through the contents of the box. > > 2010/5/26 Steven Pemberton <Ste...@cw...>: >> On Wed, 26 May 2010 12:50:30 +0200, Mark van den Boomen >> <ko...@gm...> >> wrote: >> >>> The problem is that the client wants to hold on to the look of an old >>> (oracle forms) application, and those applications show readonly data >>> with a disabled inputfield. >> >> That's just a CSS issue. Shouldn't be hard. >> >> Best wishes, >> >> Steven Pemberton >> >>> >>> 2010/5/26 Steven Pemberton <Ste...@cw...>: >>>> >>>> On Wed, 26 May 2010 12:11:19 +0200, Mark van den Boomen >>>> <ko...@gm...> wrote: >>>> >>>>> Given the following XML: >>>>> >>>>> <root> >>>>> <item> >>>>> <value>1</value> >>>>> </item> >>>>> <item> >>>>> <value>2</value> >>>>> </item> >>>>> <item> >>>>> <value>3</value> >>>>> </item> >>>>> </root> >>>>> >>>>> The items are displayed in a table using xforms:repeat containing the >>>>> editable inputs. Under the table is a xforms:input which should be >>>>> disabled. If an user sets focus to one of the editable inputs then >>>>> the >>>>> input under the table should show the value of the selected input in >>>>> the table. >>>>> >>>>> The problem is when using a xforms:bind to set the value to readonly >>>>> it will set both inputs readonly. Is there a way to set the readonly >>>>> independent for the inputs? >>>> >>>> I'm not sure if I understand the problem, but why not use an <output> >>>> under the table, and an input in the repeat? >>>> >>>> Best wishes, >>>> >>>> Steven Pemberton >>>> >>>>> >>>>> Thanks, >>>>> >>>>> Mark >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> >>>>> _______________________________________________ >>>>> Xsltforms-support mailing list >>>>> Xsl...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/xsltforms-support >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> >>>> _______________________________________________ >>>> Xsltforms-support mailing list >>>> Xsl...@li... >>>> https://lists.sourceforge.net/lists/listinfo/xsltforms-support |