Hi! I'm
trying to find the proper CSS styling that woud allow me to do this:
I have a repeat within a table with 3 columns: in the first the index of the repeat, in the second, the contents of the repeat, and in the third controls associated with editing that entry (delete item, edit item, etc). I have triggers displayed as icons in this third column cell - I placed this triggers in a div inside this table cell. However I'd like that DIV only to be visible when the repeat item is selected. (I think it would look a lot better if the same controls were not repeated for every row!) But.. I don't want to apply styling to the entire repeat item, but to a particular DIV within that repeat item. Somewhere I found the name of the CSS selector I need to use (can't remember the exact name offhand), and tried using something like ".xforms-repeat-item-disabled-2 div" but this won't work for me as there's more than one DIV in the repeat item - I only want one particular div in repeat item made visible or invisible. How would I get something like ".xforms-repeat-item-disabled-2 div.myClass" work, so I can choose a particular DIV to be styled? Any help with this is appreciated! -- --- Francis -- 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
-- Francis
|
Administrator
|
Francis,
Assuming you have the repeat around a div and you have one level of repeat, then you'll have a xforms-repeat-selected-item-1 class on that div. So you should be able to write CSS that hides the buttons unless there is an xforms-repeat-selected-item-1 on the container. Alex On Tue, May 25, 2010 at 7:22 PM, Francis Parsons <[hidden email]> wrote: > Hi! I'm trying to find the proper CSS styling that woud allow me to do this: > > I have a repeat within a table with 3 columns: in the first the index of the > repeat, in the second, the contents of the repeat, and in the third controls > associated with editing that entry (delete item, edit item, etc). > > I have triggers displayed as icons in this third column cell - I placed this > triggers in a div inside this table cell. However I'd like that DIV only to > be visible when the repeat item is selected. (I think it would look a lot > better if the same controls were not repeated for every row!) But.. I don't > want to apply styling to the entire repeat item, but to a particular DIV > within that repeat item. > > Somewhere I found the name of the CSS selector I need to use (can't remember > the exact name offhand), and tried using something like > ".xforms-repeat-item-disabled-2 div" but this won't work for me as there's > more than one DIV in the repeat item - I only want one particular div in > repeat item made visible or invisible. How would I get something like > ".xforms-repeat-item-disabled-2 div.myClass" work, so I can choose a > particular DIV to be styled? > > Any help with this is appreciated! > > -- > --- Francis > > -- > 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 > > -- Orbeon Forms - Web forms, open-source, for the Enterprise - http://www.orbeon.com/ My Twitter: http://twitter.com/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 |
Alex - thanks for your reply. I did find that
".xforms-repeat-selected-item-2 div.controlDiv" did work in my form for a DIV (in the repeated table row) having the class "controlDiv"...I'm not really sure why I had trouble with this the first time I tried it, but it does seem to work. So having the DIV only visible when that row is selected works, except that I found a new problem and don't know if there's a way around it. In the DIV that I want to hide, I have 3 triggers, with just icons for labels - one for 'edit item', one for 'delete item' (xforms:delete) and one for 'insert item' (xforms:insert). There are three types of items you can insert (after the currently selected item), so the 'insert' trigger shows a little dialog with 3 other triggers to select. I have this in the CSS: --- div.controlDiv{ vertical-align: middle; text-align: right; visibility: hidden; } .xforms-repeat-selected-item-2 div.controlDiv{ visibility: visible; } --- What I found was when inserting a new item, the new item will be inserted and then the new row appears selected, but the div remains styled in the default manner (visibility:hidden) If you go to another row, then go back to the row that was just inserted, it will appear, but obviously I need a way to fix this. BTW, using the trigger for <xforms:delete> does not do this. My markup for my "insert" action I believe is OK: --- <xforms:insert context="$current-question-block/QUESTIONS" nodeset="QUESTION_ITEM" at="index('question-item-repeat')" position="after" origin="instance('new-items-instance')/QITEM_RESPONSE_FREETEXT/QUESTION_ITEM"/> --- If I use "position=before" instead of "position=after", this doesn't happen - I guess just because this way it doesn't matter if the 'selected' style isn't applied. Is there something obvious I'm doing wrong here? I tried all sorts of things to get this to work. I'd really like to use icons instead of text, but would very much like to have the icons only appear for the selected row. Also, I'd rather use 'insert after' is more useful than 'insert before' because you can use it both at the beginning and ending of the table. Is this expected behavior? Could anyone suggest a workaround? I wondered if attribute value templates (class="{}") could be of use here but I wasn't sure how I could use them here. Any help is appreciated! On Wed, 26 May 2010 10:08:16 -0700, Alessandro Vernet <[hidden email]> wrote: > Francis, > > Assuming you have the repeat around a div and you have one level of > repeat, then you'll have a xforms-repeat-selected-item-1 class on that > div. So you should be able to write CSS that hides the buttons unless > there is an xforms-repeat-selected-item-1 on the container. > > Alex > -- Francis -- 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
-- Francis
|
Administrator
|
Francis,
I don't see anything obviously wrong, but I might be missing something as I try to picture what you are describing. Would you be able to create a small example that shows what you are describing here, so we can try this out? Alex On Wed, May 26, 2010 at 11:09 AM, Francis Parsons <[hidden email]> wrote: > Alex - thanks for your reply. I did find that > ".xforms-repeat-selected-item-2 div.controlDiv" did work in my form for a > DIV (in the repeated table row) having the class "controlDiv"...I'm not > really sure why I had trouble with this the first time I tried it, but it > does seem to work. So having the DIV only visible when that row is selected > works, except that I found a new problem and don't know if there's a way > around it. > > In the DIV that I want to hide, I have 3 triggers, with just icons for > labels - one for 'edit item', one for 'delete item' (xforms:delete) and one > for 'insert item' (xforms:insert). There are three types of items you can > insert (after the currently selected item), so the 'insert' trigger shows a > little dialog with 3 other triggers to select. > > I have this in the CSS: > --- > div.controlDiv{ > vertical-align: middle; > text-align: right; > visibility: hidden; > } > .xforms-repeat-selected-item-2 div.controlDiv{ > visibility: visible; > } > --- > > What I found was when inserting a new item, the new item will be inserted > and then the new row appears selected, but the div remains styled in the > default manner (visibility:hidden) If you go to another row, then go back > to the row that was just inserted, it will appear, but obviously I need a > way to fix this. BTW, using the trigger for <xforms:delete> does not do > this. My markup for my "insert" action I believe is OK: > --- > <xforms:insert context="$current-question-block/QUESTIONS" > nodeset="QUESTION_ITEM" at="index('question-item-repeat')" position="after" > origin="instance('new-items-instance')/QITEM_RESPONSE_FREETEXT/QUESTION_ITEM"/> > --- > > If I use "position=before" instead of "position=after", this doesn't happen > - I guess just because this way it doesn't matter if the 'selected' style > isn't applied. > > Is there something obvious I'm doing wrong here? I tried all sorts of > things to get this to work. I'd really like to use icons instead of text, > but would very much like to have the icons only appear for the selected > row. Also, I'd rather use 'insert after' is more useful than 'insert > before' because you can use it both at the beginning and ending of the > table. > > Is this expected behavior? Could anyone suggest a workaround? I wondered if > attribute value templates (class="{}") could be of use here but I wasn't > sure how I could use them here. Any help is appreciated! > > > On Wed, 26 May 2010 10:08:16 -0700, Alessandro Vernet <[hidden email]> > wrote: >> Francis, >> >> Assuming you have the repeat around a div and you have one level of >> repeat, then you'll have a xforms-repeat-selected-item-1 class on that >> div. So you should be able to write CSS that hides the buttons unless >> there is an xforms-repeat-selected-item-1 on the container. >> >> Alex >> > > > -- > Francis > > > -- > 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 > > -- Orbeon Forms - Web forms, open-source, for the Enterprise - http://www.orbeon.com/ My Twitter: http://twitter.com/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 |
Alex -
I did try recreating this and found some puzzling results. I simplified what I had:
--a repeat nested in a repeat
--three table columns: index, "record" contents, "record" controls
--triggers in the third column are in a DIV that is by default hidden
--triggers use images for labels
--".xforms-repeat-selected-item" selector makes the div visible
What I found:
--if in "config/properties-local.xml" I use "<property as="xs:anyURI" name="oxf.epilogue.theme" value="oxf:/config/<b>theme-plain.xsl"/>" it has this problem, but if I comment it out, it doesn't (except that it takes a second for the div on the newly created record to become visible)
--it doesn't do this (in any circumstance) if text is used for the label instead of an image
repeatSelectedTest.zip
-- Francis
|
In reply to this post by Alessandro Vernet
Alex -
I did try recreating this and found some puzzling results. I simplified what I had:
* a repeat nested in a repeat
* three table columns: index, "record" contents, "record" controls
* triggers in the third column are in a DIV that is by default hidden
* triggers use images for labels
* ".xforms-repeat-selected-item" selector makes the div visible
What I found:
* if in "config/properties-local.xml" I use "<property as="xs:anyURI" name="oxf.epilogue.theme" value="oxf:/config/<b>theme-plain.xsl"/>" it has this problem, but if I comment it out, it doesn't (except that it takes a second for the div on the newly created record to become visible)
* it doesn't do this (in any circumstance) if text is used for the label instead of an image
I attached an XHTML file and three images if you'd like to try it:
repeatSelectedTest.zip
-- Francis
|
forgot to add-
another strange thing: without the "theme-plain.xsl", the first add is successful and quick, the second can take longer, but in my .xhtml, (not in the one I attached), I can force it to update by hovering over a dropdown control in that record.
-- Francis
|
In reply to this post by Alessandro Vernet
Hi, I’ve just migrated from Orbeon Forms 3.7beta to
3.8.0.rc1.201005041622 and I’ve been having problems with the
authentication for my migrated apps. I’ve reproduced the problem by making modifications to
the sample ”java-authentication” example [modified version
attached] Basically, I’ve added a submission / pipeline
which is triggered by xforms-ready. It just puts some data into a new instance
in the model (addresses-instance). I also changed the security-constraint in web.xml, adding a
wildcard to the url-pattern: <security-constraint>
<web-resource-collection>
<web-resource-name>Authentication example</web-resource-name>
<url-pattern>/java-authentication/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>orbeon-admin</role-name>
</auth-constraint> </security-constraint> The issue is that, when my security constraint in the
web.xml file covers both the web form and the XPL service, the login screen
seems to be triggered for both in succession: First for the form when I attempt
to load it (no problem) but also again for the XPL service when it is triggered
by the xforms-ready event. This makes the submission fail because the system
tries to replace my addresses-instance with the login form (“Body
received with non-XML media type for replace="instance": text/html”).
The pipeline itself never runs. It’s as if the initial
authentication, triggered by initially loading the form, was not complete
before the xforms-ready event fired. If I reload the form, it works fine, as I’m already
authenticated This issue didn’t occur in version 3.7beta. Regards, Alan. -- 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 tns-java-authentication.zip (8K) Download Attachment |
Oops, I just realized that I’d
attached the wrong application demonstrating this problem. Correct version attached. Some additional information: ·
I’m running on
apache tomcat version 5.5.26, JVM version 1.5.0_12-b04. ·
The problem, as
demonstrated in the attached app, does not occur the first time you run it
after a tomcat restart. If you log out you then see the problem every subsequent
time you first access the application after a logout. [http://localhost:8080/orbeon/java-authentication/] Has anyone else seen such
authentication issues in version 3.8.0? I’ve just tried it again
with the latest stable build (3.8.0.201005141856)
and it’s still happening. Regards, Alan. From: Leavy, Alan Hi, I’ve just migrated from Orbeon Forms 3.7beta to
3.8.0.rc1.201005041622 and I’ve been having problems with the
authentication for my migrated apps. I’ve reproduced the problem by making modifications to
the sample ”java-authentication” example [modified version
attached] Basically, I’ve added a submission / pipeline
which is triggered by xforms-ready. It just puts some data into a new instance
in the model (addresses-instance). I also changed the security-constraint in web.xml, adding a
wildcard to the url-pattern: <security-constraint>
<web-resource-collection>
<web-resource-name>Authentication example</web-resource-name>
<url-pattern>/java-authentication/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>orbeon-admin</role-name>
</auth-constraint> </security-constraint> The issue is that, when my security constraint in the
web.xml file covers both the web form and the XPL service, the login screen
seems to be triggered for both in succession: First for the form when I attempt
to load it (no problem) but also again for the XPL service when it is triggered
by the xforms-ready event. This makes the submission fail because the system
tries to replace my addresses-instance with the login form (“Body
received with non-XML media type for replace="instance":
text/html”). The pipeline itself never runs. It’s as if the
initial authentication, triggered by initially loading the form, was not
complete before the xforms-ready event fired. If I reload the form, it works fine, as I’m already
authenticated This issue didn’t occur in version 3.7beta. Regards, Alan. -- 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 java-authentication.zip (8K) Download Attachment |
Alan - from here it looks like you've replied to the wrong thread!
-- Francis
|
In reply to this post by Alan Leavy
Reposting as this somehow ended up on the wrong thread first
time: Hi, I’ve just migrated from Orbeon Forms 3.7beta to 3.8.0.201005141856
and I’ve been having problems with the authentication for my migrated
apps. I’ve reproduced the problem by making modifications to
the sample ”java-authentication” example [modified version
attached] Basically, I’ve added a submission / pipeline
which is triggered by xforms-ready. It just puts some data into a new instance
in the model (addresses-instance). I also changed the security-constraint in web.xml, adding a
wildcard to the url-pattern: <security-constraint>
<web-resource-collection>
<web-resource-name>Authentication example</web-resource-name>
<url-pattern>/java-authentication/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>orbeon-admin</role-name>
</auth-constraint> </security-constraint> The issue is that, when my security constraint in the web.xml
file covers both the web form and the XPL service, the login screen seems to be
triggered for both in succession: First for the form when I attempt to load it
(no problem) but also again for the XPL service when it is triggered by the
xforms-ready event. This makes the submission fail because the system tries to
replace my addresses-instance with the login form (“Body received with
non-XML media type for replace="instance": text/html”). The
pipeline itself never runs. It’s as if the initial authentication,
triggered by initially loading the form, was not complete before the
xforms-ready event fired. If I reload the form, it works fine, as I’m already
authenticated This issue didn’t occur in version 3.7beta. I’m running on apache tomcat version 5.5.26, JVM
version 1.5.0_12-b04. The problem, as demonstrated in the attached app, does not always
occur the first time you run it after a tomcat restart. If you log out you then
see the problem every subsequent time you first access the application after a
logout. [http://localhost:8080/orbeon/java-authentication/] Has anyone else seen such authentication issues in version
3.8.0? Regards, Alan. -- 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 java-authentication.zip (8K) Download Attachment |
Free forum by Nabble | Edit this page |