Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Betsy,
- Nothing is simple... until you do it the first time... or maybe even the first 100 times. XPages is new. It's different. So you can't get caught up thinking that it's simple to do in the client so it should be simple to do here. It is simple to do in XPages but it's just different.
- I looked at your code.
- In this case I made the assumption that if you didn't want the radio button you wouldn't want the label. So we're talking about the whole table row really.
- It's not in the "Pretty Pane" but I think every "xp" tag does have a rendered property in all properties. I've used this to control rendering based on the value of the component.
- Even though we all hate the core tab control this does seem to work fine if I go to the other tab and back again. Though you might run into additional issues with validation and stuff. Remember you're pretty much working with a single tab at a time and the others don't exist. If you have the update pack or ext. library you can use the dojo tab control which is better. If you don't have those you still can use the dojo tab control but that's a little more manual of a process. Not something I'd recommend.
- Tab controls are good. But just because we've always used them in the client does not mean they translate well to the web. Certainly categorized views don't translate to the web and there are much better ways of getting the same data across. Just my 2 cents.
- My suggestion for now is to work with what you can do and after it's working that really look at the UI.
- Hope this helps!
- Dave
- <?xml version="1.0" encoding="UTF-8"?>
- <xp:view
- xmlns:xp="http://www.ibm.com/xsp/core"
- xmlns:xc="http://www.ibm.com/xsp/custom">
- <xp:this.data>
- <xp:dominoDocument
- formName="LeaveType"
- var="document1" />
- </xp:this.data>
- <xp:tabbedPanel
- id="tabbedPanel1">
- <xp:tabPanel
- label="Main"
- id="tabPanel1"
- style="padding-left:5.0px;padding-right:5.0px;padding-top:2.0px;padding-bottom:2.0px">
- <xp:table
- style="width:100.0%" id="myTable">
- <xp:tr>
- <xp:td
- style="width:150px">
- <xp:label
- value="Leave Type:"
- id="leavetype_Label1"
- for="leavetype1"></xp:label>
- </xp:td>
- <xp:td>
- <xp:comboBox
- id="leaveType"
- value="#{document1.leavetype}">
- <xp:selectItem
- itemLabel="Bereavement"
- itemValue="Bereavement">
- </xp:selectItem>
- <xp:selectItem
- itemLabel="Family Medical Leave Act"
- itemValue="FMLA">
- </xp:selectItem>
- <xp:selectItem
- itemLabel="Floater Day"
- itemValue="Floater Day">
- </xp:selectItem>
- <xp:selectItem
- itemLabel="Jury Duty"
- itemValue="Jury Duty"></xp:selectItem>
- <xp:selectItem
- itemLabel="Leave of Absence"
- itemValue="Leave of Absence">
- </xp:selectItem>
- <xp:selectItem
- itemLabel="Flextime"
- itemValue="Flextime"></xp:selectItem>
- <xp:selectItem
- itemLabel="Reserve Duty"
- itemValue="Reserve Duty">
- </xp:selectItem>
- <xp:selectItem
- itemLabel="Scheduled Sick Leave"
- itemValue="Scheduled Sick Leave">
- </xp:selectItem>
- <xp:selectItem
- itemLabel="Short Term Disability"
- itemValue="Short Term Disability">
- </xp:selectItem>
- <xp:selectItem
- itemLabel="Unscheduled Sick Leave"
- itemValue="Unscheduled Sick Leave">
- </xp:selectItem>
- <xp:selectItem
- itemLabel="Vacation"
- itemValue="Vacation"></xp:selectItem>
- <xp:eventHandler
- event="onchange"
- submit="true"
- refreshMode="partial" refreshId="myTable">
- </xp:eventHandler></xp:comboBox>
- </xp:td>
- </xp:tr>
- <xp:tr>
- <xp:this.rendered><![CDATA[#{javascript:if (getComponent("leaveType").getValue() == "Short Term Disability") {
- return false;
- } else {
- return true;
- }}]]></xp:this.rendered>
- <xp:td>
- <xp:label
- value="Received Physician's Authorization Note?"
- id="drNoteLabel">
- </xp:label>
- </xp:td>
- <xp:td>
- <xp:radioGroup
- id="note"
- value="#{document1.note}"
- defaultValue="No">
- <xp:this.rendered><![CDATA[#{javascript:rendered="#{javascript:getComponent( 'leaveType').getValue() == 'Short Term Disability'}"}]]></xp:this.rendered>
- <xp:selectItem
- itemLabel="Yes"
- itemValue="Yes">
- </xp:selectItem>
- <xp:selectItem
- itemLabel="No"
- itemValue="No">
- </xp:selectItem>
- </xp:radioGroup>
- </xp:td>
- </xp:tr>
- <xp:tr>
- <xp:td></xp:td>
- <xp:td></xp:td>
- </xp:tr>
- <xp:tr>
- <xp:td></xp:td>
- <xp:td></xp:td>
- </xp:tr>
- <xp:tr>
- <xp:td></xp:td>
- <xp:td></xp:td>
- </xp:tr>
- <xp:tr>
- <xp:td></xp:td>
- <xp:td></xp:td>
- </xp:tr>
- <xp:tr>
- <xp:td></xp:td>
- <xp:td></xp:td>
- </xp:tr>
- </xp:table>
- </xp:tabPanel>
- <xp:tabPanel
- label="Approval Section"
- id="tabPanel2"></xp:tabPanel>
- </xp:tabbedPanel>
- </xp:view>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement