Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Riina Antikainen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 59302d14
authored
Jun 02, 2015
by
Juho Juopperi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nicer ui for changing card state in cart
1 parent
02b0d83c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
17 deletions
code/moya-web/WebContent/useradmin/userCartShow.xhtml
code/moya-web/src/main/java/fi/codecrew/moya/web/cdiview/user/UserView.java
code/moya-web/WebContent/useradmin/userCartShow.xhtml
View file @
59302d1
...
...
@@ -27,27 +27,16 @@
<h2>
Card
</h2>
<h:form>
<p:panelGrid
columns=
"2"
>
<h:outputText
value=
"#{i18n['
card.nam
e']}"
/>
<h:outputText
value=
"#{i18n['
printedCard.templat
e']}"
/>
<h:outputText
value=
"#{userView.printedCard.template.name}"
/>
<h:outputText
value=
"#{i18n['printedCard.cardState']}"
/>
:
<h:outputText
value=
"#{userView.printedCard.cardState}"
/>
<p:commandButton
id=
"setPendingButton"
value=
"#{i18n['printedCard.setState.pending']}"
actionListener=
"#{userCartView.setPendingListener}"
/>
<p:commandButton
id=
"setRejectedButton"
value=
"#{i18n['printedCard.setState.rejected']}"
/>
<p:commandButton
id=
"setValidatedButton"
value=
"#{i18n['printedCard.setState.validated']}"
/>
<p:commandButton
id=
"setDeliveredButton"
value=
"#{i18n['printedCard.setState.delivered']}"
/>
<!--
<h:selectOneMenu value="#{userView.printedCard.cardState}">
<h:outputText
value=
"#{i18n['printedCard.cardState']}"
/>
<p:selectOneButton
value=
"#{userView.printedCard.cardState}"
valueChangeListener=
"#{userView.cardStateChangeListener}"
>
<f:selectItems
value=
"#{userView.printedCardStates}"
/>
</h:selectOneMenu>
<h:commandButton action="#{userView.setCardState()}" value="#{i18n['printedCard.setState']}" />
-->
<f:ajax/>
</p:selectOneButton>
</p:panelGrid>
</h:form>
</ui:fragment>
...
...
code/moya-web/src/main/java/fi/codecrew/moya/web/cdiview/user/UserView.java
View file @
59302d1
...
...
@@ -29,6 +29,8 @@ import javax.enterprise.context.ConversationScoped;
import
javax.enterprise.inject.Produces
;
import
javax.faces.application.FacesMessage
;
import
javax.faces.context.FacesContext
;
import
javax.faces.event.ActionEvent
;
import
javax.faces.event.ValueChangeEvent
;
import
javax.inject.Inject
;
import
javax.inject.Named
;
import
javax.json.JsonObject
;
...
...
@@ -657,4 +659,8 @@ public class UserView extends GenericCDIView {
this
.
emailCheck
=
emailCheck
;
}
public
void
cardStateChangeListener
(
ValueChangeEvent
valueChange
)
{
logger
.
debug
(
"PrintedCard state changed from {} to {}"
,
valueChange
.
getOldValue
(),
valueChange
.
getNewValue
());
cardBean
.
saveCard
(
printedCard
);
}
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment